### BlueBook

## p171ex7: Payment

Given N (0 ≤ N ≤ 1 000 000), you are to count how many times N falls into any of the 6 ranges given below.

Range A | 0 .. 9999 |

Range B | 10000 .. 19999 |

Range C | 20000 .. 29999 |

Range D | 30000 .. 39999 |

Range E | 40000 .. 49999 |

Range F | 50000 .. 1000000 |

### Input

Input consists of bunch of integers (0 ≤ N ≤ 1000000) which will be terminated by '-1'.

There will always be less than 10000 integers.

### Output

Output the number of occurences of N in the ranges A .. F.
Output '0' if N was never found for that particular range.

Do not include -1 into your calculations.

### Sample Input

1

9999

10001

1000000

29999

-1

### Sample Output

2

1

1

0

0

1

All Submissions

Best Solutions

**Point Value:** 3

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Oct 26, 2008

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

ss3happy1on Oct 10, 2015 - 6:55:10 pm UTC Confused About OutputLike the number 1, isn't it ONLY in Range A once? And doesn't appear in any other range? Why would the output be 2?

jargonon Oct 10, 2015 - 8:02:55 pm UTC Re: Confused About OutputIn the sample case, there are two integers in Range A: 1 and 9999.

Robinon Dec 14, 2013 - 1:33:25 am UTC ConfusedMuhammadKhattakon Dec 14, 2013 - 1:45:44 am UTC Re: Confusedpascaleron Jan 15, 2009 - 7:58:37 pm UTCpurohit3105on Jan 16, 2009 - 2:27:50 am UTC Re: ...Patelon Jan 15, 2009 - 4:10:05 am UTC Re: Re: Can someone check!?!purohit3105on Jan 15, 2009 - 12:20:12 pm UTC Re: Re: Re: Can someone check!?!