You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
324 B
15 lines
324 B
2 years ago
|
#include <bits/stdc++.h>
|
||
|
|
||
|
using namespace std;
|
||
|
int s, c, r;
|
||
|
int main() {
|
||
|
cin >> s >> c >> r;
|
||
|
for (int b = r + 1;; b++) {
|
||
|
int a = s - b - c - r;
|
||
|
if (a / b == c && a % b == r && a + b + c + r == s) {
|
||
|
printf("%d %d", a, b);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|