This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: n There will be multiple data sets each data set will contain two strictly positive (> 0) integers on a single line. These two integers define an input number, which equals the first integer divided by the second integer, so the input number is a fraction with the first integer as numerator and the second integer as denominator. Output for each data set should be a single line containing just the period of the repeating portion of the binary representation of the input number. The period will always be one or greater and will always be less than or equal to the denominator. The denominator will be less than 10,000,000. Sheet1 Page 2 Hint: The resource limits (See Makefile) forbid a solution whose memory size is linear in the denominator or whose time is quadratic in the denominator. Sample input: 1 12 1 3 10 24 4 8 8 4 2 7 6251832 8954347 Sample output: 2 2 2 1 1 3 8954346...
View
Full
Document
This note was uploaded on 04/29/2011 for the course IT 201 taught by Professor K.v.arya during the Spring '11 term at IIT Kanpur.
 Spring '11
 k.v.arya

Click to edit the document details