Search is not available for this dataset
name
stringlengths
2
88
description
stringlengths
31
8.62k
public_tests
dict
private_tests
dict
solution_type
stringclasses
2 values
programming_language
stringclasses
5 values
solution
stringlengths
1
983k
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int c1, c2, r1, r2, d1, d2, i, j, k, l; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; i = (r1 - d2 + c1) / 2; j = (c2 - r2 + d2) / 2; k = (r2 - c2 + d2) / 2; l = (c2 - r1 + d1) / 2; if ((i >= 1 && i <= 9) && (j >= 1 && j <= 9) && (k >= 1 && k <= 9)...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split()) c1, c2 = map(int, input().split()) d1, d2 = map(int, input().split()) hallado = True for x3 in range(1,10): for x4 in range(1,10): if (r1 == d1 - x4 + d2 -x3) and (c1== d1 - x4 + x3) and (c2 == d2 - x3 + x4) and (x3 != x4) and (d1 - x4 != d2 - x3) and (d1 - x4 != x3) and ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
### Codeforces Problem 143 A r1, r2 = map(int, raw_input().split(' ')) c1, c2 = map(int, raw_input().split(' ')) d1, d2 = map(int, raw_input().split(' ')) solution = -1 for i in range(1,10): # Set value of a a = i # Derive the other three b = r1-a c = c1-a d = d1-a # Check whether they are...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2, i; cin >> r1 >> r2; cin >> c1 >> c2; cin >> d1 >> d2; int x1, x2, y1, y2, y3, y4; bool flag = false; for (i = 1; i <= 9; i++) { y1 = i, y2 = r1 - i, y3 = c1 - y1, y4 = c2 - y2, x1 = y1 + y4, x2 = y2 + y3; if (y1...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; char sl = '\n'; int main() { pair<int, int> r, c, d; cin >> r.first >> r.second; cin >> c.first >> c.second; cin >> d.first >> d.second; int tmp = (r.first + c.first) - d.second; if (tmp & 1) cout << -1 << sl; else { int a = tmp >> 1; int c1 = r.fi...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.mode self.write = self.buffer.write if self...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1 ,r2 = map(int,input().split()) c1,c2 = map(int,input().split()) d1 , d2 = map(int,input().split()) for a1 in range(1 , 10): for a2 in range(1,10): for a3 in range(1,10): for a4 in range(1 ,10): if a1 == a2 or a1 == a3 or a1 == a4 or a2 == a3 or a2 == a4 or a3 == 4: pass elif a1 + a2 == r1 and a3 +...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r1, r2 = map(int, raw_input().split()) c1, c2 = map(int, raw_input().split()) d1, d2 = map(int, raw_input().split()) x = (c1-r2+d1) // 2 y = (c2-r2+d2) // 2 z = (c1-r1+d2) // 2 m = (r1+r2+c1+c2+d1+d2) // 3 - (x+y+z) if len(set([x, y, z, m])) != 4: print -1 else: print "%d %d" % (x, y) print "%d %d" % (z, ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class CodeForces { public static void main(String[] args) throws IOException { Reader input = new Reader(); int r1=input.nextInt(); int r2=input.nextInt(); ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split()) c1, c2 = map(int, input().split()) d1, d2 = map(int, input().split()) hallado = True for x3 in range(1,10): for x4 in range(1,10): if (r1 == d1 - x4 + d2 -x3) and (c1== d1 - x4 + x3) and (c2 == d2 - x3 + x4) and (x3 != x4): print(d1-x4, d2-x3) print...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1,r2 = map(int,input().split()) c1,c2 = map(int,input().split()) d1,d2= map(int,input().split()) l = [r1,r2,c1,c2,d1,d2] if set(l) == {10} or (r1+r2 !=c1+c2 and c1+c2!=d1+d2): print(-1) else: a = (r1-c2+d1)//2 b = r1-a c = c1-a d= d1-a if (a >0 and a<=9) and (b >0 and b<=9) and (c >0 and c<=9)...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split(" ")) c1, c2 = map(int, input().split(" ")) d1, d2 = map(int, input().split(" ")) row1_list = list() row2_list = list() unlock_gems_of_r1 = list() unlock_gems_of_r2 = list() for gem_no1 in range(1, 10): for gem_no2 in range(1, 10): if (gem_no1 + gem_no2) == r1: r...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.*; public class JavaApplication16 { static Scanner input = new Scanner(System.in); public static void main(String[] args) { int arr[][] = new int[2][2]; int r1=input.nextInt(); arr[0][0]=1; arr[0][1]=r1-1; r1=input.nextInt(); ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split()) c1, c2 = map(int, input().split()) d1, d2 = map(int, input().split()) a = (d1 + c1 - r2) // 2 b = (d2 + c2 - r2) // 2 c = (c1 + d2 - r1) // 2 d = (c2 + r2 - d2) // 2 e = [a, b, c, d] if e.count(a) + e.count(b) + e.count(c) + e.count(d) == 4 and a != b and b != c and c != d and a != d ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
from sys import stdin, stdout INF=1e11 # import math def get_int(): return int(stdin.readline().strip()) def get_ints(): return map(int,stdin.readline().strip().split()) def get_array(): return list(map(int,stdin.readline().strip().split())) def get_string(): return stdin.readline().strip() def op(c): return stdout.wr...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split()) c1, c2 = map(int, input().split()) d1, d2 = map(int, input().split()) m = min(r1, r2, c1, c2, d1, d2) i = 1 while 1: if m == c1: x1 = m - i x2 = c1 - x1 y1 = r1 - x1 y2 = c2 - y1 elif m == c2: y1 = m - i y2 = c2 - y1 x1 =...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> const long long mod = (long long)1e9 + 7; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long e, f, g, h, i, j; cin >> e >> f >> g >> h >> i >> j; bool valid = false; for (long long a = 0; a <= 9; a++) { for (long long b = 0; b <= 9; b++)...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include<stdio.h> void main() { int d[3],r[3],c[3],a,b,p,q; for(int i=1;i<3;i++) scanf("%d",&r[i]); for(int i=1;i<3;i++) scanf("%d",&c[i]); for(int i=1;i<3;i++) scanf("%d",&d[i]); int l=c[2]-d[1]; a=(r[1]-l)/2; b=(r[1]+l)/2; p=(2*r[2]+r[1]-c[2]-d[1])/2; q=(c[2]+d[1]-r[1])/2; if((a>0 && b>0 && p>0 && q>0...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
numbers = list(range(1, 21)) r1, r2 = list(map(int, input().split())) c1, c2 = list(map(int, input().split())) d1, d2 = list(map(int, input().split())) rec = [] for w in numbers: for y in numbers: for x in numbers: for z in numbers: if w != y != x !=z: if w + ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
//package com.example.programming; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Scanner; public class CodeforcesProblems { public static...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1,r2=[int(x) for x in input().split()] c1,c2=[int(x) for x in input().split()] d1,d2=[int(x) for x in input().split()] a1=(r1+c1-d2)//2 a2=abs(r1-a1) a3=abs(c1-a1) a4=abs(r2-a3) if r1!=r2 and c1!=c2 and d1!=d2 and a1>0 and a2>0 and a3>0 and a4>0 and a1!=a2 and a1!=a3 and a1!=a4 and a2!=a3 and a2!=a4 and a3!=a4 and a1<...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { long long int r1, r2, c1, c2, d1, d2, a, b, c, d; cin >> r1 >> r2; cin >> c1 >> c2; cin >> d1 >> d2; if (r1 > 17 || r1 < 3 || r2 > 17 || r2 < 3 || c1 > 17 || c1 < 3 || c2 > 17 || c2 < 3 || d1 > 17 || d1 < 3 || d2 > 17 || d2 < 3 || (r1 + d1...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int r1, r2, c1, c2, d1, d2; int main() { cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; for (int i = 1; i < 10; i++) { int q1 = r2 - i; int q2 = c1 - q1; int q3 = c2 - i; if (q1 > 0 && q1 < 10 && q2 > 0 && q2 < 10 && q3 > 0 && q3 < 10 && i != q1 && i !...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2; scanf("%d%d%d%d%d%d", &r1, &r2, &c1, &c2, &d1, &d2); for (int i = 1; i <= 9; i++) { for (int j = 1; j <= 9; j++) { if (i == j) continue; for (int k = 1; k <= 9; k++) { if (j == k || i == k) continue; ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; long long tt, a1, a2 = 1000000000000, a3, a4, a5, a6, a7, a8, a9, ez1, ans, n, m, k, sum; int ul, ur, dl, dr; string s, s1, s2, s3; int flag[30]; bool omm(const pair<int, int> &a, const pair<int, int> &b) { return (a.second < b.second); } void input() { ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r=list(map(int,raw_input().split())) r1 = r[0] r2 = r[1] c=list(map(int,raw_input().split())) c1 = c[0] c2 = c[1] d=list(map(int,raw_input().split())) d1 = d[0] d2 = d[1] flag = 0 for i in range (1,10): for j in range (1,10): for k in range (1,10): if (i+j==r1 and i+k==c1 and j+k==d2 and (i+(r2-k)==d1) and i!=j...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
import itertools import bisect import math from collections import * import os import sys from io import BytesIO, IOBase ii = lambda: int(input()) lmii = lambda: list(map(int, input().split())) slmii = lambda: sorted(map(int, input().split())) li = lambda: list(input()) mii = lambda: map(int, input().split()) msi = la...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2, x1, x2, x3, x4; while (scanf("%d%d%d%d%d%d", &r1, &r2, &c1, &c2, &d1, &d2) != EOF) { int flag = 0; if ((r1 + r2) != (c1 + c2) || (r1 + r2) != (d1 + d2) || (c1 + c2) != (d1 + d2)) { printf("-1\n"); cont...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
import math def invalid(a, b, x): if (a+b==x): return 0 else: return 1 r1 , r2 = input().split() r1 = int(r1) r2 = int(r2) c1, c2 = input().split() c1 = int(c1) c2 = int(c2) e1, e2 = input().split() e1 = int(e1) e2 = int(e2) x = 9 flag = 1 while(x): x -= 1 a1, a2, a3, a4 = 0, 0, ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int r1 = in.nextInt(); int r2 = in.nextInt(); int c1 = in.nextInt(); int c2 = in.nextInt(); int d1 = in.nextInt(); int d2 = in.nextInt(); int a = 0; int b = 0; int c = 0; int d = 0; ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class R102A { /** * @param args */ public static void main(String[] args) { int[] sums = readInts(); int i,j = 0,k = 0,l = 0; boolean hasSol = false; for(i = 1; i <= 9;...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int x, y, z, h, c1, c2, r1, r2, d1, d2; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; y = (r1 - c1 + d2) / 2; x = r1 - y; z = c1 - x; h = r2 - z; if (x == y || x == z || x == h || y == z || y == h || z == h || x < 0 || y < 0 || z < 0 || h < 0) ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import static java.lang.System.exit; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Scanner; import java.util.*; /** * * @author abdelmagied */ import java.util.ArrayList; import java.util.Collections; import ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2, a, b, c, d; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; a = d1 - 1; d = 1; while (a > 0) { b = r1 - a; c = c1 - a; if ((r1 == a + b) && (r2 == c + d) && (c1 == a + c) && (c2 == b + d) && (d2 == b + c) && (a...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.Scanner; public class HelpA { public static void main(String[] ar) { Scanner in = new Scanner(System.in); int r1 = in.nextInt(); int r2 = in.nextInt(); in.nextLine(); int c1 = in.nextInt(); int c2 = in.nextInt(); in.nextLine(); int ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; int c = (c1 - d1 + r2) / 2; int d = r2 - c; int a = (c1 + d1 - r2) / 2; int b = r1 - a; if (a <= 0 || b <= 0 || c <= 0 || d <= 0 || a == b || b == c || c == d || a == d || ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> int main(void) { int r1, r2, c1, c2, d1, d2, i, j, k, l; int x = 9; scanf("%d%d%d%d%d%d", &r1, &r2, &c1, &c2, &d1, &d2); for (i = 1; i <= 9; i++) { j = r1 - i; k = c1 - i; l = d1 - i; if (j <= 9 && k <= 9 && l <= 9) { if ((k + j) == d2 && (k + l) == r2) { i...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1,r2=map(int,input().split()) c1,c2=map(int,input().split()) d1,d2=map(int,input().split()) x,y=(r1+c1-d2)//2,(r1-c1+d2)//2 p,q=(c1-r1+d2)//2,(2*c2+c1-r1-d2)//2 if p<=0 or q<=0 or x<=0 or y<=0: print("-1") elif x==y or p==q or x==p or x==q or y==q or y==p: print("-1") elif x>9 or y>9 or p>9 or q>9: print("...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; im...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.*; public class A { BufferedReader in; PrintStream out; StringTokenizer tok; public A() throws NumberFormatException, IOException { in = new Buffer...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { long r1, r2, c1, c2, d1, d2, t = 0; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; for (int i = 1; i <= r1; i++) { for (int j = 1; j <= r2; j++) { for (int k = 1; k <= c1; k++) { for (int l = 1; l <= c2; l++) { if ((i != j and i != k...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
a = input() keys = [] rings = [] for i in a: if a in keys: for x in range(len(keys)-1): if keys[x] == a: rings[x] += 1 break else: keys.append(i) n = 0 for i in range(len(rings)-1): if rings[i] % 2 == 1: n += 1 if n < 2 or n % 2 == 1: ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.*; public class Div2A143 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int r1 = sc.nextInt(); int r2 = sc.nextInt(); sc.nextLine(); int c1 = sc.nextInt(); int c2 = sc.nextInt(); sc.nextLine(); int d1 =...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
def solve(): ro = map(int, str(raw_input()).split()) co = map(int, str(raw_input()).split()) di = map(int, str(raw_input()).split()) if (sum(ro)!= sum(co)) or (sum(co) != sum(di)) or (sum(di) != sum(ro)): print '-1' return a = [] b = [] c = [] d = [] first = co[0] +di...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r1, r2 = map(int, raw_input().split()) c1, c2 = map(int, raw_input().split()) d1, d2 = map(int, raw_input().split()) x2 = (r1-c1+d2)/2 x1 = r1 - x2 x3 = d2 - x2 x4 = c2 - x2 xs = (x1,x2,x3,x4) if len(set(xs)) == 4 and max(xs)<10 and min(xs)>0: print x1, x2 print x3, x4 else: print -1
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r1, r2 = map(int, raw_input().split()) c1, c2 = map(int, raw_input().split()) d1, d2 = map(int, raw_input().split()) res = "-1" for x in xrange(0, 10): for y in xrange(0, 10): for z in xrange(0, 10): for t in xrange(0, 10): if not ((x == y) or (x == z) or ( x== t)): if not ((y == z) or (y == t) or ( z ==...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1,r2=map(int,input().split()) c1,c2=map(int,input().split()) d1,d2=map(int,input().split()) import sys if (r1+d1-c2)%2==1: print(-1) sys.exit() else : a=(r1+d1-c2)//2 b=r1-a d=d1-a c=r2-d l1=[a,b,c,d] if a<=0 or b<=0 or c<=0 or d<=0 or a>9 or b>9 or c>9 or d>9: print(-1) ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2; while (cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2) { int x, y, z, a; for (x = 1; x != 10; x++) { cout << x << "x" << endl; y = r1 - x; z = c1 - x; a = r2 - z; if (y >= 1 && y <= 9 && z >= 1 && z...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c2, c1, d1, d2; int a[2][2]; cin >> r1 >> r2 >> c2 >> c1 >> d1 >> d2; for (int i = 1; i < r1; i++) { a[0][0] = i; a[0][1] = r1 - i; for (int j = 1; j < r2; j++) { a[1][0] = j; a[1][1] = r2 - j; if (a[0][0] + a[1...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int c1, c2, r1, r2, d1, d2, x[5], i, j; cin >> r1 >> r2; cin >> c1 >> c2; cin >> d1 >> d2; x[3] = ((r1 - d1) + c2) / 2; x[2] = d2 - x[3]; x[4] = c2 - x[3]; x[1] = d1 - x[4]; if (x[1] + x[2] == c1 && x[3] + x[4] == c2 && x[1] + x[3] == r1 && ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; /** * * @author Ahmed */ public class Test { /** * @param args the command line arguments * @throws java.io...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.util.Arrays; import java.util.HashSet; import java.util.InputMismatchException; import java.util.Iterator; public class Main { public static void main(String[] args) t...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.*; import java.util.*; public class third { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan=new Scanner(System.in); int r1=scan.nextInt(); int r2=scan.nextInt(); int c1=scan.nextInt(); int c2=scan.nextInt(); int d1=scan.nextInt(); int d2=scan.ne...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2, s1, s2, s3, s4; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; s2 = (r1 + d2 - c1) / 2; s1 = r1 - s2; s3 = d2 - s2; s4 = d1 - s1; if (s1 == -1 || s2 == -1 || s3 == -1 || s4 == -1 || (s4 == s1 && s1 == s3 && s1 == s2)) {...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
def solve(r1,r2,c1,c2,d1,d2): cel1 = 0 cel2 = 0 cel3 = 0 cel4 = 0 res = (d1+r1-c2) if res <1 or res%2 !=0 or res//2 > 9 : print(-1) return cel1 = res //2 if r1-cel1 >9 or r1-cel1 < 1 or cel1 == r1-cel1: print(-1) return cel2 = r1-cel1 if d2 - cel2 >9 or d2-cel2 <1 or cel2 == d2-cel2:...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int r1, r2, c1, c2, d1, d2; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; int min3 = min(r1, c1); min3 = min(min3, d1); for (int i = 1; i < min3; i++) { int b1, b2, b3, b4; b1 = i; b2 = r1 - i; b3 = c1 - i; b...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; import java.util.StringTokenizer; public class CP { static class FastReader{ BufferedReader br; StringTokenizer st; pub...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.*; import java.util.*; public class TestGenerator { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); r1 = sc.nextInt(); r2 = sc.nextInt(); c1 = sc.nextInt(); ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { set<int> s; int r1, r2, c1, c2, d1, d2, a1, a2, a3, a4; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; for (int i = 1; i <= 20; i++) { for (int j = 1; j <= 20; j++) { a1 = i; a2 = j; if (a1 + a2 == r1) { a3 = c1 - a1; a4 ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1 ,r2 = map(int,input().split()) c1,c2 = map(int,input().split()) d1 , d2 = map(int,input().split()) for a1 in range(1 , 10): for a2 in range(1,10): for a3 in range(1,10): for a4 in range(1 ,10): if a1 + a2 == r1 and a3 + a4 == r2 and a1 + a4 == d1 and a1 + a3 == c1 and a2 + a4 == c2 and a2 + a3 == d2: ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
import random r1 , r2 = map(int, input().split()) c1 , c2 = map(int, input().split()) d1 , d2 = map(int, input().split()) n1 = random.randint(1,9) n2 = random.randint(1,9) n3 = random.randint(1,9) n4 = random.randint(1,9) count = 0 if ((r1 == c1) & (r2 == c2)): print(-1) else: while (count <= 9**4): if ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; int flag = 0; int a, b, c, d; for (int i = 1; i <= 9; i++) { for (int j = 1; j <= 9; j++) { for (int k = 1; k <= 9; k++) { for (int l = 1; l <= 9; l++) { ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.*; import java.util.*; public class ProblemA { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int r1 = in.nextInt(); int r2 = in.nextInt(); int c1 = in.nextInt(); int c2 = in.ne...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.Scanner; public class Prob74 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int r1 = s.nextInt(); int r2 = s.nextInt(); int c1 = s.nextInt(); int c2 = s.nextInt(); int d1 = s.nextInt(); int d2 = s.nextInt(); s.close(); int x11; int x12; int x21; ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.*; import java.util.*; public class JavaApplication14 { public static void main(String[] args) { FastReader sc = new FastReader(); int r1 = sc.nextInt(), r2 = sc.nextInt(); int c1 = sc.nextInt(), c2 = sc.nextInt(); int d1 = sc.nextInt(), d2 = sc.nextInt(); ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.*; import java.util.Arrays; import java.util.Scanner; import java.lang.*; import java.lang.reflect.Array; import java.nio.charset.Charset; public class test { public static void main(String[] args) throws Exception { int r1 = nextInt(); int r2 = nextInt(); int c1 = nextInt(); int c2 = nex...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; int locks[4] = {0, 0, 0, 0}; int r1sum = locks[0] + locks[1]; int r2sum = locks[2] + locks[3]; int c1sum = locks[0] + locks[2]; int c2sum = locks[1] + locks[3]; int d1sum = loc...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
#################################################### # -*- coding: utf-8 -*- import sys w = sys.stdout.write read = sys.stdin.readline reads = sys.stdin.read def r(f=None): if f: return map(f, read().split()) else: return read().split() def rs(t,f=None): result = [] result_append = re...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split()) c1, c2 = map(int, input().split()) d1, d2 = map(int, input().split()) gems = [i for i in range(1, 10)] required_sum = r1 + r2 + c1 + c2 + d1 + d2 if required_sum % 3 == 0: sum_to = required_sum / 3 for i in range(1, 10): a = r1 - i b = c1 - i c = r2 -...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class HelpVasilia { public static void main(String[] args) throws IOException { BufferedReader bf=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new Str...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class HelpVasilia { public static void main(String[] args) throws IOException { BufferedReader bf=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new Str...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int c1, c2, r1, r2, d1, d2, i, j, k, l; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; i = (r1 - d2 + c1) / 2; j = (c2 - r2 + d2) / 2; k = (r2 - c2 + d2) / 2; l = (c2 - r1 + d1) / 2; if ((i >= 1 && i <= 9) && (j >= 1 && j <= 9) && (k >= 1 && k <= 9)...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1,r2 = input().split(" ") c1,c2 = input().split(" ") d1,d2 = input().split(" ") r1,r2,c1,c2,d1,d2 = int(r1),int(r2),int(c1),int(c2),int(d1),int(d2) ar1 = [] z = True m = max(c1,c2) if(r1+r2 == c1+c2 == d1+d2): for n in range((r1-1)//2): ar1.append([r1-1-n,1+n]) for n in ar1: if n[0] < 10 and n[...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
k=[] for i in range(3): k.append(list(map(int,input().split()))) r1,r2,c1,c2,d1,d2=k[0][0],k[0][1],k[1][0],k[1][1],k[2][0],k[2][1] x1=(r1-d2+c1)//2 x2=r1-x1 x3=(d2-r1+c1)//2 x4=d1-x1 if x1<0 or x2<0 or x3<0 or x4<0 or x1==x2 or x3==x4 or x1>9 or x2>9 or x3>9 or x4>9 or x1==x3 or x1==x4 or x2==x3 or x2==x4:print(-1)...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Deque; import java.util.Scanner; public class Sheet_A { public static boolean goodNumber(String num, int k) { for (char i = '0'; i <= '0' + k; i++) if(num.indexOf(i) == -1) return false; return true; ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
# python 3 """ """ from operator import itemgetter def help_vasilisa_the_wise_2(r_1_int, r_2_int, c_1_int, c_2_int, d_1_int, d_2_int) -> None: solution = True quotient, remainder = divmod(r_1 + c_1 - d_2, 2) if remainder == 0: x_1 = quotient else: solution = False quotient, remain...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int c1, c2, r1, r2, d1, d2, x[5], i, j; cin >> r1 >> r2; cin >> c1 >> c2; cin >> d1 >> d2; x[3] = ((r1 - d1) + c2) / 2; x[2] = d2 - x[3]; x[4] = c2 - x[3]; x[1] = d1 - x[4]; if (x[1] + x[2] == c1 && x[3] + x[4] == c2 && x[1] + x[3] == r1 && ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
""" a b c d a+b=r1 c+d=r2 a+c=c1 b+d=c2 a+d=d1 b+c=d2 a2+c+b= r1+c1 2a+d2=r1+c1 a=(r1+c1-d2)//2 b=r1-a c=d2-b d=r2-c """ r1, r2 = map(int, input().strip().split()) c1, c2 = map(int, input().strip().split()) d1, d2 = map(int, input().strip().split()) a=(r1+c1-d2)//2 b=r1-a c=d2-b d=r2-c if len(set([a, b, c, d]))...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int r1, r2, c1, c2, d1, d2; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; int x1, x2, x3, x4; for (int i = 1; i <= 9; i++) { x1 = i; x2 = r1 - x1; x3 = d2 - x2; x4 = d1 - x1; if (x1 + x2 == r1 && x1 + x3 == c1 && x3 + x4 == r2 && x2 + x4 ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.*; public class Div2A143 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); float r1 = sc.nextFloat(); float r2 = sc.nextFloat(); sc.nextLine(); float c1 = sc.nextFloat(); float c2 = sc.nextFloat(); sc.nextLine(); ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
# HELP VASILISA THE WISE 2 # Estacio Pereira, estacio.neto@ccc.ufcg.edu.br # UFCG # INPUT r = raw_input().split() r1, r2 = int(r[0]), int(r[1]) c = raw_input().split() c1, c2 = int(c[0]), int(c[1]) d = raw_input().split() d1, d2 = int(d[0]), int(d[1]) # PROCESS x1 = r1 - 1 x2 = r2 - 1 y1 = 1 y2 = 1 igual1 = False if...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r=list(map(int,raw_input().split())) r1 = r[0] r2 = r[1] c=list(map(int,raw_input().split())) c1 = c[0] c2 = c[1] d=list(map(int,raw_input().split())) d1 = d[0] d2 = d[1] flag = 0 for i in range (1,10): for j in range (1,10): for k in range (1,10): for l in range (1,10): if (i+j==r1 and i+k==c1 and j+k==d2 a...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int r1, r2, c1, c2, d1, d2; int A11, A12, A21, A22; set<int> Set; bool Fn() { int num = r1 + d1 - c2; if (num % 2 != 0 || (num / 2) < 1 || (num / 2) > 9) return false; A11 = num / 2; Set.insert(A11); A12 = r1 - A11; if (A12 < 1 || A12 > 9) return false; Set.in...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split()) c1, c2 = map(int, input().split()) d1, d2 = map(int, input().split()) d = int(((c2 + d1)-r1) / 2) c = int(r2 - d) a = int(d1 - d) b = int(c2 - d) if a == b or a == c or a == d or b == c or b == d or c == d or a < 1 or b < 1 or c < 1 or d < 1 or a > 9 or b > 9 or c > 9 or d > 9: pr...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.*; public class A { public static void main (String[] args) { Scanner sc=new Scanner(System.in); int a[][]=new int[2][2]; int flag=0,i=0,j=0,k=0,r[]=new int[2],c[]=new int[2],d[]=new int[2]; for(i=0;i<2;i++) r[i]=sc.nextInt(); sc.nextLine(); for(i=0;i<2;i++) c[i]=sc.nextInt(); sc.nextLin...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r1, r2 = map(int, raw_input().strip().split()) c1, c2 = map(int, raw_input().strip().split()) d1, d2 = map(int, raw_input().strip().split()) ij = [] hf = [] for i in range(1,10): for j in range(1,10): for h in range(1,10): for f in range(1,10): if i!=j and j!=h and h!=f and f!=i ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
m=input() n=input() o=input() r1,r2=m.split(" ") c1,c2=n.split(" ") d1,d2=o.split(" ") x=(int(r1)+int(d1)-int(c2))/2 w=(int(r2)+int(d2)-int(c2))/2 y=(int(r1)+int(d2)-int(c1))/2 z=(int(r2)+int(d1)-int(c1))/2 if x==y or y==z or z==w or w==x or y==w or x==z: print(-1) else: print(str(x)+" "+str(y)) print(st...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.*; public class cf143a { public static void main(String[] args) { Scanner in = new Scanner(System.in); int r1 = in.nextInt(); int r2 = in.nextInt(); int c1 = in.nextInt(); int c2 = in.nextInt(); int d1 = in.nextInt(); int d2 = in.nextInt(); for(int a=1; a<10; a++) for(int b=1; b<10...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r1, r2 = map(int, raw_input().strip().split()) c1, c2 = map(int, raw_input().strip().split()) d1, d2 = map(int, raw_input().strip().split()) for a in xrange(1, 20): for b in xrange(1, 20): for c in xrange(1, 20): for d in xrange(1, 20): if a + b == r1 and c + d == r2 and a + d =...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
#!/usr/bin/python # -*- coding: utf-8 -*- ################################## # Codeforces Round #102 (Div.2) # ################################## from sys import stdin, stdout, stderr def unlock(r1, r2, c1, c2, d1, d2): """ INPUT:: Four integers 1<= r1, r2, c1, c2, d1, d2 <= 20 OUTPUT:: If there is answer "un...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
java
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int r1 = s.nextInt(); int r2 = s.nextInt(); int c1 = s.nextInt(); int c2 = s.nextInt(); int d1 = s.nextInt(); int d2 = s.nextInt(); int y =...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
import sys a=sys.stdin.readline().split() r1=int(a[0]) r2=int(a[1]) b=sys.stdin.readline().split() c1=int(b[0]) c2=int(b[1]) c=sys.stdin.readline().split() d1=int(c[0]) d2=int(c[1]) if(c1+c2!=r1+r2): print -1 else: if(d1+d2!=r1+r2): print -1 else: f=(d1-r1+c2)/2 s=c2-f t=r2...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
import sys def main(): (r1, r2) = map(int, sys.stdin.readline().split(' ')) (c1, c2) = map(int, sys.stdin.readline().split(' ')) (d1, d2) = map(int, sys.stdin.readline().split(' ')) for i in range(1, 10): for j in range(1, 10): for k in range(1, 10): for l in range(1...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
r1, r2 = map(int, input().split()) c1, c2 = map(int, input().split()) d1, d2 = map(int, input().split()) i = (d1 - c2 + r1) / 2 j = r1 - i k = c1 - i w = d1 - i if len(set([i,j,k,w])) + sum([1<=i<=9,1<=j<=9,1<=k<=9,1<=w<=9]) == 8: print(int(i),int(j)) print(int(k),int(w)) exit() print("-1")
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python2
r1, r2 = map(int, raw_input().split()) c1, c2 = map(int, raw_input().split()) d1, d2 = map(int, raw_input().split()) t = False for i in range(1, 10): for j in range(1, 10): for c in range(1, 10): for d in range(1, 10): if i + j == r1 and i + c == c1 and j+c == d2 and i+d == d1: ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int num[10], cells[10]; bool used[10]; bool bt(int idx) { if (idx == 4) { if (num[0] == cells[0] + cells[1] && num[1] == cells[2] + cells[3] && num[2] == cells[0] + cells[2] && num[3] == cells[1] + cells[3] && num[4] == cells[0] + cells[3] && num[5] ==...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int cases, ct = 0; int main() { int r1, r2, c1, c2, d1, d2, fl = 0, x, y, zz, z; while (cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2) { fl = 0; int i, j, k, l; for (i = 1; i <= 9; i++) { for (j = 1; j <= 9; j++) { for (k = 1; k <= 9; k++) { ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
""" a b c d a+b=r1 c+d=r2 a+c=c1 b+d=c2 a+d=d1 b+c=d2 a2+c+b= r1+c1 2a+d2=r1+c1 a=(r1+c1-d2)//2 b=r1-a c=d2-b d=r2-c """ r1, r2 = map(int, input().strip().split()) c1, c2 = map(int, input().strip().split()) d1, d2 = map(int, input().strip().split()) a=(r1+c1-d2)//2 b=r1-a c=d2-b d=r2-c if len(set([a, b, c, d]))...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
cpp
#include <bits/stdc++.h> using namespace std; int main() { int flog = 0; int r1, r2, c1, c2, d1, d2, a, b, c, d, e, f, g, h; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; for (a = 1; a < 10; a++) for (b = 1; b < 10; b++) for (c = 1; c < 10; c++) for (d = 1; d < 10; d++) { if (a + b == r1 ...
143_A. Help Vasilisa the Wise 2
Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with tha...
{ "input": [ "1 2\n3 4\n5 6\n", "11 10\n13 8\n5 16\n", "3 7\n4 6\n5 5\n", "10 10\n10 10\n10 10\n" ], "output": [ "-1\n", "4 7\n9 1\n", "1 2\n3 4\n", "-1\n" ] }
{ "input": [ "3 14\n8 9\n10 7\n", "12 11\n11 12\n16 7\n", "12 17\n10 19\n13 16\n", "9 12\n3 17\n10 10\n", "10 7\n4 13\n11 6\n", "7 9\n4 12\n5 11\n", "2 4\n1 5\n3 3\n", "13 8\n15 6\n11 10\n", "8 10\n9 9\n13 5\n", "12 7\n5 14\n8 11\n", "9 6\n5 10\n3 12\n", "16 5\n13 8\n10...
IN-CORRECT
python3
z=0 r1,r2=map(int,input().split()) c1,c2=map(int,input().split()) d1,d2=map(int,input().split()) for x in range(1,r1+1): x2=r1-x x3=c1-x if x3<r2: x4=r2-x3 if x3+x2==d2 and x+x4==d1 and x!=x2 and x3!=x4: print('%d %d'%(x,x2)) print('%d %d'%(x3,x4)) z+=1 ...