Educational Codeforces Round 52 (Rated for Div. 2) A. Vasya and Chocolate
程序员文章站
2022-05-09 17:37:58
...
题解
题目大意 有s元 每个巧克力c元买a送b
AC代码
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
int main()
{
#ifdef LOCAL
freopen("C:/input.txt", "r", stdin);
#endif
int T;
cin >> T;
while (T--)
{
int s, a, b, c;
cin >> s >> a >> b >> c;
ll k = s / c;
cout << k + 1LL * k / a * b << endl;
}
return 0;
}
上一篇: Educational Codeforces Round 52 (Rated for Div. 2) B. Vasya and Isolated Vertices
下一篇: 【Codeforces Round #519 by Botan Investments A】 Elections
推荐阅读
-
Educational Codeforces Round 71 (Rated for Div. 2)E. XOR Guessing
-
Educational Codeforces Round 97 (Rated for Div. 2) D. Minimal Height Tree
-
Educational Codeforces Round 60 (Rated for Div. 2) ----A - Best Subsegment(思维题)
-
Educational Codeforces Round 85 (Rated for Div. 2) C. Circle of Monsters(前缀和 预处理 贪心)
-
Educational Codeforces Round 98 (Rated for Div. 2) A-E 题解
-
Educational Codeforces Round 93 (Rated for Div. 2) A. Bad Triangle
-
Educational Codeforces Round 93 (Rated for Div. 2) B - Substring Removal Game
-
Educational Codeforces Round 99 (Rated for Div. 2) C. Ping-pong
-
第十五次训练:Educational Codeforces Round 72 (Rated for Div. 2) && Codeforces Round #582 (Div. 3)
-
第二次训练:Educational Codeforces Round 77 (Rated for Div. 2)