Algorithm


A. PizzaForces
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

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 15152020 and 2525 minutes, respectively.

Petya's birthday is today, and n 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 n 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 156+108+1310=30015⋅6+10⋅8+13⋅10=300 slices, and the total time to bake them is 1515+1020+1325=75015⋅15+10⋅20+13⋅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.
Input

The first line contains a single integer t (1t1041≤�≤104) — the number of testcases.

Each testcase consists of a single line that contains a single integer n (1n10161≤�≤1016) — 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 n slices in total.

Example
input
Copy
6
12
15
300
1
9999999999999999
3
output
Copy
30
40
750
15
25000000000000000
15

 

Code Examples

#1 Code Example with C++ Programming

Code - C++ Programming

#include<bits/stdc++.h>
using namespace std;


#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int t;
  cin>>t;
  ll n;
  while(t--){
    cin>>n;

    cout<<max(6LL, n + 1) / 2 * 5 <<endl;
  }

}
Copy The Code & Try With Live Editor

Input

x
+
cmd
6
12
15
300
1
9999999999999999
3

Output

x
+
cmd
30
40
750
15
25000000000000000
15
Advertisements

Demonstration


Codeforcess Solution 1555-A A. PizzaForces ,C++, Java, Js and Python,1555-A,Codeforcess Solution

Previous
Codeforces solution 1080-B-B. Margarite and the best present codeforces solution
Next
CodeChef solution DETSCORE - Determine the Score CodeChef solution C,C+