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;
}
相关推荐
成都渲染101云渲染66663 天前
Blender渲染时,纯CPU渲染的设置教程
前端·javascript·blender
Python私教7 天前
Blender模型导入Godot完整教程:GLB、BLEND与继承场景怎么选
运维·godot·blender
石臻臻的杂货铺11 天前
做 AI 视频,先让 Blender 把镜头演一遍
人工智能·音视频·blender
七牛云行业应用11 天前
用 Codex 操控 Blender 做 3D 场景:从安装 addon 到跑通第一条指令
人工智能·3d·ai编程·blender
renwen157912 天前
Blender简单的UV纹理绘制
blender·uv
麦田里的粮仓23 天前
Blender 建模练习 - 藤蔓
blender
王家视频教程图书馆24 天前
混元3d生成3d模型 blender使用Quad Remesher Bridge 1.3.2重拓扑 mixmo 或者autoRigPro骨骼绑定
blender·骨骼绑定·重拓扑
eggcode25 天前
Blender批量隐藏、显示物体
blender
3D小将25 天前
3D格式转换之Blender工程文件转换GLB格式技术文档
3d·blender·solidworks模型·ug模型·rhino模型·stl模型