Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n, k;
- cin >> n >> k;
- n = 2 * (n - 1);
- int wins = 2e9, losses = 2e9, draws = 2e9;
- for(int x = 0; x <= n; x++) {
- for(int y = 0; y <= n; y++) {
- for(int z = 0; z <= n; z++) {
- if(x + y + z == n and 3 * x + y == k) {
- if(z < losses) {
- wins = x;
- losses = z;
- draws = y;
- }
- }
- }
- }
- }
- cout << wins << " " << draws << " " << losses << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement