-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_PizzaForces.cpp
More file actions
90 lines (85 loc) · 1.51 KB
/
A_PizzaForces.cpp
File metadata and controls
90 lines (85 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(ll n)
{
// ll x = (n / 10) * 25;
// ll x1 = n % 10;
// if (x1 > 0)
// {
// if (x1 <= 6)
// {
// x += 15;
// }
// else if (x1 <= 8)
// {
// x += 20;
// }
// else
// {
// x += 25;
// }
// }
// ll y = (n / 8) * 20;
// ll y1 = n % 8;
// if (y1 > 0)
// {
// if (y1 <= 6)
// y += 15;
// else
// y += 20;
// }
// ll z = (n / 6) * 15;
// ll z1 = n % 6;
// if (z1 > 0)
// {
// z += 15;
// }
// ll ans = min(x, min(y, z));
// cout << ans << endl;
ll res = -1;
ll ans = ceil(1.0 * n * 2.5);
ll x = ans % 15;
res = ans - x;
if (x > 0)
{
res += 15;
}
ll y = ans % 20;
ll y1 = 0;
if (y > 0)
{
y1 = y <= 15 ? 15 : 20;
}
res = min(res, ans - y + y1);
ll z = ans % 20;
ll z1 = 0;
if (z > 0)
{
if (z <= 15)
z1 = 15;
else if (z <= 20)
z1 = 20;
else
z1 = 25;
}
res = min(res, ans - z + z1);
cout << res << endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin >> t;
while (t--)
{
// string str; //for reading empty line
// getline(cin, str);
ll n;
cin >> n;
solve(n);
}
return 0;
}