CF764A.Taymyr is calling you

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls from Taymyr from Ilia-alpinist.

Ilia-alpinist calls every nn minutes, i.e. in minutes nn , 2n2n , 3n3n and so on. Artists come to the comrade every mm minutes, i.e. in minutes mm , 2m2m , 3m3m and so on. The day is zz minutes long, i.e. the day consists of minutes 1,2,...,z1,2,...,z . How many artists should be killed so that there are no artists in the room when Ilia calls? Consider that a call and a talk with an artist take exactly one minute.

输入格式

The only string contains three integers — nn , mm and zz ( 1<=n,m,z<=1041<=n,m,z<=10^{4} ).

输出格式

Print single integer — the minimum number of artists that should be killed so that there are no artists in the room when Ilia calls.

输入输出样例

  • 输入#1

    1 1 10
    

    输出#1

    10
    
  • 输入#2

    1 2 5
    

    输出#2

    2
    
  • 输入#3

    2 3 9
    

    输出#3

    1
    

说明/提示

Taymyr is a place in the north of Russia.

In the first test the artists come each minute, as well as the calls, so we need to kill all of them.

In the second test we need to kill artists which come on the second and the fourth minutes.

In the third test — only the artist which comes on the sixth minute.

首页