CF1555A.PizzaForces

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

PizzaForces is Petya's favorite pizzeria. PizzaForces makes and sells pizzas of three sizes: small pizzas consist of 66 slices, medium ones consist of 88 slices, and large pizzas consist of 1010 slices each. Baking them takes 1515, 2020 and 2525 minutes, respectively.

Petya's birthday is today, and nn 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 nn slices in total. For example:

  • if 1212 friends come to Petya's birthday, he has to order pizzas containing at least 1212 slices in total. He can order two small pizzas, containing exactly 1212 slices, and the time to bake them is 3030 minutes;
  • if 1515 friends come to Petya's birthday, he has to order pizzas containing at least 1515 slices in total. He can order a small pizza and a large pizza, containing 1616 slices, and the time to bake them is 4040 minutes;
  • if 300300 friends come to Petya's birthday, he has to order pizzas containing at least 300300 slices in total. He can order 1515 small pizzas, 1010 medium pizzas and 1313 large pizzas, in total they contain 15⋅6+10⋅8+13⋅10=30015 \cdot 6 + 10 \cdot 8 + 13 \cdot 10 = 300 slices, and the total time to bake them is 15⋅15+10⋅20+13⋅25=75015 \cdot 15 + 10 \cdot 20 + 13 \cdot 25 = 750 minutes;
  • if only one friend comes to Petya's birthday, he can order a small pizza, and the time to bake it is 1515 minutes.

PizzaForces 是 Petya 最爱的披萨店。PizzaForces 制作并销售三种尺寸的披萨:小号披萨包含 66 片,中号披萨包含 88 片,大号披萨包含 1010 片。它们的烘焙时间分别为 1515、2020 和 2525 分钟。

今天是 Petya 的生日,将有 nn 位朋友前来参加,因此他决定从这家最爱的披萨店下单。Petya 希望订购足够多的披萨,使得每位朋友至少能分到一片披萨。订单的烹饪时间等于订单中所有披萨的烘焙时间之和。

你的任务是确定制作总共至少包含 nn 片披萨所需的最少分钟数。例如:

  • 若有 1212 位朋友来参加 Petya 的生日聚会,则他需订购总共至少 1212 片披萨。他可以订购两个小号披萨,恰好共 1212 片,烘焙时间为 3030 分钟;
  • 若有 1515 位朋友来参加 Petya 的生日聚会,则他需订购总共至少 1515 片披萨。他可以订购一个小号披萨和一个大号披萨,共 1616 片,烘焙时间为 4040 分钟;
  • 若有 300300 位朋友来参加 Petya 的生日聚会,则他需订购总共至少 300300 片披萨。他可以订购 1515 个小号披萨、1010 个中号披萨和 1313 个大号披萨,总计 15⋅6+10⋅8+13⋅10=30015 \cdot 6 + 10 \cdot 8 + 13 \cdot 10 = 300 片,总烘焙时间为 15⋅15+10⋅20+13⋅25=75015 \cdot 15 + 10 \cdot 20 + 13 \cdot 25 = 750 分钟;
  • 若仅有 11 位朋友来参加 Petya 的生日聚会,则他可订购一个小号披萨,烘焙时间为 1515 分钟。

输入格式

The first line contains a single integer tt (1≤t≤1041 \le t \le 10^4) — the number of testcases.

Each testcase consists of a single line that contains a single integer nn (1≤n≤10161 \le n \le 10^{16}) — the number of Petya's friends.

第一行包含一个整数 tt(1≤t≤1041 \le t \le 10^4)——测试用例的数量。

每个测试用例由一行组成,该行包含一个整数 nn(1≤n≤10161 \le n \le 10^{16})——Petya 的朋友数量。

输出格式

For each testcase, print one integer — the minimum number of minutes that is needed to bake pizzas containing at least nn slices in total.

对于每个测试用例,输出一个整数——烤制总共至少包含 nn 片的披萨所需的最少分钟数。

输入输出样例

  • 输入#1

    6
    12
    15
    300
    1
    9999999999999999
    3

    输出#1

    30
    40
    750
    15
    25000000000000000
    15

输入解题思路,AI测评打分。不知道怎么写?

首页