[BOJ 8483] Earthquake

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

The Infinity City is located on an infinite quarterplane. There is an infinite number of sky-scrapers in the city, there is one sky-scraper located at every point with integer coordinates.</p>

One unfortunate day there was an earthquake in the city. There was a huge tectonic crack along the line Ax + By = C and all the sky-scrapers at positions satisfying the inequality Ax + By > C simply disappeared. The city has now become a Finity City with only a finite number of sky-scrapers. But exactly how many?

입력 형식

The only line of input contains three space-separated positive integers A, B, C. They are bounded as follows: A, B ≤ 1 000 000 000, C ≤ min(A, B) × 1 000 000 000.

출력 형식

Your program should output exactly one integer: the number of sky-scrapers in the Finity City.

예제 입력

3 4 13

예제 출력

12

Comments

There are no comments at the moment.