cf1555A. PizzaForces
A. PizzaForces
题意:
有三种披萨,第一种有六块,需要花费15分钟,第二种有8块,需要花费20分钟,第三问有10块,需要花费25分钟。
现在要吃x块披萨,问最少时间花费?
题解:
不拿看出其实对于每一块所花单位时间是一样的,都是2.5,而基本单位是6,8,10,你会发现对于大于6的任意偶数他们都能组成,也就是对于10的任意偶数其实就是10*2.5,如果x是大于10的任意奇数,那就要多点一些凑成偶数。对于小于6的就要买一个6份套餐
代码:
// Problem: A. PizzaForces
// Contest: Codeforces - Educational Codeforces Round 112 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1555/problem/A
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// Data:2021-08-16 23:37:08
// By Jozky#include <bits/stdc++.h>
#include <unordered_map>
#define debug(a, b) printf("%s = %d\n", a, b);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
clock_t startTime, endTime;
//Fe~Jozky
const ll INF_ll= 1e18;
const int INF_int= 0x3f3f3f3f;
template <typename T> inline void read(T& x)
{T f= 1;x= 0;char ch= getchar();while (0 == isdigit(ch)) {if (ch == '-')f= -1;ch= getchar();}while (0 != isdigit(ch))x= (x << 1) + (x << 3) + ch - '0', ch= getchar();x*= f;
}
template <typename T> inline void write(T x)
{if (x < 0) {x= ~(x - 1);putchar('-');}if (x > 9)write(x / 10);putchar(x % 10 + '0');
}
void rd_test()
{
#ifdef LOCALstartTime= clock();freopen("in.txt", "r", stdin);
#endif
}
void Time_test()
{
#ifdef LOCALendTime= clock();printf("\nRun Time:%lfs\n", (double)(endTime - startTime) / CLOCKS_PER_SEC);
#endif
}
int main()
{//rd_test();/*6 8 1015 20 25*/int t;read(t);while (t--) {ll n;cin >> n;ll ans= max(6ll, n + 1) / 2 * 5;cout << ans << endl;}return 0;//Time_test();
}