小柒的数字
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M
64bit IO Format: %lld

题目描述

\hspace{15pt}小柒现在有两个数字 x,y 满足 2 \times x\leq y。小柒想知道,在 [1,n] 的范围内,有多少个整数 z 满足 \big\lfloor \tfrac{z}{x} \big\rfloor = \big\lfloor \tfrac{z}{y} \big\rfloor

\hspace{15pt}在这里,\lfloor x \rfloor 代表对 x 进行下取整操作。

输入描述:

\hspace{15pt}每个测试文件均包含多组测试数据。第一行输入一个整数 T\left(1\leq T\leq 10^5\right) 代表数据组数,每组测试数据描述如下:
\hspace{15pt}在一行上输入三个整数 x,y,n\left(1\leq 2 \times x\leq y\leq 10^9;\ 1\leq n\leq 10^9\right)

输出描述:

\hspace{15pt}对于每一组测试数据,新起一行输出一个整数,代表满足条件的数字 z 的个数。
示例1

输入

复制
3
2 4 3
1 3 1000
1000 10000 100

输出

复制
1
0
100

说明

\hspace{15pt}对于第一组测试数据,全部选取方案如下:
\hspace{23pt}\bullet\,z=1 时,\big\lfloor \tfrac{1}{2} \big\rfloor = 0\big\lfloor \tfrac{1}{4} \big\rfloor = 0
\hspace{23pt}\bullet\,z=2 时,\big\lfloor \tfrac{2}{2} \big\rfloor = 1\big\lfloor \tfrac{2}{4} \big\rfloor = 0
\hspace{23pt}\bullet\,z=3 时,\big\lfloor \tfrac{3}{2} \big\rfloor = 1\big\lfloor \tfrac{3}{4} \big\rfloor = 0
\hspace{15pt}只有 z=1 满足条件。