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...
#include <bits/stdc++.h> using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) f = ch == '-' ? -1 : 1; for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0'; return x * f; } struct Note { int x, y; } st, a[1010], x[1010]; int n; map<pair<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...
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...
import java.util.*; import java.lang.*; import java.io.*; public final class new_year{ public static void main(String[] args) throws java.lang.Exception{ Reader r = new Reader(); r.init(System.in); int n = r.nextInt(); int[] x = new int[n]; int[] y = new int[n]; 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...
import java.util.*; import java.io.*; import java.awt.Point; import java.math.BigInteger; public class clues { static Comparator<Point> compare = new Comparator<Point>() { public int compare(Point a, Point b) { if(a.x == b.x) return a.y-b.y; return a.x-b.x; } }; public static void main(String[] args...
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 # Your code here! N = int(input()) x,y = 0,0 for _ in range(2*N): tmp_x,tmp_y = map(int,input().split()) x += tmp_x y += tmp_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...
from itertools import permutations n = int(input()) x = 0 y = 0 clx = 0 cly = 0 for _ in range(n): t = list(map(int,input().split())) x += t[0] y += t[1] for _ in range(n): t = list(map(int,input().split())) clx += t[0] cly += t[1] print((x+clx)//n, (y+cly)//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_input(): n = int(input()) obelisks = [] for _ in range(n): obelisk = input() obelisk = [int(coor) for coor in obelisk.strip().split()] obelisks.append(obelisk) clues = [] for _ in range(n): clue = input() clue = [int(dir_) for dir_ in clue.strip().s...
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 MAX_N = 10000; int T, n, x, y; long long sx, sy; int main() { cin >> n; sx = 0; sy = 0; for (int i = 1; i <= n; i++) { cin >> x >> y; sx += x; sy += y; } for (int i = 1; i <= n; i++) { cin >> x >> y; sx += x; sy += y; } cout...
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...
//package sol2; import java.io.*; import java.util.*; public class Solution { static long MOD = (long)1e9 + 7; public static void main(String[] args) throws IOException { FastInput fi = new FastInput(System.in); int n = fi.nextInt(); List<Pair<Integer, Integer>> coods = new ArrayList<>(n+1); 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...
n = int(input()) x = y = 0 for i in range(2 * n): line = input() line = line.split(" ") x += int(line[0]) y += int(line[1]) 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.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class B { public static void main(String[] args) throws IOException { BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(bfr.readLine()); 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 main() { int64_t n, a, b, tx = 0, ty = 0; cin >> n; for (int i = 0; i < 2 * n; i++) { cin >> a >> b; tx += a; ty += b; } cout << tx / n << " " << ty / 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()) xcoordi,ycoordi=[],[] for i in range(n): x,y=[int(x) for x in input().split()] xcoordi.append(x) ycoordi.append(y) A,B=[],[] for i in range(n): a,b=[int(x) for x in input().split()] A.append(a) B.append(b) if n==1: print(xcoordi[0]+A[0],ycoordi[0]+B[0]) else: di=...
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 MAX = 2e5 + 9; int main() { long long n, a, b; long long x = 0, y = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> a >> b; x += a; y += b; } for (int i = 0; i < n; i++) { cin >> a >> b; x += a; y += b; } cout << x / 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()) l,c=[],[] for _ in range(2*n): a , b = map(int,input().split()) if _ < n: l.append((a,b)) else: c.append((a,b)) l.sort() c.sort() ans = [] for i in range(n): ans.append( (l[i][0] + c[n-i-1][0] , l[i][1]+c[n-i-1][1]) ) ans.sort() print( *ans[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()) t1 = [[0]*2 for i in range(n)] t2 = [[0]*2 for i in range(n)] for i in range(n): a = list(map(int,input().split())) t1[i] = a for i in range(n): a = list(map(int,input().split())) t2[i] = a t1 = sorted(t1,reverse=True) t2 = sorted(t2,reverse=False) resultx = t1[0][0]+ t2[0][0] resulty...
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.io.OutputStream; import java.util.Arrays; import java.util.InputMismatchException; import java.io.IOException; import java.util.Comparator; import java.io.InputStream; /** * Built using CHelper...
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 SHINF = 1 << 15; const int INF = 1 << 30; const long long LINF = 1LL << 62; const int MAXN = 1010; int n, x[MAXN], y[MAXN], a[MAXN], b[MAXN]; bool used[MAXN]; void solve() { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { used[j] = false; ...
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*2): a, b = [int(i) for i in 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...
n = int(raw_input()) xs, ys = [], [] for i in xrange(n): (x, y) = map(int, raw_input().split()) xs.append(x) ys.append(y) xs.sort() ys.sort() dx, dy = [], [] for i in xrange(n): (x, y) = map(int, raw_input().split()) dx.append(x) dy.append(y) dx.sort(reverse=True) dy.sort(reverse=True) 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.awt.Point; import java.io.*; import java.util.*; public class B { static StringBuilder st = new StringBuilder() ; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); PrintWriter out = new PrintWriter(System.out); int n = sc.nextInt() ; Point [] p = 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 = 1e6 + 5; int n; struct data { int x, y; }; data a[N], c[N]; map<pair<int, int>, vector<int> > s; void Input() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i].x >> a[i].y; for (int i = 1; i <= n; i++) cin >> c[i].x >> c[i].y; } void Solve() { 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; int main() { long long n; long long x, y, sumx, sumy; long long m; cin >> n; sumx = 0; sumy = 0; m = n * 2; while (m--) { cin >> x >> y; sumx += x; sumy += y; } sumx /= n; sumy /= n; cout << sumx << " " << sumy; 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 main() { int n; cin >> n; long long sum1 = 0, sum2 = 0; for (int i = 0; i < 2 * n; ++i) { int a, b; cin >> a >> b; sum1 += a; sum2 += b; } cout << sum1 / n << " " << sum2 / n << endl; }
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.*; public class Main { static class tri implements Comparable<tri> { int value; int indx; int p; public tri(int cc, int s,int p2) { ...
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 B2018G { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long x = 0; long y = 0; for(int 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...
n=int(input()) ansx=0 ansy=0 for i in range(2*n): x,y=[int(a) for a in input().split()] ansx+=x ansy+=y print(ansx//n, ansy//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]*n y=[0]*n a,b=[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()) d=[] for i in range(n): d.append({}) for i in range(n): for j in range(n): d[i][(x[i]+a[j],y[i]+b[j])]=1 #print(d) f=0 for i in d[0]: ff= 1 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...
import itertools import random num_input = int(input()) obelisk = [] clue = [] # permutations = perm([i for i in range(num_input)]) # print(permutations) for i in range(0, num_input): x, y = list(map(int, input().split())) obelisk.append((x, y)) for i in range(0, num_input): x, y = list(map(int, input().s...
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 { public static void main(String[] args) throws Exception{ BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(f.readLine()); Pair[] c1 = new Pair[N]; Pair[] c2 = 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...
import java.util.*; import java.lang.*; public class Cf57 { public static void main(String args[]) { Scanner in = new Scanner(System.in); long n=in.nextLong(); int i,j,k; long t_x=0,t_y=0; for(i=0;i<2*n;i++) { long a,b; a=in.nextInt(); b=in.nextInt(); t_x=t_x+a; t_y=t_y+b; } System....
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; class coor { public: int x; int y; bool equ(coor p) { if (p.x == x && p.y == y) return 1; return 0; } }; int n; coor obelisk[1001], clue[1001], result[1001][1001]; bool tree(int len, coor m) { if (len == n) return 1; for (int i = 0; i < n; i++) { 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...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; pair<int, int> ob[1000]; pair<int, int> clues[1000]; for (int i = 0; i < n; i++) cin >> ob[i].first >> ob[i].second; for (int i = 0; i < n; i++) cin >> clues[i].first >> clues[i].second; map<pair<int, int>, int> mp; 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 = 1005; struct node { long long x, y; } s[maxn]; struct node1 { long long a, b; } t[maxn]; int main() { int n; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%lld%lld", &s[i].x, &s[i].y); scanf("%lld%lld", &t[i].a, &t[i].b); } lo...
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; map<pair<int, int>, int> map1, map2; vector<pair<int, int> > pos, clue; for (int i = 0; i < n; ++i) { int x, y; cin >> x >> y; pos.push_back(make_pair(x, y)); map1[make_pair(x, y)] = 1; map2[make_pair(x, y)] = -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; void solve() { long long n; cin >> n; vector<pair<long long, long long> > ob(n); vector<pair<long long, long long> > cl(n); for (long long i = 0; i < n; i++) { cin >> ob[i].first >> ob[i].second; } for (long long i = 0; i < n; i++) { cin >> cl[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...
d = {} n = int(input()) a = [] n2 = n n = 2*n for _ in range(n): b,c = map(int,input().split()) a.append((b,c)) for i in range(1,n): xsum = a[0][0] + a[i][0] ysum = a[0][1] + a[i][1] d = {} for j in range(1,n): try: d[a[j]] += 1 except: d[a[j]] = 1 d[a[i]] -= 1 flag = 0 # print(xsum,ysum) for j 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() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; int x, y, a, b, minx = 1e7, maxa = -1e7, miny = 1e7, maxb = -1e7; for (int i = 0; i < n; ++i) { cin >> x >> y; if (x < minx) minx = x; if (y < miny) miny = 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()) cd=[[0]*2 for x in range(n)] cl=[[0]*2 for x in range(n)] for i in range(n): cd[i]=list(map(int,input().split())) for i in range(n): cl[i]=list(map(int,input().split())) dp=[[0,0]*n for x in range(n)] dt=dict() flag=0 if n==1: print(cd[0][0]+cl[0][0],cd[0][1]+cl[0][1]) exit() 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...
n=int(input()) x,y,a,b=[],[],[],[] for i in range(n): z,w=map(int,input().split()) x.append(z) y.append(w) for i in range(n): z,w=map(int,input().split()) a.append(z) b.append(w) xd=[ i for i,j in sorted(zip(x,y))] yd=[ j for i,j in sorted(zip(x,y))] ad=[ i for i,j in sorted(zip(a,b))] bd=[ j 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...
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author shanky_ty */ public class Main { public static void main(String[] args) { 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...
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { if (b == 0) { return a; } return gcd(b, a % b); } long long triangle(long long x) { return (((long long)(x + 1)) * (x)) / 2; } pair<int, int> add(pair<int, int> x, pair<int, int> y) { return make_pair(x.first + y.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...
#include <bits/stdc++.h> using namespace std; long long int a[10005], b[10005]; int main() { long long int t, i; cin >> t; long long int sum1 = 0, sum2 = 0, ans1, ans2; for (i = 1; i <= 2 * t; i++) { cin >> a[i] >> b[i]; } for (i = 1; i <= 2 * t; i++) { sum1 = sum1 + a[i]; sum2 = sum2 + 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.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.*; import java.util.Stack; import java.util.Map.Entry; public class ROUGH { static 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...
def read_nums(): return [int(x) for x in input().split()] def main(): n, = read_nums() res = (0, 0) for _ in range(2*n): nums = read_nums() res = (res[0] + nums[0], res[1] + nums[1]) print(res[0] // n, res[1] // n) if __name__ == '__main__': 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...
import operator n = int(input()) obel = [] for i in range(n): x, y = map(int, input().split(" ")) obel.append((x, y)) vectors = [] for i in range(n): x, y = map(int, input().split(" ")) vectors.append((x, y)) coor = { } for (x, y) in obel: for (a, b) in vectors: maybe = (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...
#include <bits/stdc++.h> using namespace std; map<pair<int, int>, int> m; int main() { int n; cin >> n; vector<pair<int, int>> v; pair<int, int> p[1010]; for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; v.push_back({a, b}); } for (int i = 0; i < n; i++) { cin >> p[i].first >> p[i].se...
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): xi, yi = map(int, input().split()) x.append(xi) y.append(yi) for i in range(n): ai, bi = map(int, input().split()) a.append(ai) b.append(bi) pos_t = set() for i in range(n): pos_t.add((x[0] + a[i], y[0] + b[i])) for i in 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...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class cg { public static void main(String[] args) { in=new FastReader(); int n=ni(); pair[] obs=new pair[n]; for (int i=0;i<n;i++){ obs[i]=new pair(ni()...
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 INFF = 1000000000000000005LL; template <typename T> void scan(T &x) { x = 0; bool neg = 0; register T c = getchar(); if (c == '-') neg = 1, c = getchar(); while ((c < 48) || (c > 57)) c = getchar(); for (; c < 48 || c > 57; c = getchar()) ; 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...
import collections import itertools from functools import reduce mod = (10 ** 9) + 7 def permutationbysum(): for _ in range(int(input())): num, l, r, achieve = map(int, input().split()) k = r - l + 1 if (k * (k + 1)) // 2 <= achieve <= (k * (num * 2 + 1 - k)) // 2: outpos = (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...
sa=sb=0 n=int(input()) for _ 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...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.StringTokenizer; import java.util.StringJoiner; import java.util.stream.IntStream; import java.io.PrintWriter; //import java.util.Arrays; public class ...
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 derrick20 */ import java.io.*; import java.util.*; public class TreasureGeolocation { public static void main(String args[]) throws Exception { FastScanner sc = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int N = sc.nextInt(); ArrayList<Pair> p...
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.Arrays; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author ky112233 */ public class Main { public static void main(String[] arg...
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 i in range(n*2): 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...
t=int(input()) s,k=0,0 for i in range(2*t): j,l=map(int,input().split(" ")) s+=j k+=l print(s//t,k//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(input()) C=[list() for x in range(n)] D=[list() for x in range(n)] sumx=sumy=0 for x in range(n): C[x]=list(map(int,input().split())) for x in range(n): D[x]=list(map(int,input().split())) for x in range(n): sumx+=(C[x][0]+D[x][0]) sumy+=(C[x][1]+D[x][1]) print((sumx//n),(sumy//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> void seieve(); long long maxx(long long, long long); long long minn(long long, long long); using namespace std; const long long mod = 1000000007; const long long limits = (long long)1e18; long long primes[1000001] = {0}; int main() { ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(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.util.*; public class helloWorld { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int x = -10000000, y = -10000000; for(int i = 0; i < n; i++) { int a = in.nextInt(); int b = in.nextInt(); if(a > x || ( a == x && b > y)) { 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...
n = int(input()) a = [list(map(int, input().split())) for _ in range(n)] b = [list(map(int, input().split())) for _ in range(n)] x = sum(v[0] for v in a) + sum(v[0] for v in b) y = sum(v[1] for v in a) + sum(v[1] for v in 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...
n = int(input()) j = [] i = [] x = 0 while x < 2*n: x += 1 s = input().split() if x < n+1: j.append((int(s[0]), int(s[1]))) else: i.append((int(s[0]), int(s[1]))) a, b = max(j), min(i) print(a[0]+b[0], a[1]+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...
#include <bits/stdc++.h> using namespace std; inline int in() { int x, y; y = scanf("%d", &x); return x; } const int N = -1; int main() { int n = in(); long long xs = 0, ys = 0; for (int i = 0; i < 2 * n; i++) { xs += in(); ys += in(); } xs /= n; ys /= n; cout << xs << ' ' << ys << endl; 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...
n = int(input()) obs = [] for _ in range(n): x, y = map(int, input().split()) obs.append((x, y)) variants = set() for _ in range(n): a, b = map(int, input().split()) vars_1 = set() for x, y in obs: vars_1.add((a+x, b+y)) if variants == set(): variants = vars_1 else: v...
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(NULL); long long n; cin >> n; pair<long long, long long> a[n]; pair<long long, long long> b[n]; for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second; for (int i = 0; i < n; i++) cin >> b[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...
#include <bits/stdc++.h> using namespace std; const long long base = 1e7; struct point { long long x, y; void input() { scanf("%lld%lld", &x, &y); } } pt[2020], pk[2020], temp[2020], tempk[2020]; struct point operator+(point a, point b) { return point{a.x + b.x, a.y + b.y}; }; struct point operator-(point a, poin...
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 = 0, y = 0, x1, y1; cin >> n; for (long long i = 0; i < 2 * n; i++) { cin >> x1; cin >> y1; x = x + x1; y = y + y1; } 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...
t=int(input()) x,y=0,0 for _ in range(2*t): a,b=map(int,input().split()) x+=a y+=b print(x//t,y//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...
import java.io.*; import java.util.*; import static java.lang.Math.*; public class Main { public static void main(String[] args) throws IOException { Reader sc=new Reader(); //Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out,true); StringBuilder an...
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()) xs = ys = 0 for _ in range(2*n): xi, yi = [int(w) for w in input().split()] xs += xi ys += yi print(xs//n, ys//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(2) using namespace std; pair<int, int> a[1030], b[1030], c[1030]; int n; bool work(int tx, int ty) { for (int i = 1; i <= n; ++i) { c[i].first = tx - b[i].first; c[i].second = ty - b[i].second; } sort(c + 1, c + 1 + n); for (int i = 1; i <= n; ++i) if (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.*; import java.util.*; public class B { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int i,j,N; long sumx,sumy; sumx=sumy=0; N=Integer.parseInt(br.readLine().trim()); ...
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,maxY=float("-inf"),float("-inf") for i in range(n): x,y=map(int,input().split()) maxX=max(maxX,x) maxY=max(maxY,y) minA,minB=10**8,10**8 for i in range(n): a,b=map(int,input().split()) minA=min(a,minA) minB=min(b,minB) print(maxX+minA,maxY+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...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = in.nextInt(); long x = 0, y = 0; for (long i = 0; i < 2 * n; i++) { x += in.nextInt(); y += in.nextInt(); } 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...
''' CODED WITH LOVE BY SATYAM KUMAR ''' from sys import stdin, stdout import cProfile, math from collections import Counter from bisect import bisect_left,bisect,bisect_right import itertools from copy import deepcopy from fractions import Fraction import sys, threading import operator as op from functools import red...
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 FAST_IO(); int main() { long long int n, x, y; cin >> n; long long int minx = INT_MAX, miny, mx = -INT_MAX, my; for (long long int i = 0; i < n; i++) { cin >> x >> y; if (x < minx) { minx = x; miny = y; } else if (x == minx && y < miny) ...
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...
# # # y, b, r = map(int, input().split()) # # minn = min(y,b,r) # # if r == minn: # print(r+r-1+r-2) # # elif b == minn: # print(b+1+b+b-1) # # else: # if r >= y + 2: # print(y+y+1+y+2) # else: # print(y-1+y+y+1) # # # from collections import defaultdict n = int(input()) ob = [] 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...
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long x = 0; long y = 0; int n = scanner.nextInt(); int t = n * 2; while(t-- > 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; template <typename T> ostream& operator<<(ostream& os, vector<T>& v) { os << "["; for (int i = 0; i < v.size(); i++) { os << v[i]; if (i != v.size() - 1) os << ", "; } return os << "]\n"; } int main() { int n; cin >> n; pair<int, int> a[n], b[n]; 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; int N; struct P { int x; int y; }; P A[1001], B[1001]; bool cmp(P u, P v) { if (u.x == v.x) { if (u.y < v.y) return true; return false; } if (u.x < v.x) return true; return false; } int main() { cin >> N; for (int i = 1; i <= N; i++) cin >> A[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...
n=int(input()) if(n==1): x,y=map(int,input().split()) a,b=map(int,input().split()) print(x+a,y+b) else: l=[] ll=[] lll=0 llll=0 for i in range(n): l.append(list(map(int,input().split()))) for i in range(n): ll.append(list(map(int,input().split()))) for i in 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...
#include <bits/stdc++.h> using namespace std; int main() { long long int t, i, j, k, m, n, x, y; t = 1; while (t--) { long long int flag = 0; cin >> n; vector<pair<long long int, long long int> > v1, v2; for (i = 0; i < n; i++) { cin >> x >> y; v1.push_back({x, y}); } map<pair<...
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; cin >> n; long long a = 0, b = 0; for (int i = 0; i < 2 * n; i++) { cin >> x >> y; a += x; b += y; } cout << 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; int n; int main() { cin >> n; long long a = 0, b = 0; for (int i = 1; i <= n + n; 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...
#!/usr/bin/env python # coding: utf-8 # In[ ]: n=int(input()) # In[ ]: # In[ ]: obs=[] for i in range(n): obs.append(list(map(int, input().rstrip().split()))) # In[ ]: plus=[] for i in range(n): plus.append(list(map(int, input().rstrip().split()))) # In[ ]: obs.sort() # 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 collections import defaultdict N, Obelisk, MyDict = int(input()), [], defaultdict(int) for i in range(N): Obelisk.append(list(map(int, input().split()))) for i in range(N): Temp = list(map(int, input().split())) for j in range(N): Coordinate = Obelisk[j][0] + Temp[0], Obelisk[j][1] + Temp[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()) posx = [] clux = [] posy = [] cluy = [] for i in range(n): arr = [int(x) for x in input().split()] posx.append(arr[0]) posy.append(arr[1]) for i in range(n): arr = [int(x) for x in input().split()] clux.append(arr[0]) cluy.append(arr[1]) posx.sort() posy.sort() clux.sort() cluy...
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(2*n): temp = (input().split()) a += int(temp[0]) b += int(temp[1]) 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; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int64_t n, i, j, k, l, sum = 0, flag = 0, t, a[200005], ans = 0; vector<pair<int64_t, int64_t> > v, vv; void solve() { cin >> n; for (int64_t i = 0; i < n; i++) { cin >> j >> k; v.push_back({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...
import java.io.*; import java.util.*; public class CF1091B { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); boolean first = true; int x_ = 0, y_ = 0; 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...
import java.util.*; import java.io.*; public class P1091B { private static void solve() { int n = nextInt(); int[][] ob = new int[n][2]; Set<Pair> set = new HashSet<>(); for (int i = 0; i < n; i++) { ob[i][0] = nextInt(); ob[i][1] = nextInt(); } 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().strip()) obelisks = [] clues = [] for i in range(n): obelisks.append(tuple(map(int, input().strip().split()))) for i in range(n): clues.append(tuple(map(int, input().strip().split()))) obelisks.sort() clues.sort(reverse=True) print(obelisks[0][0]+clues[0][0], obelisks[0][1]+clues[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 main() { int n; long long x[1000], y[1000], a[1000], b[1000]; while (cin >> n) { for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; } for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } long long resx, resy; map<pair<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...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> a, b; for (int x = 0; x < n; x++) { int i, j; cin >> i >> j; a.push_back(make_pair(i, j)); } for (int x = 0; x < n; x++) { int i, j; cin >> i >> j; b.push_back(make_pair(i, j)); } s...
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 int MOD = 1000000007LL; long long int fastpow(long long int base, long long int exp) { long long int res = 1; while (exp > 0) { if (exp % 2 == 1) res = (res * base) % MOD; base = (base * base) % MOD; exp /= 2; } return res % MOD; } bool isprime...
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.lang.*; public class Rextester{ public static void main(String[] args)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = new Long(br.readLine()); long x = 0,y=0; for(int i=0;i<2*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...
import java.awt.*; import java.io.*; import java.util.*; public class TaskB { public static void main(String[] args) { new TaskB(System.in, System.out); } static class Solver implements Runnable { int n; Point[] pts, clues; // BufferedReader in; InputReader in; PrintWriter out; void solve() throws ...
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; cin >> n; long long m = 2 * n; long long suma = 0, sumb = 0; while (m--) { long long x, y; cin >> x >> y; suma += x; sumb += y; } cout << suma / n << " " << sumb / n << endl; }
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; long long X = 0, Y = 0; for (int i = 0; i < 2 * n; i++) { int x, y; cin >> x >> y; X += x; Y += y; } cout << X / n << " " << Y / n << endl; }
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; vector<pair<int, int> > vec1, vec2; int x, y, a, b, n; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> x >> y; vec1.push_back(make_pair(x, y)); } for (int i = 0; i < n; i++) { cin >> a >> b; vec2.push_back(make_pair(a, b)); } sort(vec...