浙江中医药大学暑期训练测试赛八A
2017-07-31 09:43
281 查看
1374: Greatest Naruto Army
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 117 Solved: 37
[Submit][Status][Web
Board]
Description
ccc is a VERY VERY BIG fans of Naruto(漩涡鸣人). Naruto's perseverance and passion attract him a lot, so does Naruto's skill "Kagebunsin no jyutu"(影分身术). Actually, ccc knows more details about "Kagebunsin no jyutu" than most of us. When Naruto makesan new illusion(幻象), his Chakra will divide into two parts A and B, and increase Naruto's weariness value by absolutely value of (A - B).
For example, at first Naruto have 5 Chakra, then he makes an illusion who has 2 Chakra. So he left 3 Chakra, and increase his weariness value by 1 (3 - 2). If he make a new illusion again and give him 2 Chakra, then he only left 1 Chakra and his weariness value
changes to 2. Naruto cannot make a new illusion unless his Chakra is bigger than 1. What's more, Naruto's illusion can also use "Kagebunsin no jyutu" and the weariness they gains will also return to Naruto himself.
Now Naruto wants to make as many illusions as he can because Kakashi Sensei wants to teach him a new Ninjyutsu(忍术) and minimum his weariness value.
Input
The first line of input contains an integer T, indicating the number of test cases, then T lines follow , each line contains a positive integer N, indicating the number of Naruto's Chakra.0 < N < 10000000;
Output
For each case ,output the minimum weariness value of Naruto when he makes the most illusions.Sample Input
259Sample Output
23AC代码:
相关文章推荐
- 浙江中医药大学暑期训练测试赛八C
- 浙江中医药大学暑期训练测试赛八E
- 浙江中医药大学暑期训练测试赛十
- 浙江中医药大学暑期训练测试赛八B
- 浙江中医药大学暑期训练测试赛八F
- 浙江中医药大学暑期训练测试赛八H
- 浙江中医药大学暑期训练测试赛八I
- 浙江中医药大学暑期训练测试赛十 英雄无敌3(2) 数学公式
- 浙江中医药大学暑期训练测试赛八G
- 暑期测试训练3
- Tensorflow之用自己的训练好的cpkt模型,进行测试识别
- Caffe中文件参数设置(九-2):训练和测试自己的数据集-windows10版本
- 使用caffe训练并且测试一个自己的模型
- 基于随机采样获取训练、测试数据示例(Python)
- 偏差,方差,训练误差,测试误差的区别
- caffe初探4:对训练得到的模型进行测试
- C++从零实现深度神经网络之三——神经网络的训练和测试
- tencent 2017暑期实习生-软件测试笔试题(回忆篇)
- tensorflow如何使用训练好的模型做测试
- PyTorch(三)——使用训练好的模型测试自己图片