Թաքցված խնդիր
|Այս խնդիրը թաքցված է խմբագրական խրհրդի անդամի կողմից քանի որ կամ այն ոչ ճիշտ լեզվով է գրված,|կամ թեստային տվյալներն են սխալ, կամ խնդրի ձևակերպումը պարզ չէ։|

ACM_0106 - QUITE GOOD NUMBERS

   A "perfect" number is an integer that is equal to the sum of its divisors (where 1 is considered a divisor).  For example, 6 is perfect because its divisors are 1, 2, and 3, and 1 + 2 + 3 is 6. Similarly, 28 is perfect because it equals 1 + 2 + 4 + 7 + 14.

   A "quite good" number is an integer whose "badness" – the absolute value of the difference between the sum of its divisors and the number itself – is not greater than a specified value. For example, if the allowable badness is set at 2, there are 11 "quite good" numbers less than 100: 2, 3, 4, 6, 8, 10, 16, 20, 28, 32, and 64. But if the allowable badness is set at 0 (corresponding to the "perfect" numbers) there are only 2: 6 and 28.

   Your task is to write a program to count how many quite good numbers (of a specified maximum badness) fall in a specified range.

Input

   Input will consist of specifications for a series of tests.  Information for each test is a single line containing 3 integers with a single space between items:

  • start (2 <= start < 1000000) specifies the first number to test
  • stop (start <= stop < 1000000) specifies the last number to test
  • badness (0 <= badness < 1000) specifies the maximum allowable badness A line containing 3 zeros terminates the input.

Output

   Output should consist of one line for each test comprising the test number (formatted as shown) followed by a single space and the number of values in the test range with badness not greater than the allowable value.

Examples

stdin

stdout

1

2 100 2

2 100 0

1000 9999 3

0 0 0

Test 1: 11

Test 2: 2

Test 3: 6


Ավելացրեց.Հրանտ Հովհաննիսյան
Ամսաթիվ.2014-01-29
Ժամանակի սահմանափակումը.1s
Ծրագրի տեքստի սահմանափակումը.50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Լեզուներ.Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE
Աղբյուրը.Australian Programming Contest 2013.A

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.