Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no more than 100 decimal digits.

Input

The input file may contain multiple test cases. Each line contains a value of n (1 <= n <= 200). A line containing a zero terminates the input.

Output

For each value of n in the input print a line containing the corresponding value of m. The decimal representation of m must not contain more than 100 digits. If there are multiple solutions for a given value of n, any one of them is acceptable.

Sample Input

2
6
19
0

Sample Output

10
100100100100100100
111111111111111111
#include<stdio.h>

bool vis;

void dfs( unsigned __int64 sum,int n,int k)
{
if (vis)return ;
if(sum%n==)
{
printf("%I64u\n",sum);
vis=;
return ;
}
if(k==) return;
dfs(sum*,n,k+);
dfs(sum*+,n,k+); } int main()
{
int n;
while(scanf("%d",&n)!=EOF&&n!=){ vis=;
dfs(,n,);
}
return ;
}

2018-11-29

Find The Multiple (水题)的更多相关文章

  1. CF451B Sort the Array 水题

    Codeforces Round #258 (Div. 2) Sort the Array B. Sort the Array time limit per test 1 second memory ...

  2. hdu 1005:Number Sequence(水题)

    Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  3. HDU 4950 Monster (水题)

    Monster 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/I Description Teacher Mai has a k ...

  4. HDU 4593 H - Robot 水题

    H - RobotTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...

  5. Codeforces Gym 100286G Giant Screen 水题

    Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/con ...

  6. HDOJ/HDU 2560 Buildings(嗯~水题)

    Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, ...

  7. hdu5360 Hiking(水题)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Hiking Time Limit: 6000/3000 MS (Java/Oth ...

  8. BestCoder Round #36 (hdu5199)Gunner(水题)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Gunner Time Limit: 8000/4000 MS (Java/Oth ...

  9. <hdu - 3999> The order of a Tree 水题 之 二叉搜索的数的先序输出

    这里是杭电hdu上的链接:http://acm.hdu.edu.cn/showproblem.php?pid=3999  Problem Description: As we know,the sha ...

  10. HDU排序水题

    1040水题; These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fa ...

随机推荐

  1. curl POST如何查看响应的Header(转)

    curl -I 这样其实发送是HEAD请求. 下面这样发送POST请求(-X POST),同时指定Basic认证用户名密码(-u ‘andy:andy’),同时指定数据类型(-H ‘Content-T ...

  2. XML 简介 – 什么是 XML?

    XML 指可扩展标记语言(eXtensible Markup Language). XML 被设计用来传输和存储数据. XML 很重要,也很容易学习. <?xml version="1 ...

  3. C#内存占用释放

    序言 系统启动起来以后,内存占用越来越大,使用析构函数.GC.Collect什么的也不见效果,后来查了好久,找到了个办法,就是使用 SetProcessWorkingSetSize函数.这个函数是Wi ...

  4. java文件断点续传的简单实现

    一.概述 所谓断点续传,其实只是指下载,也就是要从文件已经下载的地方开始继续下载.在以前版本的HTTP协议是不支持断点的,HTTP/1.1开始就支持了.一般断点下载时才用到Range和Content- ...

  5. 小样本学习Few-shot learning

    One-shot learning Zero-shot learning Multi-shot learning Sparse Fine-grained Fine-tune 背景:CVPR 2018收 ...

  6. c++函数相关

    1,内连函数 inline 返回值类型 函数名(形参列表) 普通函数成为内连函数:在普通函数声明之前加上inline 成员函数成为内连函数:在类中定义的函数全部默认为内连函数,可以显示加上inline ...

  7. android api文档:intent阅读笔记

    intent是几大组件之间进行通信的组件.可以包含以下几个部分: component:指明了处理该intent的对象. Action类似于一个函数名,规定了其他部分的对应用法: The action ...

  8. jQuery file upload上传图片出错分析

    以https://github.com/blueimp/jQuery-File-Upload/blob/master/basic-plus.html为例 注释掉load-image.all.min.j ...

  9. tf多值离散embedding方法

    https://www.jianshu.com/p/4a7525c018b2 注意:一个域下的多值情况,这里最终输出是直接给出来每个域的(多值)的embedding值,多个值的也只输出一个embedd ...

  10. 【1】mongoDB 的安装及启动

    MongoDB是一个面向文档(document-oriented)的数据库,不是关系型数据库.与关系型数据库相比,面向文档的数据库没有"行"的概念,取而代之的是"文档&q ...