Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef int64_t ll;
- int main()
- {
- int r1,r2,c1,c2,d1,d2;
- cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
- for(int i=1;i<10;i++)
- {
- for(int j=i+1;j<10;j++)
- {
- for(int k=i+2;k<10;k++)
- {
- for(int l=i+3;l<10;l++)
- {
- if(i+j==c1 and i+k==r1 and i+l==d1 and j+l==r2 and j+k==d2 and k+l==c2)
- {
- cout << i << " " << k << endl;
- cout << j << " " << l;
- return 0;
- }
- }
- }
- }
- }
- cout << -1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement