about summary refs log tree commit diff
path: root/ntu/gacho.c
blob: 6df85482f111857c03a5af1696a0615e40d83518 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>

int main()
{
	long n, m, g, c;

	scanf("%ld %ld", &n, &m);

	g = n*2 - m/2;
	c = m/2 - n;

	if ((g + c == n) && (g*2 + c*4 == m) && (g >= 0) && (c >= 0))
		printf("%ld %ld\n", g, c);
	else
		puts("-1");

	return 0;
}