about summary refs log tree commit diff
path: root/ntu/gacho.c
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-12-15 15:09:13 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-12-15 15:09:13 +0700
commit9e28e4c7b67c54229df11d355047ac8a88ea1817 (patch)
tree0d9d40db69613c2c49564a3f1987a005d61f4db3 /ntu/gacho.c
parent67393f42f41ab92219deb549f711121c4dab845b (diff)
downloadcp-9e28e4c7b67c54229df11d355047ac8a88ea1817.tar.gz
Normalize pathname
Diffstat (limited to 'ntu/gacho.c')
-rw-r--r--ntu/gacho.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ntu/gacho.c b/ntu/gacho.c
new file mode 100644
index 0000000..6df8548
--- /dev/null
+++ b/ntu/gacho.c
@@ -0,0 +1,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;
+}