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...
n = int(input()) T = [0, 0] for i in range(2*n): a, b = map(int, input().split()) T[0] += a T[1] += b print(T[0] // n, T[1] // 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...
from sys import stdin, stdout from io import StringIO # fin = open("treasure.in", "r") fin = stdin num_obelisks = int(fin.readline()) obs = [] for _ in range(num_obelisks): obs.append(tuple(map(int, fin.readline().strip().split()))) cls = [] for _ in range(num_obelisks): cls.append(tuple(map(int, fin.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; const int N = 1001; int n; int x[N], y[N]; int a[N], b[N]; map<pair<int, int>, int> mp; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= n; ++i) cin >> x[i] >> y[i]; for (int i = 1; i <= n; ++i) cin >> 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.util.*; import java.lang.*; import java.io.*; import java.awt.Point; // U KNOW THAT IF THIS DAY WILL BE URS THEN NO ONE CAN DEFEAT U HERE................ // ASCII = 48 + i ;// 2^28 = 268,435,456 > 2* 10^8 // log 10 base 2 = 3.3219 // odd:: (x^2+1)/2 , (x^2-1)/2 ; x>=3// even:: (x^2/4)+1 ,(x^2/4)-1 x >=4...
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.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
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){ PrintWriter pr=new PrintWriter(System.out); Scanner scan=new Scanner(System.in); int n=scan.nextInt(); int[][] o=new int[n][2]; int[][] clue=new int[n][2]; HashSet<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...
#include <bits/stdc++.h> using namespace std; signed main() { long long int sumx, sumy, x, y, n; sumx = 0; sumy = 0; cin >> n; for (long long int i = 0; i < 2 * n; i++) { cin >> x >> y; sumx += x; sumy += y; } sumx = sumx / n; sumy = sumy / n; cout << sumx << " " << sumy << endl; return ...
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 int n; cin >> n; vector<pair<long long int, long long int>> v, a; for (long long int i = 0; i < n; i++) { long long int x, y; cin >> x >> y; v.push_back(make_pair(x, y)); } for (long long int i = 0; i < n; i++) { long 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...
n = int(raw_input()) a = [] for i in xrange(2*n): a.append(list(map(int,raw_input().split()))) x = 0 y= 0 for i in a: x += i[0] y += i[1] x = x/n y = y/n print 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...
n = int(input()) a,b = [],[] for i in range(n): r = tuple(map(int,input().split())) a.append(r) for i in range(n): r = tuple(map(int,input().split())) b.append(r) c = [] for i in range(n): k=set() for j in range(n): r = (a[i][0]+b[j][0],a[i][1]+b[j][1]) k.add(r) c.append(k) d...
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.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; 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...
obilisks = int(input()) xtreasure = 0; ytreasure = 0; for i in range(obilisks+obilisks): xpos, ypos = [int(x) for x in input().split()] xtreasure += xpos ytreasure += ypos print(xtreasure//obilisks, ytreasure//obilisks)
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 totx, toty; int main() { scanf("%d", &N); for (int i = 0; i < 2 * N; i++) { int xi, yi; scanf("%d%d", &xi, &yi); totx += xi, toty += yi; } printf("%lld %lld\n", totx / N, toty / 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; const int N = 1234; int x[N], y[N], a[N], b[N]; map<pair<int, int>, bool> m; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> x[i] >> y[i]; m[make_pair(x[i], y[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...
from sys import stdin, stdout from math import * from heapq import * from collections import * def main(): ob=[] cl=[] n=int(stdin.readline()) for _ in range(n): ob.append([int(x) for x in stdin.readline().split()]) for _ in range(n): cl.append([int(x) for x in stdin.readline().spli...
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 javafx.util.*; public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); Pair<Integer,Integer> p1[]=new Pair[n]; Pair<Integer,Integer> p2[]=new Pair[n]; 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...
n=int(input()) x=0;y=0 for i in range(2*n): a,b=map(int,input().split()) x+=a;y+=b 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...
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<int> x(n); vector<int> y(n); vector<int> a(n); vector<int> b(n); for (int i = 0; i < (n); ++i) cin >> x.at(i) >> y.at(i); for (int i = 0; i < (n); ++i) cin >> a.at(i) >> b.at(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.Arrays; import java.util.Objects; import java.util.Scanner; import java.util.Set; import java.util.stream.Collectors; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Vector[] obelisks = readArray(sc, n); Vector[] clues =...
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 = 0 y1 = 0 for i in range(n): a, b = map(int, input().split()) x1 += a y1 += b x2 = 0 y2 = 0 for i in range(n): a, b = map(int, input().split()) x2 += a y2 += b print((x1 + x2) // n, (y1 + y2) // 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...
#send help plz from math import inf def main(): count=int(input()) x=0 y=0 for a in range(count): arr=input().split() x+=int(arr[0]) y+=int(arr[1]) arr=input().split() x+=int(arr[0]) y+=int(arr[1]) x//=count y//=count print(x,y) main()
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 = 1e3 + 7; int n; int a[N], b[N], x[N], y[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d%d", &a[i], &b[i]); } for (int i = 1; i <= n; i++) { scanf("%d%d", &x[i], &y[i]); } sort(a + 1, a + 1 + n); sort(b + 1, 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()) cood = [] for i in range(n): cood += [list(map(int, input().split()))] arr = [] for i in range(n): x, y = map(int, input().split()) buf = [] for j in range(n): buf += [(x + cood[j][0], y + cood[j][1])] arr += [buf] res = set() for i in range(n): res.add(arr[i][0]) for j ...
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> const int inf = 1039074182; using namespace std; int n; int a[1005]; int b[1005]; int pa[1005]; int pb[1005]; set<pair<int, int> > squ; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } for (int i = 0; i < n; i++) { cin >> pa[i] >> pb[i]; } int 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...
#include <bits/stdc++.h> namespace lh { using namespace std; } using namespace lh; const int MXN = 1e6 + 7; const int INF = 0x3f3f3f3f; const int mod = 1000000007; int n, m, k; struct lp { int x, y; } cw[MXN], opt[MXN], ans, tmp; map<pair<int, int>, int> mp; int main() { scanf("%d", &n); for (int i = 1; i <= 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() ) x = 0 y = 0 for i in range(n): xx,yy = map( int, input().split(' ') ) x+=xx y+=yy for i in range(n): xx,yy = map( int, input().split(' ') ) x+=xx y+=yy 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...
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static...
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.util.regex.MatchResult; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; public class Source { class FastScanner { private BufferedReader bufferedReader; private StringTokenizer stringTokenizer; ...
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 double pi = acos(-1.0); double eps = 1e-9; int_fast64_t L = 31250001; const int_fast64_t md = 1e9 + 7; bool on(int_fast64_t x, vector<int_fast64_t> &ar) { return ar[(x) >> 6] & (1LL << ((x)&63)); } void set1(int_fast64_t x, vector<int_fast64_t> &ar) { ar[(x) >> 6] ...
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 maxk = 17; const int maxn = 1e3 + 17; int N; pair<int, int> A[maxn], B[maxn]; int main() { ios_base::sync_with_stdio(false); cin >> N; for (int i = 1; i <= N; i++) cin >> A[i].first >> A[i].second; for (int i = 1; i <= N; i++) cin >> B[i].first >> B[i].sec...
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()) obelisks =[map(int, raw_input().split()) for _ in range(n)] clues = [map(int, raw_input().split()) for _ in range(n)] T = set() for obelisk in obelisks: T.add((obelisk[0]+clues[0][0], obelisk[1]+clues[0][1])) for clue in clues: options = set() for obelisk in obelisks: options.ad...
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 def read_int(): return int(input().strip()) def read_int_list(): return list(map(int,input().strip().split())) def read_string(): return input().strip() def read_string_list(delim=" "): return input().strip().split(delim) ###### Author : Samir Vyas ####### ###### Write Code Below ####...
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; vector<pair<int, int>> obe(n); vector<pair<int, int>> clu(n); for (int i = 0; i < n; i++) { pair<int, int> temp; cin >> temp.first >> temp.second; obe[i] = temp; } for (int i = 0; i < n; i++) { pair<int, int> temp;...
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()) xys = [] for _ in range(n): x, y = map(int, input().split()) xys.append([x, y]) txys = [] for _ in range(n): tx, ty = map(int, input().split()) txys.append([tx, ty]) xys = sorted(xys) txys = sorted(txys)[::-1] #print(xys, txys) print(xys[0][0] + txys[0][0], xys[0][1] + txys[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 static java.lang.System.out; import java.util.Scanner; public class Test { Test() { Scanner in = new Scanner(System.in); int count = in.nextInt(); int smallestObelY = Integer.MAX_VALUE; int smallestObelX = Integer.MAX_VALUE; int largestClueY = Integer.MIN_VALUE; int largestClueX = 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...
/** * @author Finn Lidbetter */ import java.util.*; import java.io.*; import java.awt.geom.*; public class TaskB { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int 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; long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.precision(10); int t = 1; while (t--) { long long n, m, o; cin >> n; long long ax = -200000000000000ll, ay...
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.util.Map.Entry; import java.io.*; public class B { static BufferedReader br; static StringTokenizer st; static int n; static Point[] points; static Point[] offset; public static void main(String[] args) throws NumberFormatException, IOException { br = new BufferedReader(new 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; const int maxn = 1000 + 100; int n, a[maxn], b[maxn], x[maxn], y[maxn]; set<pair<pair<int, int>, int> > s; set<pair<pair<int, int>, int> >::iterator it; void add(int A, int B) { it = s.lower_bound({{A, B}, -1}); if (it == s.end()) { s.insert({{A, B}, 1}); return...
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 = 1010; int n, x[N], y[N], a[N], b[N]; map<pair<int, int>, int> mp; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d %d", &x[i], &y[i]); for (int i = 1; i <= n; i++) scanf("%d %d", &a[i], &b[i]); for (int i = 1; i <= n; i++) { for...
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 char GET_CHAR() { const int maxn = 131072; static char buf[maxn], *p1 = buf, *p2 = buf; return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, maxn, stdin), p1 == p2) ? EOF : *p1++; } inline int getInt() { int res(0); char c = 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...
n = int(input()) c, d = list(), list() for i in range(n): c.append(tuple(map(int, input().split()))) for i in range(n): d.append(tuple(map(int, input().split()))) c.sort(key=lambda x:(x[0], x[1])) d.sort(key=lambda x:(x[0], x[1]), reverse=True) print(c[0][0] + d[0][0], c[0][1] + d[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...
# -*- coding: utf-8 -*- """ Created on Sun Dec 30 16:04:22 2018 @author: Miha """ n = int(input()) obsk = [] for i in range(n): vect = input() vect = vect.split() obsk.append(((int(vect[0]), int(vect[1])))) clues = [] c_memb = set() for i in range(n): vect = input() vect = vect.split() clue ...
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(0); cin.tie(0); int n; cin >> n; long long a = 0, b = 0; for (int i = 1; i <= n * 2; i++) { int x, y; cin >> x >> y; a += x; b += y; } cout << a / n << " " << b / n << endl; 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...
n = int(input()) sum_x, sum_y = 0, 0 for i in range(2*n): x, y = map(int, raw_input().split()) sum_x += x sum_y += y print "%d %d"%(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...
// Author @ BlackRise :) // // Birla Institute of Technology, Mesra// import java.io.*; import java.util.*; public class treasureGeo { static int n,t,mod=998244353; static void Blackrise() { //The name Blackrise is my pen name... you can change the name according...
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()) maxX = -10000000000 maxY = -10000000000 minA = 10000000000 minB = 10000000000 for i in range(n): a, b = map(int, input().split()) if(a>maxX): maxX = a if(b>maxY): maxY = b for i in range(n): a, b = map(int, input().split()) if(a<minA): minA = a if(b<minB)...
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 mod = 1000000007; const long long msize = 1e6 + 100; int main() { ios::sync_with_stdio(0); cin.tie(0); long long n; cin >> n; long long x[n]; long long y[n]; long long a[n]; long long b[n]; set<pair<long long, long long>> s; 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...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 7; const int mod = 998244353; long long read() { long long c = getchar(), Nig = 1, x = 0; while (!isdigit(c)) c = getchar(); if (c == '-') Nig = -1, c = getchar(); while (isdigit(c)) x = ((x << 1) + (x << 3)) + (c ^ '0'), c = getchar(); retu...
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()) #A=[] #B=[] sx,sy=0,0 for i in range(2*n): x,y=map(int,raw_input().split()) sx+=x sy+=y #A.appendmap(int,raw_input().split()) #for i in range(n): #B.appendmap(int,raw_input().split()) print sx/n,sy/n exit()
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 javafx.util.*; import java.util.*; import java.io.*; import java.math.*; public class Test8 { PrintWriter pw = new PrintWriter(System.out); Random rnd = new Random(); int a; void run(){ a = ni(); int[] x = new int[a], y = new int[a], vx = new int[a], vy = new int[a]; f...
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 = 0 Y = 0 for _ in range(2*n): x,y = [int(x) for x in input().split()] X += x Y += y 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...
if __name__ == '__main__': n= int(input()) #print(n) x=[ input().split() for i in range(n)] a=[ input().split() for i in range(n)] temp=[] t=[] sumX,sumY,sumA,sumB=0,0,0,0 for i in range(n): sumX+=int( x[i][0] ) sumY+=int( x[i][1] ) sumA+=int( a[i][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 ObeX[1001]; int ObeY[1001]; int ClueX[1001]; int ClueY[1001]; int Clue[1001]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int N; cin >> N; for (int i = 0; i < N; i++) { cin >> ObeX[i] >> ObeY[i]; } for (int i = 0; i < N; i++) { cin >> Cl...
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 = [] q = [] for _ in range(n): r = tuple(map(int, input().split(' '))) p.append(r) for _ in range(n): r = tuple(map(int, input().split(' '))) q.append(r) p = sorted(p) q = sorted(q) x, y = p[0][0] + q[0][0], p[0][1] + q[0][1] alt = False for i in range(n): if p[i][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.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class treasure { sta...
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 = 2333; pair<int, int> P[MAXN * MAXN]; int x[MAXN], y[MAXN]; int main() { int n; scanf("%d", &n); n *= 2; for (int i = 1; i <= n; i++) { scanf("%d%d", &x[i], &y[i]); } int tot = 0; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j...
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()) obelisk = [] clue = [] matrix = {} for x in range(N): obelisk.append( list(map(int,input().split())) ) for x in range(N): clue.append( list(map(int,input().split())) ) for i in obelisk: for j in clue: x = i[0]+j[0] y = i[1]+j[1] try: matrix[ str(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...
#include <bits/stdc++.h> #pragma GCC optimize("O3") using namespace std; void init_ios() { ios_base::sync_with_stdio(0); cin.tie(0); } const int N = 1010; int n, x[N], y[N], a[N], b[N]; map<pair<int, int>, int> vis; int main() { init_ios(); cin >> n; for (int i = 1; i <= n; ++i) cin >> x[i] >> y[i]; for (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; int main() { int n, x, y, a, b; cin >> n; int minX = INT_MAX; int minY = INT_MAX; for (int i = 0; i < n; i++) { cin >> x >> y; if (x < minX) { minX = x; minY = y; } else if (x == minX) { minY = min(minY, y); } } int maxX = INT...
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()) s=[] q=[] x=[0]*n a=[0]*n for i in range(n): s.append(input()) for i in range(n): q.append(input()) for i in range(n): x[i]=list(map(int,s[i].split())) a[i]=list(map(int,q[i].split())) x=sorted(x) a=sorted(a) a=a[-1::-1] print(x[0][0]+a[0][0],x[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; int a[2005], b[2005], x[2005], y[2005], n; map<pair<int, int>, int> mp; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d%d", &x[i], &y[i]); for (int j = 1; j <= n; j++) scanf("%d%d", &a[j], &b[j]); for (int i = 1; i <= n; i++) { for (int j = ...
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() 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...
from collections import defaultdict n = int(input()) a = [[int(i) for i in input().split()] for _ in range(n)] b = [[int(i) for i in input().split()] for _ in range(n)] x = {a[i][0]:1 for i in range(n)} y = {a[i][1]:1 for i in range(n)} count = defaultdict(lambda:0) for g,h in b: count[(g,h)] += 1 for i in ran...
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 n; cin >> n; long long a = 0, b = 0, x, y; for (long long i = 0; i < 2 * n; i++) { cin >> x >> y; a += x; b += y; } cout << a / n << " " << b / 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 pii = std::pair<int, int>; using pll = std::pair<long long, long long>; int main() { std::ios::sync_with_stdio(false); int n; std::cin >> n; int x[n], y[n], a[n], b[n]; for (int i = 0; i < n; i++) std::cin >> x[i] >> y[i]; for (int i = 0; i < n; i++) std::cin >> 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 java.util.Scanner; public class B { public static void main (String[] args) { Scanner input = new Scanner(System.in); int n= input.nextInt(); int [] x= new int [n]; int [] y= new int [n]; int [] a= new int [n]; int [] b= new int [n]; for (int i=0; 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 = input() a = [map(int, raw_input().split()) for _ in range(n)] b = [map(int, raw_input().split()) for _ in range(n)] c = {} for x, y in b: c[(x, y)] = c.get((x, y), 0) + 1 for u, v in b: p = (a[0][0] + u, a[0][1] + v) d = {} for x, y in a: t = (p[0] - x, p[1] - y) d[t] = d.get(t, 0) + 1 if d[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...
#include <bits/stdc++.h> using namespace std; using LL = long long; using PII = pair<int, int>; int main() { int n; scanf("%d", &n); LL ansx, ansy; ansx = ansy = 0; n *= 2; for (int i = 1; i <= n; i++) { int x, y; scanf("%d%d", &x, &y); ansx += x; ansy += y; } n /= 2; printf("%lld %lld...
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...
t=int(raw_input()) p=[] q=[] for i in range(t): x=map(int,raw_input().split()) p.append(x) for i in range(t): x=map(int,raw_input().split()) q.append(x) x1={} y1={} for i in p: for j in q: xx=i[0]+j[0] yy=j[1]+i[1] z=(xx,yy) if z in x1: x1[z]=x1[z]+1 else: x1[z]=1 if(x1[z]==t): print xx,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...
#include <bits/stdc++.h> using namespace std; const int maxn = 1010; int n; pair<int, int> p1[maxn], p2[maxn]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d %d", &p1[i].first, &p1[i].second); } for (int i = 1; i <= n; i++) { scanf("%d %d", &p2[i].first, &p2[i].second); } sor...
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 bisect import bisect_right as br from bisect import bisect_left as bl from collections import defaultdict from itertools import combinations import functools import sys import math MAX = sys.maxsize MAXN = 10**6+10 MOD = 10**9+7 def isprime(n): n = abs(int(n)) if n < 2: return False if n == 2: ...
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 add(a,b): return (a[0]+b[0],a[1]+b[1]) def diff(a,b): return (a[0]-b[0],a[1]-b[1]) n = int(input()) P = [tuple(int(x) for x in input().split()) for _ in range(n)] D = [tuple(int(x) for x in input().split()) for _ in range(n)] pts = [add(P[0],D[i]) for i in range(n)] from collections import 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...
""" sum(xi yi) + sum ai+bi = N txi """ n = int(input()) X,Y = 0,0 for _ in range(2*n): x,y = map(int, input().split()) X += x Y += y X //= n Y //= n print(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...
n=int(input()) for i in range(n): if(i==0): mx,my=map(int,input().split()) else: x,y=map(int,input().split()) if(mx>x): mx=x if(my>y): my=y for i in range(n): if(i==0): ma,mb=map(int,input().split()) else: a,b=map(int,input().spl...
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...
n=int(raw_input()) O=[] C=[] for _ in range(n): O+=[map(int,raw_input().split())] for _ in range(n): C+=[map(int,raw_input().split())] O.sort() C.sort() print O[0][0]+C[-1][0],O[0][1]+C[-1][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 n, d, ans1, ans2; pair<int, int> x[1010], a[1010], t[10000010]; int main() { cin >> n; for (int i = 1; i <= n; ++i) cin >> x[i].first >> x[i].second; for (int i = 1; i <= n; ++i) cin >> a[i].first >> a[i].second; d = 0; for (int i = 1; i <= n; ++i) for (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...
from random import shuffle n = int(input()) obelisks = [] clues = [] for i in range(n): obelisks.append(tuple(map(int, input().split()))) for i in range(n): clues.append(tuple(map(int, input().split()))) shuffle(obelisks) shuffle(clues) candidates = [] for obelisk in obelisks: candidates.append((obelisk...
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 = [] for i in range(n): a,b = map(int,input().split()) x += [a] y += [b] clx= [] cly = [] for i in range(n): c,d = map(int,input().split()) clx += [c] cly += [d] print(min(x) + max(clx),min(y) + max(cly))
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): m,k=map(int,input().split()) x.append(m) y.append(k) for j in range(n): m,k=map(int,input().split()) a.append(m) b.append(k) tx=(sum(x)+sum(a))//n ty=(sum(y)+sum(b))//n print(tx,ty)
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()) obelisk = [list(map(int, input().split())) for _ in range(n)] clues = [tuple(map(int, input().split())) for _ in range(n)] d = set(clues) first = obelisk[0] for clue in clues: treasure = [0, 0] treasure[0] = first[0]+clue[0] treasure[1] = first[1] + clue[1] f = False for o in obe...
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()) a = [] b = [] for i in xrange(2 * n): x , y = [int(j) for j in raw_input().split(' ')] #print x , y a.append(x) b.append(y) a = sorted(a) b = sorted(b) print a[0] + a[-1] , b[0] + b[-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.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class TreasureGeolocation { public static void main(String[] args) { Scanner scanner = new Scanner(); int n = scanner.nextInt(); long sumX = 0; l...
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()) a1 = 100000000 b1 = 100000000 a2 = -100000000 b2 = -100000000 for i in range(0, n): a, b = [int(x) for x in input().split()] if a < a1: a1 = a b1 = b if a == a1: b1 = min(b, b1) for i in range(0, n): a, b = [int(x) for x in input().split()] if a > a2: ...
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 = [0]*n y = [0]*n a = [0]*n b = [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()) ax = (sum(x)+sum(a))//n ay = (sum(y)+sum(b))//n print(ax,ay)
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, m, i, j, k, cc[50000][2], dd[50000][2], a, b; map<pair<int, int>, int> mm; int main() { scanf("%d\n", &n); for (int i = 1; i <= n; i++) scanf("%d%d", &cc[i][0], &cc[i][1]); for (int i = 1; i <= n; i++) scanf("%d%d", &dd[i][0], &dd[i][1]); for (int i = 1; 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; signed main() { ios_base::sync_with_stdio(0); int n; cin >> n; long long x = 0, y = 0; for (int i = 0; i < n; i++) { long long tx, ty; cin >> tx >> ty; x += tx; y += ty; } for (int i = 0; i < n; i++) { long long a, b; cin >> a >> 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()) a = 0 b = 0 for i in range(1, n * 2 + 1): x, y = map(int, input().split()) a += x; b += y; print(int(a / n), int(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; const int N = 1e5 + 10; struct Tnode { int x, y; } q[N], p[N]; bool cmp(Tnode a, Tnode b) { return a.x == b.x ? a.y < b.y : a.x < b.x; } int main() { int n; cin >> n; for (int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y; for (int i = 1; i <= n; i++) cin >> q[i].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.lang.*; import java.math.*; import java.util.*; import java.io.*; public class Main { class Node { int x; int y; public Node(int x,int y){ this.x=x; this.y=y; } @Override public boolean equals(Object o){ if(o instanceof Node){ Node c = (Node)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()) x_y=[] for i in range(n): x,y=input().split(" ") x=int(x) y=int(y) x_y.append((x,y)) x_y.sort() a_b=[] for i in range(n): a,b=input().split(" ") a=int(a) b=int(b) a_b.append((a,b)) a_b.sort() print(x_y[0][0]+a_b[-1][0],end=' ') print(x_y[0][1]+a_b[-1][1],end=' ')
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()) ans1=0 ans2=0 for i in range(0,2*n): a,b=[int(x) for x in input().split()] ans1+=a ans2+=b print(ans1//n,ans2//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 M = 998244353; int main() { int n; cin >> n; vector<pair<int, int> > a, b; for (int i = 0; i < n; ++i) { int x, y; cin >> x >> y; a.push_back({x, y}); } sort((a).begin(), (a).end()); for (int i = 0; i < n; ++i) { int x, y; cin >> 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...
n = int(raw_input()) sumx = 0 sumy = 0 for i in range (0, 2*n): a,b = map(int, raw_input().split()) sumx += a sumy += b sumx /= n sumy /= n print str(sumx) + " " + str(sumy)
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; vector<vector<int>> a; vector<vector<int>> b; for (int i = 0; i < n; i++) { vector<int> x(2); cin >> x[0] >> x[1]; a.push_back(x); } for (int i = 0; i < n; i++) { vector<int> x(2); cin >> x[0] >> x[1]; b.pu...
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 implements Runnable { FastReader scn; PrintWriter out; String INPUT = ""; void solve() { int n = scn.nextInt(); int[][] a = new int[n][]; for(int i = 0; i < n; i++) { a[i] = scn.nextIntArray(2); } int[][] b = new int[n][]; 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...
n = int(input()) a1,a2 = float('inf'),float('inf') b1,b2 = -1*float('inf'),-1*float('inf') for _ in range(n): a,b = map(int,input().split()) a1 = min(a1,a) a2 = min(a2,b) for _ in range(n): a,b = map(int,input().split()) b1 = max(b1,a) b2 = max(b2,b) print(int(a1+b1),int(a2+b2))
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.lang.reflect.Array; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class Solution { private static final Scanner sc = new Scanner(System.in); public static void main(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...
import java.util.*; public class test { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); HashMap<String, Integer> hm = new HashMap<>(); Pair a[] = new Pair[n]; Pair b[] = new Pair[n]; for (int i = 0; i < n; i++) { ...