some programs!!
This commit is contained in:
1 parent
ed054247d5
commit
71f1022dea
38 files changed
+1037
-281
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
long long exchange_requirement, empty_bottles_amount, filled_bottles_amount, ans;
|
||||
|
||||
int main() {
|
||||
ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> exchange_requirement >> filled_bottles_amount;
|
||||
|
||||
while (true) {
|
||||
ans += filled_bottles_amount;
|
||||
empty_bottles_amount += filled_bottles_amount;
|
||||
filled_bottles_amount = empty_bottles_amount / exchange_requirement;
|
||||
empty_bottles_amount %= exchange_requirement;
|
||||
if (filled_bottles_amount == 0) { break; }
|
||||
}
|
||||
cout << ans << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user