Responsive image

问题 1929 --Position in Fraction【多组实例测试】

1929: Position in Fraction【多组实例测试】

时间限制: 1 Sec  内存限制: 128 MB
提交: 2  解决: 1
[提交][状态][讨论版][命题人:]

题目描述

You have a fraction a/b. You need to find the first occurrence of digit c into decimal notation of the fraction after decimal point.

输入描述

The first contains three single positive integers a, b, c (1 <= a < b <= 10^5, 0 <= c <=9).

输出描述

Print position of the first occurrence of digit c into the fraction. Positions are numbered from 1 after decimal point. It there is no such position, print -1.

样例输入

1 2 0
2 3 7

样例输出

2
-1

来源

[提交][状态]
ACM算法攻关部
  • Anything about this OnlineJudge, Please Contact Administrator. Click add QQ

    OJ system based on HUSTOJ Project , UI based on Twitter Bootstrap

    Copyright 2016 ACM算法攻关部
    关于网站改版