A. Zhan‘s Blender

time limit per test

1 second

memory limit per test

256 megabytes

Today, a club fair was held at "NSPhM". In order to advertise his pastry club, Zhan decided to demonstrate the power of his blender.

To demonstrate the power of his blender, Zhan has nn fruits.

The blender can mix up to xx fruits per second.

In each second, Zhan can put up to yy fruits into the blender. After that, the blender will blend min(x,c)min(x,c) fruits, where cc is the number of fruits inside the blender. After blending, blended fruits are removed from the blender.

Help Zhan determine the minimum amount of time required for Zhan to blend all fruits.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1≤t≤10001≤t≤1000). The description of the test cases follows.

The first line of each test case contains one integer nn (0≤n≤1090≤n≤109) --- the number of fruits Zhan has.

The second line of each test case contains two integers xx and yy (1≤x,y≤1091≤x,y≤109) --- the number of fruits the blender can blend per second and the number of fruits Zhan can put into the blender per second.

Output

For each testcase, output a single integer --- the minimum number of seconds to blend all fruits.

Example

Input

Copy

复制代码

5

5

3 4

3

1 2

6

4 3

100

4 3

9

3 3

Output

Copy

复制代码
2
3
2
34
3

Note

In the first example, you can first put 22 fruits in the blender. After that, the blender will mix these 22 fruits, and in the end, there will be 00 fruits left in the blender. Then you can put 33 fruits into the blender, after which the blender will mix these 33 fruits.

In the second example, you can put 11 fruit into the blender 33 times.

In the third example, you can first put 33 fruits into the blender, then add another 33 fruits.

2

解题说明:此题是一道模拟题,根据题目意思每次可以混合min(x,y)种水果,直到全部处理完为止。

cpp 复制代码
#include <iostream>
#include<algorithm>
using namespace std;

typedef long long ll;

int main()
{
	ll t;
	cin >> t;
	while (t--)
	{
		ll n, x, y;
		cin >> n >> x >> y;
		ll mn = min(x, y);
		ll cnt = n / mn;
		if (n % mn != 0)
		{
			cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}
相关推荐
九河_2 天前
【blender】使用bpy对一个obj的不同mesh进行不同的材质贴图(涉及对bmesh的操作)
blender·材质·贴图·bpy
渲染101专业云渲染16 天前
云端算力革命:川翔云电脑如何重新定义创作自由
云计算·电脑·blender·maya·houdini
3D虚拟工厂18 天前
3D虚拟工厂
3d·vue3·blender·数字孪生·three.js
Tipriest_19 天前
介绍常见的图像和视频存储格式以及其优劣势
音视频·blender·视频格式·图像格式
有过~21 天前
Blender 4.4.3三维动画建模和渲染软件Win/Mac双端资源下载
blender
技术小甜甜21 天前
[Blender] 高质量材质推荐第四弹:25-30号精选纹理资源详解
blender·游戏开发·材质·建模·资源
下次见咯!22 天前
Blender基础知识-操作模式、基本操作、渲染、灯光、材质、粒子系统、动画
blender
AllBlue23 天前
fbx导入blender结构错乱,但在threejs中加载正常
blender·threejs
灵境引路人1 个月前
【Blender】Blender 基础:导入&导出
blender
技术小甜甜1 个月前
【Blender Texture】【游戏开发】高质感 Blender 4K 材质资源推荐合集 —— 提升场景真实感与美术表现力
blender·游戏开发·材质·texture