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;
}
相关推荐
小年糕是糕手4 天前
【Blender】Blender 曲线建模全解析:贝塞尔 / NURBS / 蒙皮 / 置换,从原理到实战
3dsmax·blender·maya
小年糕是糕手5 天前
【Blender】Blender 树叶建模全攻略:3 种叶片 + 阵列 / 镜像 / 晶格工具实战精讲
3dsmax·blender·maya
直爽的鸭蛋6 天前
STL面片模型工具Blender 操作要点
blender
CG_MAGIC7 天前
幕后花絮:用Blender打造自己的建筑
3d·blender·贴图·uv·建模教程·渲云渲染
Axis tech8 天前
如何使用VARJO在VR中查看BLENDER内容分步指南
vr·blender
阿拉丁的梦11 天前
AI生图提示词及AI转模工具试探比较
blender
belldeep12 天前
Blender + AI 全套工作流
人工智能·ai·blender
thankseveryday13 天前
Three.js 把 Blender 绘制的曲线(Bezier / 曲线) 导入 Three.js 并作为运动路径 / 动画路径使用
开发语言·javascript·blender
哎呦哥哥和巨炮叔叔13 天前
Maya / Blender 云解析 | 渲染101一键提交,解析渲染更省心
云计算·blender·云渲染·maya·云解析·特效解算·影视动画云渲染
CG_MAGIC18 天前
Blender×酒店设计|《Cozy Gold》完整呈现
3d·blender·贴图·效果图·建模教程