Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
780 B
2
Indexable
Never
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#define ll long long
#define endl "\n"
#define yes cout << "YES"
#define no cout << "NO"
using namespace std;

void init()
{
	cin.tie(0);
	cout.tie(0);
	cin.sync_with_stdio(0);
}

int main()
{
	init();
	ll r1, r2, c1, c2, d1, d2;
	cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
	for (int i = 1; i <= 9; i++)
	{
		for (int j = 1; j <= 9; j++)
		{
			for (int k = 1; k <= 9; i++)
			{
				for (int l = 1; l <= 9; l++)
				{
					if (i + j == r1 && k + l == r2 && i + k == c1 && j + l == c2 && i + l == d1 && j + k == d2)
					{
						cout << i << " " << j << endl << k << " " << l;
						return 0;
					}
				}

			}
		}
	}
	cout << -1;
	return 0;
}
Leave a Comment