欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1555A.PizzaForces
PizzaForces
PizzaForces is Petya's favorite pizzeria. PizzaForces makes and sells pizzas of three sizes: small pizzas consist of slices, medium ones consist of slices, and large pizzas consist of slices each. Baking them takes , and minutes, respectively.
Petya's birthday is today, and of his friends will come, so he decided to make an order from his favorite pizzeria. Petya wants to order so much pizza that each of his friends gets at least one slice of pizza. The cooking time of the order is the total baking time of all the pizzas in the order.
Your task is to determine the minimum number of minutes that is needed to make pizzas containing at least slices in total. For example:
- if friends come to Petya's birthday, he has to order pizzas containing at least slices in total. He can order two small pizzas, containing exactly slices, and the time to bake them is minutes;
- if friends come to Petya's birthday, he has to order pizzas containing at least slices in total. He can order a small pizza and a large pizza, containing slices, and the time to bake them is minutes;
- if friends come to Petya's birthday, he has to order pizzas containing at least slices in total. He can order small pizzas, medium pizzas and large pizzas, in total they contain slices, and the total time to bake them is minutes;
- if only one friend comes to Petya's birthday, he can order a small pizza, and the time to bake it is minutes.
Input
The first line contains a single integer () — the number of testcases.
Each testcase consists of a single line that contains a single integer () — the number of Petya's friends.
Output
For each testcase, print one integer — the minimum number of minutes that is needed to bake pizzas containing at least slices in total.
Samples
6
12
15
300
1
9999999999999999
3
30
40
750
15
25000000000000000
15
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |