prompt
string
response
string
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
def jewel(lst, n): sum_x, sum_y = 0, 0 for elem in lst: sum_x += elem[0] sum_y += elem[1] return sum_x // n, sum_y // n N = int(input()) a = list() for i in range(2 * N): x, y = [int(j) for j in input().split()] a.append([x, y]) print(*jewel(a, N))
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) R=lambda:([*map(int,input().split())]for _ in[0]*n) a,b=min(R()) x,y=max(R()) print(a+x,b+y)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int main() { int n, X, x, Y, y, p, q; X = Y = INT_MIN; x = y = INT_MAX; cin >> n; for (int i = 0; i < n; ++i) { cin >> p >> q; if (p > X) X = p; if (q > Y) Y = q; } for (int i = 0; i < n; ++i) { cin >> p >> q; if (p < x) x = p; if (q < ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) pos=[] diffs=[] for i in range(n): a,b=map(int,input().split()) pos.append((a,b)) for i in range(n): c,d=map(int,input().split()) diffs.append((c,d)) pos.sort() diffs.sort(reverse=True) print(pos[0][0]+diffs[0][0],pos[0][1]+diffs[0][1])
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.*; import java.util.*; public class B { static Scanner sc = new Scanner(System.in); static int[] x, y, a, b; static int n; public static void main(String[] args) { n = sc.nextInt(); x = new int[n]; y = new int[n]; a = new int[n]; b = new int[n]; for (int i = 0; i < n; i++) { x[i] = sc....
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import sys from itertools import product from collections import Counter N = int(input()) obelisks = [list(map(int, sys.stdin.readline().split())) for _ in [0]*N] dists = [list(map(int, l.split())) for l in sys.stdin] counter = Counter() for (x1, y1), (x2, y2) in product(obelisks, dists): counter[(x1+x2, y1+y2)] ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) a,b=0,0 for i in range(2*n): x,y=map(int,input().split()) a+=x b+=y print(a//n,b//n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; inline long long mod(long long n, long long m) { long long ret = n % m; if (ret < 0) ret += m; return ret; } long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); } long long exp(long long a, long long b, long long m) { if (b == 0) return 1;...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> int a[1005][3]; int b[1005][3]; using namespace std; int main() { int flag = 1; int v = 1; int n, i, j, k; cin >> n; long long sum = 0, num = 0; for (i = 1; i <= n; i++) { cin >> a[i][1] >> a[i][2]; sum += a[i][1]; num += a[i][2]; } for (i = 1; i <= n; i++) { cin...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) xlist=[] ylist=[] for i in range(n): x,y=map(int,input().split()) xlist.append(x) ylist.append(y) alist=[] blist=[] for i in range(n): a,b=map(int,input().split()) alist.append(a) blist.append(b) xsum=sum(xlist) ysum=sum(ylist) asum=sum(alist) bsum=sum(blist) s1=(xsum+asum)//n s2=(ysum+bsum)//n...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int t = n; int t1 = n; long long int x = 0, y = 0; while (n--) { int a, b; cin >> a >> b; x += a; y += b; } while (t--) { int a, b; cin >> a >> b; x += a; y += b; } cout << x / t1 << " " << y ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import copy n = int(input()) ab = [] hell = [] x = 0 y = 0 for i in range(n): ab.append(list(map(int, input().split()))) x += ab[i][0] y += ab[i][1] for i in range(n): hell.append(list(map(int, input().split()))) x += hell[i][0] y += hell[i][1] print(int(x/n), int(y/n))
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); long long n, m = 0, mn = 100000000007, d = 0, mx = 0, h = 0, l = 0, w = 0, r = 0, k = 0, j = 0, i = 0, ans; cin >> n; vector<pair<int, int>> a(n), b(n); bool z[n]; for (auto &x : a) cin >> x.firs...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
def main(): n = int(input()) points = [] for i in range(n): points.append([int(x) for x in input().split(' ')]) vectors = [] for i in range(n): vectors.append([int(x) for x in input().split(' ')]) points = sorted(points,key=lambda x:x[0]) pnts = [points[0]] for i in...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
MOD = 10**9 + 7 I = lambda:list(map(int,input().split())) n, = I() c = [] l = [] for i in range(n): c.append(I()) s = set() d = {} m = 0 ans = 0 for i in range(n): l.append(I()) for j in c: x = j[0] y = j[1] a = ((l[i][0] + x , l[i][1] + y)) if a in d: d[a] += 1...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) sa,sb=0,0 for i in range(2*n): a,b=map(int,input().split()) sa+=a sb+=b print(sa//n,sb//n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; long long power(long long a, long long b, long long m = 1000000007) { long long ans = 1; a = a % m; while (b > 0) { if (b & 1) ans = (1ll * a * ans) % m; b >>= 1; a = (1ll * a * a) % m; } return ans; } long long gcd(long long a, long long b) { return b...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; const int N = 1005; map<int, multiset<int>> mp; vector<pair<int, int>> vec, evec; bool check(int tx, int ty) { map<int, multiset<int>> tmp = mp; for (int i = 0; i < vec.size(); i++) { int dx = tx - vec[i].first; int dy = ty - vec[i].second; auto p = tmp[dx]....
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) c = [ tuple(map(int, input().split())) for x in range(0, 2*n) ] T = (0,0) for u in c: x, y = T a, b = u T = x + a, b + y x, y = T T = x // n, y // n print(*T)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n, a, b = int(input()), 0, 0 for i in range(n * 2): x, y = map(int, input().split()) a += x b += y print(a // n, b // n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) Ob = [] P = [] S = [] D = dict() for i in range(n): x, y = map(int, input().split()) Ob.append((x, y)) for i in range(n): a, b = map(int, input().split()) P.append((a, b)) for i in range(n): for j in range(n): t = (Ob[i][0] + P[j][0], Ob[i][1] + P[j][1]) if t not i...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.util.*; import java.io.*; /* BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); Integer.parseInt(st.nextToken()); Long.parseLong(st.nextToken()); Scanner sc = new Scanner(System.in); */ public class Waw{ public stati...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) l=[] q=[] for i in range(n): x=list(map(int,input().split())) l.append(x.copy()) for i in range(n): x=list(map(int,input().split())) q.append(x.copy()) l.sort() q.sort(reverse=True) print(l[0][0]+q[0][0],l[0][1]+q[0][1])
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.*; import java.util.*; import java.text.*; public class Main { public static void main (String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String st[] = br.readLine().split(" "); int n=Integer.parseInt(st[0]); int xy[][]=...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; const long long inf = 1e10; const long long mod = 1e9 + 7; signed main() { ios::sync_with_stdio(0); cin.tie(0); long long x = 0, y = 0; int n; cin >> n; for (int i = 1; i <= 2 * n; i++) { long long xx, yy; cin >> xx >> yy; x += xx; y += yy; } ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { __SolutionBase begin = new __SolutionBase(); begin.Solve(); } } class __SolutionBase { public void Solve() { init(); int n = readInt(); long x = 0L; long y =...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.*; import java.math.*; import java.util.*; import java.util.stream.*; import static java.lang.Math.abs; import static java.lang.Math.min; import static java.lang.Math.max; import static java.lang.Math.sqrt; import static java.lang.Integer.signum; @SuppressWarnings("unchecked") public class P1091B { c...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
def Treasure(obelisk,clues): obelisk.sort() clues.sort() print obelisk[0][0]+clues[len(clues)-1][0],obelisk[0][1]+clues[len(clues)-1][1] def main(): n = int(raw_input()) obelisk = [] clues = [] for i in range(n): x,y = map(int,raw_input().split()) obelisk.append((x,y))...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#!/usr/bin/python3 import math import sys DEBUG = False def inp(): return sys.stdin.readline().rstrip() def dprint(*value, sep=' ', end='\n'): if DEBUG: print(*value, sep=sep, end=end) def solve(N, O, C): cs = set() for (x, y) in C: cs.add((x, y)) for c in C: X = O[...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) a = [] b = [] for i in range(n): a.append(list(map(int,input().split()))) for i in range(n): b.append(list(map(int,input().split()))) a.sort(reverse=True) b.sort() print(b[0][0]+a[0][0],b[0][1]+a[0][1])
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; const int M = 1e9 + 7; int main() { long long n; scanf("%lld", &n); ; vector<pair<long long, long long>> v1, v2; for (int i = 0; i < n; i++) { long long a, b; scanf("%lld", &a); ; scanf("%lld", &b); ; v1.push_back({a, b}); } for (int i ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.HashMap; import java.io.IOException; import java.io.InputStreamReader; import java.util.Objects; import java.util.StringTokenizer; import java.util.Map; import java.io.BufferedReader; import...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; void solve() { long long n; cin >> n; vector<pair<long long, long long>> obel(n); for (int i = 0; i < n; i++) { cin >> obel[i].first >> obel[i].second; } vector<pair<long long, long long>> klad(n); for (int i = 0; i < n; i++) { cin >> klad[i].first >> ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
from collections import Counter n=int(input()) a=[] b=[] final1=[] final2=[] for _ in range(n): l=[int(x) for x in input().split()] a.append(l) for _ in range(n): m=[int(y) for y in input().split()] b.append(m) for i in range(n): for j in range(n): final1.append(a[i][0]+b[j][0]) final2.append((a[i][1...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long int n; cin >> n; pair<long long int, long long int> coordinate1[n]; pair<long long int, long long int> coordinate2[n]; for (long long int i = 0; i < n; i++) { cin >> coordi...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import sys import math from collections import defaultdict try: sys.stdin = open('input.txt', 'r') sys.stdout = open('output.txt', 'w') except: pass n=int(input()) coords=[] params=[] for i in range(n): c=[int(x) for x in input().split()] coords.append(c) for i in range(n): p=[int(x) for x in inpu...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#from itertools import permutations n = int(input()) obe = [list(map(int,input().split())) for i in range(n)] clues = [list(map(int,input().split())) for i in range (n)] ti = sum([i[0] for i in obe]) + sum([i[0] for i in clues]) tj = sum([i[1] for i in obe]) + sum([i[1] for i in clues]) ti = ti//n tj = tj//n print...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.util.*; import java.awt.Point; public class B { public static void main(String[] args) { FastScanner scanner = new FastScanner(); int N = scanner.nextInt(); HashMap...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) a = [tuple(map(int, input().split())) for i in range(n)] b = [tuple(map(int, input().split())) for i in range(n)] a.sort() b.sort(reverse=True) print(a[0][0] + b[0][0], a[0][1] + b[0][1])
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) a=[] b=[] for i in range(0,n): t=list(map(int,input().split())) a.append([t[j] for j in range(2)]) for i in range(0,n): t=list(map(int,input().split())) b.append([t[j] for j in range(2)]) #print("a", a) #print("b", b) a=sorted(a) b=sorted(b) #print("a", a) #print("b", b) x=a[0][0]+b[n-1][0] y=a[0][1]...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
from collections import Counter n = input() o = [map(int, raw_input().split()) for _ in range(n)] v = [map(int, raw_input().split()) for _ in range(n)] c=Counter() for i in range(n): for j in range(n): c[(o[j][0]+v[j][0], o[j][1]+v[j][1])]+=1 o = [o[-1]]+o[:-1] print " ".join(`i` for i in c.most_common(1)[0][0...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
def s(x): return x[0] + x[1] n = int(input()) points = [] for i in range(n): x, y = map(int, input().split(' ')) points.append([x, y]) vects = [] for i in range(n): a, b = map(int, input().split(' ')) vects.append([a, b]) points.sort(key=s) vects.sort(key=s, reverse=True) if set(vects[0]) == set...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.util.*; public class Treasure { public static void main(String args[]) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long x = 0; long y = 0; for(long i=0; i<2*n; i++) { x += sc.nextLong(); y += sc.nextLong(); } System.out.println(x/n +" "+y/n); } }
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws FileNotFoundException { ConsoleIO io = new ConsoleIO(new InputStreamReader(System.in), new PrintWriter(System.out)); // String fileName = "C-large-practice"; // ConsoleIO io = new ConsoleI...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import sys from os import path if (path.exists('input.txt') and path.exists('output.txt')): sys.stdout = open('output.txt', 'w') sys.stdin = open('input.txt', 'r') def main(): n = int(input()) clues = [[int(i) for i in input().split()] for i in range(n)] dirs = [[int(i) for i in input().split()] fo...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10, mod = 1e9 + 7, INF = 1e9 + 10; const double eps = 1e-9; template <typename A, typename B> inline bool chmin(A &a, B b) { if (a > b) { a = b; return 1; } return 0; } template <typename A, typename B> inline bool chmax(A &a, B b) { if (...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) l1=[] l2=[] l3=[] l4=[] l5=[] l6=[] lt3=[] lt6=[] i=0 for i in range(n): a,b=map(int,input().split()) l1.append(a) l2.append(b) for i in range(n): a,b=map(int,input().split()) l4.append(a) l5.append(b) i=0 for j in l4: l3.append(l1[i]+j) #print(l3) i=0 for j in l5: ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) p = [] add = dict() for i in range(n): a, b = map(int, input().split()) p.append((a, b)) for i in range(n): a, b = map(int, input().split()) add[(a, b)] = 0 for key in add.keys(): T = [key[0] + p[0][0], key[1] + p[0][1]] ok = 1 for i in range(1, n): if not ((T[0] - p[i][0], T[1] - p[i][1]) in...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; using point_t = pair<int, int>; int main() { size_t n; cin >> n; vector<point_t> obelisks(n), clues(n); for (point_t &p : obelisks) cin >> p.first >> p.second; for (point_t &p : clues) cin >> p.first >> p.second; point_t treasure; map<point_t, size_t> finds; ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int main() { long long n, x, y, sa = 0, dus = 0; scanf("%I64d", &n); for (int i = 1; i <= n << 1; i++) { scanf("%I64d%I64d", &x, &y); sa += x; dus += y; } printf("%I64d %I64d\n", sa / n, dus / n); return 0; }
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.HashSet; import java.util.StringTokenizer; import java.util.Set; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /**...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.util.*; public class JavaApplication14 { public static void main(String[] args) { Scanner io = new Scanner(System.in); long sum1 = 0, sum2 = 0; int n = io.nextInt(); for(int i = 0; i < n*2; i++) { sum1 += io.nextInt(); sum2 += io.nextInt(); ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) tx = 0 ty = 0 for i in range(2*n): x,y = [int(i) for i in input().split()] tx += x ty += y print(int(tx/n),int(ty/n))
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) if n == 1: o = tuple(map(int, input().split())) c = tuple(map(int, input().split())) print(o[0] + c[0], o[1] + c[1]) exit() a, b = [tuple(map(int, input().split())) for _ in range(2)] o = {tuple(map(int, input().split())) for _ in range(n - 2)} c = [tuple(map(int, input().split())) fo...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; const long long int N = 1e6, inf = 1e9 + 7; inline bool isDigit(char c) { return '0' <= c && c <= '9'; } template <class T> inline T sqr(T x) { return x * x; } template <class T> inline bool isSquare(T x) { T y = sqrt(x + 0.5); return (y * y) == x; } template <class T...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
N = int(raw_input()) pres = [] for i in range(N): pres.append(map(int,raw_input().strip('\n').split(' '))) hm = {} poss = [] for i in range(N): x,y = map(int,raw_input().strip('\n').split(' ')) poss.append([x,y]) hm[(x,y)] = 1 px,py = pres[0] ans = None for x,y in poss: tx,ty = x+px,y+py flag = True for ex,e...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) tx = 0 ty = 0 for i in range(2*n): a,b = list(map(int,input().split())) tx += a ty += b print(tx//n,ty//n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
# @-*- coding: utf-8 -*- # @Time: 2018-10-21T21:21:26+08:00 # @Email: ykaiwan@163.com from collections import defaultdict,Counter import sys import random # sys.stdin = open('input') # sys.stdout = open('output','w+') n = int(raw_input()) pl, cl = [], [] for i in range(n): a = tuple(map(lambda x:int(x), raw_i...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) a = [] for _ in range(n): x, y = map(int, input().split()) a.append((x, y)) b = [] for _ in range(n): x, y = map(int, input().split()) b.append((-x, -y)) a.sort() b.sort() xa = a[0][0] ya = a[0][1] xb = b[0][0] yb = b[0][1] print(xa - xb, ya - yb)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n; cin >> n; long long x = 0, y = 0; for (int i = 0; i < n * 2; i++) { long long xt, yt; cin >> xt >> yt; x += xt; y += yt; } cout << x / n << ' ' << y / n; return 0...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int N; int X[1000], Y[1000], A[1000], B[1000]; int main() { scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d %d", &X[i], &Y[i]); } set<pair<int, int>> st; for (int i = 0; i < N; i++) { scanf("%d %d", &A[i], &B[i]); st.emplace(A[i], B[i]); } ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import sys #sys.stdin=open("data.txt") input=sys.stdin.readline mii=lambda:map(int,input().split()) n=int(input()) a=0 b=0 for _ in range(2*n): u,v=mii() a+=u b+=v print("%d %d"%(a//n,b//n))
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
def read_row(): return [int(i) for i in input().split()] def add(p1,p2): return [p1[0]+p2[0], p1[1]+p2[1]] n = int(input()) obelisks = [read_row() for _ in range(n)] clues = [read_row() for _ in range(n)] points = set([tuple(add(obelisks[0],offset)) for offset in clues]) for obelisk in obelisks[1:]: new_...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
ob = [] clue = [] n = int(input()) sum_x = 0 sum_y = 0 for i in range(n): x,y= list(map(int,input().strip().split())) sum_x += x; sum_y += y; for i in range(n): x, y = list(map(int, input().strip().split())) sum_x += x; sum_y += y; print(sum_x //n, sum_y//n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; import java.util.StringTok...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<pair<int, int> > xywaala(n); vector<pair<int, int> > abwaala(n); int x, y; for (int i = 0; i < n; i++) { cin >> x >> y; xywaala[i] = make_pair(x, y); } for (int i = 0; i < n; i++) { cin >> x >> y; abwaal...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.awt.Point; import java.io.*; import java.util.*; import java.util.Map.Entry; public class NewYearAndTheTreasureGeolocation { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(reader.r...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; struct E { int x, y; }; E map1[1010], map2[1010], map3[1010]; int vis[1010]; int n, flag; void dfs(int k) { if (k == n + 1) { cout << map3[n].x << " " << map3[n].y; flag = 1; return; } else { for (int i = 1; i <= n; i++) { if (!vis[i]) { ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.Input...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) x=[] y=[] a=[] b=[] for i in range(n): xx,yy=map(int, input().split()) x.append(xx) y.append(yy) for i in range(n): xx,yy=map(int, input().split()) a.append(xx) b.append(yy) print(int(sum(x+a)/n), int(sum(y+b)/n))
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; bool comp(int a[2], int b[2]) { if (a[0] != b[0]) return a[0] > b[0]; else return a[1] > b[1]; } int main() { int n; cin >> n; int ob[n][2], cl[n][2]; for (int i = 0; i < n; i++) { cin >> ob[i][0] >> ob[i][1]; } for (int i = 0; i < n; i++) { ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; const int maxn = (int)1e5 + 1; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int x[1001], y[1001], a[1001], b[1001]; int n; cin >> n; for (int i = 1; i <= n; i++) cin >> x[i] >> y[i]; for (int i = 1; i <= n; i++) cin >> ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.*; import java.util.*; public class Test { static int readInt() { int ans = 0; boolean neg = false; try { boolean start = false; for (int c = 0; (c = System.in.read()) != -1; ) { if (c == '-') { start = true; ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) c = 10000000 x, y, a, b = c, c, -c, -c for q in range(n): x1, y1 = map(int, input().split()) if x1 < x: x = x1 if y1 < y: y = y1 for q in range(n): a1, b1 = map(int, input().split()) if a1 > a: a = a1 if b1 > b: b = b1 print(x + a, y + b)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.util.*; import java.io.*; public class tre { public static void main(String []Args)throws Exception { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); long x=0,y=0; for(int i=0;i<2*n;i++){ x+=sc.nextLong(); y+=sc.nextLong(); } System.out.printl...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) x, y = 0, 0 for _ in range(2 * n): xi, yi = map(int, input().split()) x += xi y += yi print(x // n, y // n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
""""""""""""""""""""""""""""""""""""""""""""" | author: mr.math - Hakimov Rahimjon | | e-mail: mr.math0777@gmail.com | """"""""""""""""""""""""""""""""""""""""""""" #inp = open("spaceship.in", "r"); input = inp.readline; out = open("spaceship.out", "w"); print = out.write TN = 1 # =================...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
num=int(input()) sumx,sumy=0,0 for i in range(2*num): x,y=input().split() sumx+=int(x) sumy+=int(y) print(sumx//num,sumy//num)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) x,y,a,b=[0]*n,[0]*n,[0]*n,[0]*n for i in range(n): x[i],y[i]=map(int,input().split()) for i in range(n): a[i],b[i]=map(int,input().split()) print(max(x)+min(a),max(y)+min(b))
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) oblique=[] sum_r_obliq=0 sum_c_obliq=0 sum_r_clue=0 sum_c_clue=0 for i in range(n): a,b=map(int,input().split()) sum_r_obliq+=a sum_c_obliq+=b clue=[] for i in range(n): c,d=map(int,input().split()) sum_r_clue+=c sum_c_clue+=d print((sum_r_obliq+sum_r_clue)//n,(sum_c_obliq+sum_c_c...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.util.*; import java.io.*; public class B{ static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); int X = 1e9, Y = 1e9; for (int i = 0; i < n; ++i) { int x, y; scanf("%d %d", &x, &y); if (x < X || (x == X && y < Y)) { X = x; Y = y; } } int X2 = 1e9, Y2 = 1e9; for (int i = 0; i < n; ++i) { ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
a=input() x=0 y=0 for i in range(2*a): b=raw_input().split() x+=int(b[0]) y+=int(b[1]) print x//a,y//a
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /** * Runtime O(n) * * @author Don Li */ public class NewYearAndTheTreasureGeolocation2 { void solve() { int n = in.nextInt(); long...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int n, first[1001], second[1001], a[1001], b[1001]; map<pair<int, int>, int> mp; void solve() { cin >> n; for (int i = 0; i < n; i++) cin >> first[i] >> second[i]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i], mp[{a[i], b[i]}] = i; for (int i = 0; i < n; i++) { ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
""" this is a standard python template for codeforces task, repo: github.com/solbiatialessandro/pyComPro/codeforces """ stdin = lambda type_ = "int", sep = " ": list(map(eval(type_), raw_input().split(sep))) joint = lambda sep = " ", *args: sep.join(str(i) if type(i) != list else sep.join(map(str, i)) for i in args) de...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import static java.util.Arrays.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class B { public Object solve () { int N = sc.nextInt(); long [][] P = sc.nextLongs(N); long [][] C = sc.nextLongs(N); Set<String> H = new HashSet<>(); for (int i : rep(N)) H.add(Arrays...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()); x1=y1=0; for i in range(1,int(2*n+1)): a,b=map(int,input().split()) x1+=a;y1+=b; print(int(x1/n) ,int(y1/n));
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import sys def inpt(): return sys.stdin.readline().strip() n=int(inpt()) x=0 y=0 for i in range(2*n): xt,yt=[int(i) for i in inpt().split()] x+=xt y+=yt print(x//n,y//n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
a=int(input());xx=0;yy=0 for i in range(a*2): x,y=map(int,input().split()) xx+=x yy+=y print(xx//a,yy//a)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n=int(input()) sumj=0 sumk=0 for i in range(n*2): j,k=map(int,input().split()) sumj+=j sumk+=k print(sumj//n,sumk//n)
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; long long ax[1005], ay[1005], bx[1005], by[1005]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; for (int i = 0; i < n; i++) cin >> ax[i] >> ay[i]; for (int i = 0; i < n; i++) cin >> bx[i] >> by[i]; long long tx, ty; sort(ax, ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
n = int(input()) xy = [] for _ in range(n): xy.append([int(x) for x in input().split()]) ab = [] for _ in range(n): ab.append([int(x) for x in input().split()]) xy.sort() ab.sort(reverse=True) ans = (xy[0][0] + ab[0][0], xy[0][1] + ab[0][1]) print(ans[0], ans[1])
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; const long long MAXN = 1010; const long long MOD = 1000000007; int n, Tx, Ty; pair<int, int> XY[MAXN]; pair<int, int> AB[MAXN]; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; int x, y; for (int i = 0; i < n; i++) { cin >> x...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Codeforces1091B { public static void main(String[] args) throws Exception { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(input.readLine()); ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; inline long long scan() { long long _x = 0, _tmp = 1; char _tc = getchar(); while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar(); if (_tc == '-') _tc = getchar(), _tmp = -1; while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar(); ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> using namespace std; int x[1005], y[1005], cx[1005], cy[1005]; map<pair<int, int>, int> m; int main() { int t; scanf("%d", &t); for (int i = 0; i < t; i++) { scanf("%d%d", &x[i], &y[i]); } for (int i = 0; i < t; i++) { scanf("%d%d", &cx[i], &cy[i]); } for (int i = 0; i < t...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
def main(): n = int(input()) ob = [(0, 0)] * n d = [(0, 0)] * n for i in range(n): ob[i] = tuple(map(int, input().split())) for i in range(n): d[i] = tuple(map(int, input().split())) ans = set() for i in range(n): new_ans = set() for j in range(n): ...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") using namespace std; long long used[100001], used2[100001], used3[100001], mas[100...
Problem: Bob is a pirate looking for the greatest treasure the world has ever seen. The treasure is located at the point T, which coordinates to be found out. Bob travelled around the world and collected clues of the treasure location at n obelisks. These clues were in an ancient language, and he has only decrypted th...
#include <bits/stdc++.h> int n; long long x, y; int a, b; int main() { scanf("%d", &n); for (int i = 0; i < n * 2; i++) { scanf("%d%d", &a, &b); x += a; y += b; } printf("%lld %lld\n", x / n, y / n); }