Untitled
unknown
c_cpp
4 years ago
333 B
8
Indexable
#include <iostream>
using namespace std;
int main() {
int a, b, first, second, k, counter = 0; cin >> a >> b >> k;
first = max(a, b); second = min(a, b);
while (first >= k) {
first -= k;
counter++;
if (second >= k) {
second -= k;
counter++;
}
else break;
}
cout << counter;
return 0;
}Editor is loading...