Advertisement

POJ 1426 Find the multiple BFS search

阅读量:

寻找多重解

Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 18012 Accepted: 7297 Special Judge

Description

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 va

全部评论 (0)

还没有任何评论哟~