Mock CCC '19 Contest 1 J2 - Froggo's Numbers

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Froggo the frog loves a certain group of numbers. He wants to find all the numbers he likes, which are between the numbers l and r. He likes all numbers between l and r that are divisible by x.

Given l, r, and x, how many numbers does Froggo like?

Constraints

  • l and r are nonnegative integers
  • x is a positive integer
  • 0 \le l \le r \le 10^{9}
  • 1 \le x \le 10^{5}

For 20% of the points, 1 \le l, r \le 1000.

Input Specification

The first line of input will contain 3 space separated integers, l, r, and x.

Output Specification

You are to output a single integer: the count of numbers that Froggo likes.

Sample Input 1

5 10 6

Sample Output 1

1

Sample Input 2

3 24 3

Sample Output 2

8

Comments

There are no comments at the moment.