#D. 游泳同步起步

    Type: Default 1000ms 256MiB

游泳同步起步

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

33DAI 最近在学游泳。

  • 33DAI 游泳的速度非常稳定。每次从起点出发后都能在 aa 分钟内折返回到起点。
  • Kitten 的游泳的速度也非常稳定。每次从起点出发后都能在 bb 分钟内折返回到起点。

他们一起开始,游了 nn 分钟。请问他们有多少次同时出现在了起点。

输入格式

一行三个整数 a,b,na,b,n

输出格式

一行一个整数,表示两个人同时出现在起点的次数。

3 4 15
2
4 6 33
3
6 8 48
3

样例解释

  • 样例 1 的 22 次同时出现在起点的时间分别为:00 时刻,1212 时刻。
  • 样例 2 的 33 次同时出现在起点的时间分别为:00 时刻,1212 时刻,2424 时刻。
  • 样例 3 的 33 次同时出现在起点的时间分别为:00 时刻,2424 时刻,4848 时刻。

数据规模与约定

对于 100%100\% 的数据,1a,b1031 \le a,b \le 10^31n1041\le n\le 10^4

  • 子任务 1(30 分):保证 a=1a=1
  • 子任务 2(30 分):保证 bbaa 的倍数。
  • 子任务 3(40 分):没有特殊限制。

C++校统测一

Not Attended
Status
Done
Rule
Ledo
Problem
6
Start at
2024-12-22 18:30
End at
2024-12-22 20:00
Duration
1.5 hour(s)
Host
Partic.
28