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.

17 lines
444 B

#include <bits/stdc++.h>
using namespace std;
int main() {
for (int a = 0; a <= 30; ++a) {
for (int b = 0; b <= 30; ++b) {
for (int c = 0; c <= 30; ++c) {
if (a + b + c == 30 && a / 2 + b / 3 * 2 + c / 7 * 5 == 20 && a % 2 == 0 && b % 3 == 0 && c % 7 == 0) {
cout << a << " " << b << " " << c << endl;
}
}
}
}
return 0;
}