Advertisement
Guest User

Untitled

a guest
Jul 24th, 2021
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef int64_t ll;
  4. int main()
  5. {
  6. int r1,r2,c1,c2,d1,d2;
  7. cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  8. for(int i=1;i<10;i++)
  9. {
  10. for(int j=i+1;j<10;j++)
  11. {
  12. for(int k=i+2;k<10;k++)
  13. {
  14. for(int l=i+3;l<10;l++)
  15. {
  16. if(i+j==c1 and i+k==r1 and i+l==d1 and j+l==r2 and j+k==d2 and k+l==c2)
  17. {
  18. cout << i << " " << k << endl;
  19. cout << j << " " << l;
  20. return 0;
  21. }
  22. }
  23. }
  24. }
  25. }
  26. cout << -1;
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement