A. Taymyr is calling you
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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

Ilia-alpinist calls every n minutes, i.e. in minutes n, 2n, 3n and so on. Artists come to the comrade everym minutes, i.e. in minutes m, 2m, 3m and so on. The day is z minutes long, i.e. the day consists of minutes 1, 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.

Input

The only string contains three integers — nm and z (1 ≤ n, m, z ≤ 104).

Output

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

Examples
input
1 1 10
output
10
input
1 2 5
output
2
input
2 3 9
output
1
Note

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.

【题意】:某人每间隔n分钟打一次房间内电话,而一些人每间隔m分钟就进入房间,要阻挠多少个人才能保证在一定时间段z内电话无人接听?


让你求1-z之间有多少数既是n的倍数又是m的倍数(n,m的最小公倍数)。

【代码】:

#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f int main()
{
int n,m,k;
while(cin>>n>>m>>k)
{
cout<<k/(n/(__gcd(n,m))*m)<<endl;
}
return 0;
}

  

Codeforces Round #395 (Div. 2) A. Taymyr is calling you【数论/最小公倍数】的更多相关文章

  1. Codeforces Round #395 (Div. 2)(A.思维,B,水)

    A. Taymyr is calling you time limit per test:1 second memory limit per test:256 megabytes input:stan ...

  2. Codeforces Round #395 (Div. 2)(未完)

    2.2.2017 9:35~11:35 A - Taymyr is calling you 直接模拟 #include <iostream> #include <cstdio> ...

  3. Codeforces Round #395 (Div. 2)

    今天自己模拟了一套题,只写出两道来,第三道时间到了过了几分钟才写出来,啊,太菜了. A. Taymyr is calling you 水题,问你在z范围内  两个序列  n,2*n,3*n...... ...

  4. Codeforces Round #395 (Div. 2) D. Timofey and rectangles

    地址:http://codeforces.com/contest/764/problem/D 题目: D. Timofey and rectangles time limit per test 2 s ...

  5. Codeforces Round #395 (Div. 2) C. Timofey and a tree

    地址:http://codeforces.com/contest/764/problem/C 题目: C. Timofey and a tree time limit per test 2 secon ...

  6. Codeforces Round #395 (Div. 2)B. Timofey and cubes

    地址:http://codeforces.com/contest/764/problem/B 题目: B. Timofey and cubes time limit per test 1 second ...

  7. Codeforces Round #395 (Div. 2) A

    Description Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls f ...

  8. Codeforces Round #395 (Div. 1)

    比赛链接:http://codeforces.com/contest/763 A题: #include <iostream> #include <cstdio> #includ ...

  9. 【分类讨论】Codeforces Round #395 (Div. 2) D. Timofey and rectangles

    D题: 题目思路:给你n个不想交的矩形并别边长为奇数(很有用)问你可以可以只用四种颜色给n个矩形染色使得相接触的 矩形的颜色不相同,我们首先考虑可不可能,我们分析下最多有几个矩形互相接触,两个时可以都 ...

随机推荐

  1. SPRINGBOOT配置事物注解和@MAPPER注意

    MAPPER接口要使用@Mapper注解,不能用@Compent @Repository,否则没有效果 一.开启事物 在启动类上加 @EnableTransactionManagement //如果m ...

  2. NCDC 天气数据的预处理

    "Hadoop: The Definitive Guild" 这本书的例子都是使用NCDC 天气数据的,但由于书的出版和现在已经有一段时间了,NCDC现在提供的原始数据结构已经有了 ...

  3. windows API 第九篇 _tcslwr _strlwr _wcslwr _mbslwr

    将字符串转化为小写Convert a string to lowercase. 函数原型: char *_strlwr( char *string );             //#include ...

  4. ERROR:ORA-30076: 对析出来源无效的析出字段

    DEBUG:key: sql: select count(*) as col_0_0_ from jc_user cmsuser0_ where 1=1 and cmsuser0_.register_ ...

  5. 推荐大家一个个人觉得超级好的Java学习网站

    https://how2j.cn?p=16567 这是网址,网站里有Java基础,Javaweb.框架.数据库.工具.面试题等等的,站长一直在更新新的知识,很好用哦

  6. java随机生成字符串工具类

    package aA; import java.util.ArrayList; import java.util.Arrays; import java.util.Random; /** * 字符随机 ...

  7. 用Python的requests库作接口测试——上传文件

    POST一个多部分编码(Multipart-Encoded)的文件 Requests使得上传多部分编码文件变得很简单: >>> url = 'http://httpbin.org/p ...

  8. Django项目:CRM(客户关系管理系统)--50--41PerfectCRM实现全局账号密码修改

    # gbacc_urls.py # ————————38PerfectCRM实现全局账号登录注销———————— from django.conf.urls import url from gbacc ...

  9. Python之常用文件操作

    Python之常用文件操作

  10. textarea高度自动增高

    <!--随着textarea 输入内容 自动增加高度--> <script type="text/javascript"> $(".input_t ...