akhauriyash/Code-Regression huggingface dataset:
// Aizu 0585: Nearest Two Points
// 2017.9.24 bal4u@uu

#include <stdio.h>

#define SIZE 500005
#define INF  0x7fffffff
#define abs(x)  ((x)>=0?(x):-(x))

typedef struct _PP {
	int x, y;
	struct _PP *next;
} PP;
PP  p[SIZE];
PP  tail_pp, *tail;
PP  top_pp, *top;
int size;

int min;
int pass;
PP  best1, best2;

PP *merge(PP *aa, PP *bb)
{
	PP *a, *b, *c;

	a = aa, b = bb, c = tail;
	if (pass == 1) {
		do {
			if (a->x <= b->x) { c->next = a, c = a, a = a->next; }
		    else              { c->next = b, c = b, b = b->next; }
		} while (c != tail);
	} else {
		do {
			if (a->y <= b->y) { c->next = a, c = a, a = a->next; }
            else              { c->next = b, c = b, b = b->next; }
		} while (c != tail);
	}
	c = tail->next;
	tail->next = tail;
	return c;
}

void check(PP p1, PP p2)
{
  int d;
  int dx, dy;

  if (p1.y != tail->y && p2.y != tail->y) {
    dx = p1.x - p2.x, dy = p1.y - p2.y;
    d = dx*dx + dy*dy;
    if (d < min) min = d, best1 = p1, best2 = p2;
  }
}
   
PP *closest(PP *c, int size)
{
	int i;
	PP  *a, *b;
	int mid;
	PP  p1, p2, p3, p4;
	int s2 = size/2;
	PP  *ans;

	if (c->next == tail) return c;
	a = c;
	for (i = 1; i < s2; i++) c = c->next;
	b = c->next; c->next = tail;
	if (pass == 2) mid = b->x;
	c = merge(closest(a, s2), closest(b, size-s2)); 
	ans = c;
	if (pass == 2) {
		a = c; p1 = p2 = p3 = p4 = *tail;
		do {
			if (abs(a->x - mid) < min) {
				check(*a, p1);
				check(*a, p2);
				check(*a, p3);
				check(*a, p4);
				p1 = p2, p2 = p3, p3 = p4, p4 = *a;
			}
			a = a->next;
		} while (a != tail);
	}
	return ans;
}

int main(void)
{
	PP *pp, *pp1, *stop;

	tail = &tail_pp;
	tail->x = tail->y = INF;
	top = &top_pp;
    scanf("%d", &size);
    for (pp = p, pp1 = p+1, stop = p+size; pp < stop; pp++, pp1++) {
	      scanf("%d%d", &(pp->x), &(pp->y));
		  pp->next = pp1;
    }
    p[size-1].next = tail;

    if (size == 2) {
		printf("%d\n", (p[0].x-p[1].x)*(p[0].x-p[1].x) + (p[0].y-p[1].y)*(p[0].y-p[1].y));
	} else {
	    min = INF;
		top->next = p;
	    pass = 1;
		top->next = closest(top->next, size);
		pass = 2;
		closest(top->next, size);
	    printf("%d\n", (best1.x-best2.x)*(best1.x-best2.x) + (best1.y-best2.y)*(best1.y-best2.y));
	}
	return 0;
}

Measured memory_bytes: 9496
#include <iostream>
#include <string>  
using namespace std;
int main(void){
    string b;
    cin>>b;
    if(b=="A"){cout<<"T";}
    else if(b=="T"){cout<<"A";}
    else if(b=="G"){cout<<"C";}
    else if(b=="C"){cout<<"G";}
    return 0;
}


Measured memory_bytes: 256
T=!!0
F=!T
[T,F].map{|c|
class<<c
alias:%:==
def!=x
!self|x
end
end
}
until/#/=~gets
puts (0..2047).all?{|x|
eval$_.tr"-=>*+abcdefghijk","!%=&|"+("%011b"%x).tr("01","TF")
}?'YES':'NO'
end

Measured memory_bytes: 13000
#include<iostream>
using namespace std;
int main()
{
  
  long long n,s=0;
  cin>>n;
  
  int l1=n/500;
  int l2=n%500;
  int l3=l2/5;
  
  cout<<l1*1000+l3*5;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    ll X;
    cin >> X;
    ll cnt = 100;
    ll ans = 0;
    while(cnt < X) {
        cnt += cnt / 100;
        ans++;
    }

    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main() 
{
  int A,B;
  cin>>A>>B;
  if (A>=10||B>=10)
  {
      cout<<-1<<endl;
  }
  else
  {
      cout<<A*B<<endl;
  }

  return 0;
}

Measured memory_bytes: 3632
from itertools import accumulate
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

# 解説見ちゃった...
def main():
    s = SI()
    t = SI()
    s = [0] + [x for x in accumulate([1 if c == "A" else 2 for c in s])]
    t = [0] + [x for x in accumulate([1 if c == "A" else 2 for c in t])]
    q = II()
    for _ in range(q):
        a, b, c, d = MI()
        if (s[b] - s[a - 1]) % 3 == (t[d] - t[c - 1]) % 3: print("YES")
        else: print("NO")

main()


Measured memory_bytes: 12372
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <set>
#include <utility>
#include <climits>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>

#define ll long long
#define ull unsigned long long
using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	int n;
	cin >> n;
	vector<int> cnt(n + 1);
	for (int i = 2, a; i <= n; ++i) {
		cin >> a;
		++cnt[a];
	}
	for (int i = 1; i <= n; ++i) {
		cout << cnt[i] << '\n';
	}
}

Measured memory_bytes: 3984
#include <bits/stdc++.h>
using namespace std;


int main() {
	int x1, y1, x2, y2;
	cin >> x1 >> y1 >> x2 >> y2;
	string ans = "";

	ans += string(x2 - x1, 'R');
	ans += string(y2 - y1, 'U');
	ans += string(x2 - x1, 'L');
	ans += string(y2 - y1, 'D');
	
	ans += 'L';
	ans += string(y2 - y1 + 1, 'U');
	ans += string(x2 - x1 + 1, 'R');
	ans += 'D';

	ans += 'R';
	ans += string(y2 - y1 + 1, 'D');
	ans += string(x2 - x1 + 1, 'L');
	ans += 'U';

	cout << ans << endl;
	return 0;

}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
static const long long INF = INT64_MAX;
static const long long MOD = (ll)1e9+7;

#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)

#define REP(i, n) for(ll i=0;i<n;i++)
#define EACH(a, v) for(auto &a:v)
#define SZ(v) (ll)((v).size())
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).begin(), (v).end())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate((v).begin(), (v).end(), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

void solve() {
    ll N;
    cin >> N;
    vll A(N);
    EACH(a, A) cin >> a;
    ll ans = 0;
    REP(i, N) {
        // 同値
        while(i + 1 < N && A[i] == A[i+1]) i++;
        // 増加
        if(i + 1 < N && A[i] < A[i+1]) {
            while(i + 1 < N && A[i] <= A[i+1]) {
                i++;
            }
        }
        // 減少
        else if(i + 1 < N && A[i] > A[i+1]) {
            while(i + 1 < N && A[i] >= A[i+1]) {
                i++;
            }
        }
        ans++;
      	debug(ans);
    }
    out(ans);
}

int main() {
    fast_io;
    solve();
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  
  if(s[5]=='0'){
    if(s[6]=='1' || s[6]=='2' || s[6]=='3' || s[6]=='4'){
      cout << "Heisei" << endl;
    }else{
      cout << "TBD" << endl;
    }
  }else{
    cout << "TBD" << endl;
  }
}

Measured memory_bytes: 256
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; cnt = 0; ansli = []; tmpli = []; candili = []; stillset = set()
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]#WideIntPoint
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]#HeightString
def mi(n): return [wi() for _ in range(n)]#MatrixInt
def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]#NumberGrid
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]

n = i()
a = wi()

minus = 0
plus = 0

a.sort()
for i in range(n):
    if a[i] >= 0:
        plus += 1
    elif a[i] < 0:
        minus += 1

if plus == 0:
    minus -= 1
    plus += 1
elif plus == n:
    minus += 1
    plus -= 1


mli = []
pli = []
for i in range(1, n + 1):
    if i <= minus:
        ans += -a[i - 1]
        mli.append(a[i - 1])
    else:
        ans += a[i - 1]
        pli.append(a[i - 1])

print(ans)
for i in range(n - 1):
    if i == 0:
        if plus == 1:
            print(pli[0], mli[0])
            tmp = pli[0] - mli[0]
        else:
            print(mli[0], pli[0])
            tmp = mli[0] - pli[0]
    elif i < plus - 1:
        print(tmp, pli[i])
        tmp = tmp - pli[i]
    elif i == plus - 1:
        print(pli[i], tmp)
        tmp = pli[i] - tmp
    else:
        print(tmp, mli[i - plus + 1])
        tmp = tmp - mli[i - plus + 1]

Measured memory_bytes: 16512
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    while(1){
        int h,w;
        cin>>h>>w;
        if(h ==0)break;
        
        for(int i = 0; i<h;i++){
            for(int j = 0; j<w;j++){
                cout<<"#";
            }
            cout<<endl;
            
        }
        cout<<endl;
        
    }
    return 0;
}


Measured memory_bytes: 3100
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    int N, Q;
    cin >> N >> Q;

    string S;
    cin >> S;

    vector<int> l(Q), r(Q);
    for (int i = 0; i < Q; i++) {
        cin >> l[i] >> r[i];
        l[i]--;
    }

    vector<int> AC;
    for (int i = 0; i < N - 1; i++) {
        if (S.substr(i, 2) == "AC") {
            AC.push_back(i);
        }
    }

    for (int i = 0; i < Q; i++) {
        cout << upper_bound(AC.begin(), AC.end(), r[i] - 2) - lower_bound(AC.begin(), AC.end(), l[i]) << endl;
    }

    return 0;
}

Measured memory_bytes: 2044
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    string s;
    cin >> s;
    rep(i, s.size()) {
        if ((i%2==0 && !(s[i] == 'R' || s[i] == 'U' || s[i] == 'D'))
            || (i%2==1 && !(s[i] == 'L' || s[i] == 'U' || s[i] == 'D'))) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;

#define trav(a, A) for (auto & a : A)
#define f first
#define s second

typedef long long ll;

const ll MOD = 1e+9+7;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const ll MAXN = 1e+5+7;

int main ()
{
	ios_base::sync_with_stdio (0);
	cin.tie (0);
	ll i, j, n;
	cin >> n;
	cout << (n/500)*1000 + 5*((n%500)/5) << '\n';

	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;

int main(){
  int N, Q;
  cin >> N >> Q;
  fenwick_tree<int64_t> fw(N);
  for(int i=0; i<N; i++){
    int x;
    cin >> x;
    fw.add(i,x);
  }
  for(int i=0; i<Q; i++){
    int a, b, c;
    cin >> a >> b >> c;
    if(a == 0){
      fw.add(b,c);
    }
    else{
      cout << fw.sum(b,c) << endl;
    }
  }
}

Measured memory_bytes: 8220
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif


using namespace std;

int main()
{
	long long int data[256];
	for (size_t i=0; i < 256; i++)data[i] = i*i;
	int a;

	while (1)
	{
		cin >> a;
		if (a == 0)
		{
			break;
		}
		int count = 0;
		for (size_t i = 0; i < 256&&data[i]<=a; i++)
		{
			for (size_t j = i; j < 256&&data[i]+data[j]<=a; j++)
			{
				for (size_t k = j; k < 256&&data[i]+data[j]+data[k]<=a; k++)
				{
					for (size_t l = k; l < 256; l++)
					{
						if (data[i] + data[j] + data[k] + data[l] == a)
						{
							count++;
						} else if (data[i] + data[j] + data[k] + data[l] > a)
						{
							break;
						}
					}
					
				}
				
			}
			
		}
		cout << count << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>

#define rep(i,n) for(int i=0;i<n;i++)
#define rp(i,c) rep(i,(c).size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=1<<28;
const int MX=1000;

int n,s[MX],t[MX],p[MX];
pair<int,pi> in[MX];
int dp[2][366][366];

int main()
{
	while(scanf("%d",&n),n)
	{
		rep(i,n)scanf("%d%d%d",&in[i].first,&in[i].second.first,&in[i].second.second);
		sort(in,in+n);
		rep(i,n)s[i]=in[i].first,t[i]=in[i].second.first,p[i]=in[i].second.second;
		
		rep(i,366)rep(j,366)dp[0][i][j]=0;
		
		int cur=0,next=1;
		rep(i,n)
		{
			rep(j,366)rep(k,366)dp[next][j][k]=dp[cur][j][k];
			rep(j,s[i])rep(k,366)
			{
				dp[next][t[i]][k]=max(dp[next][t[i]][k],dp[cur][j][k]+p[i]);
				dp[next][k][t[i]]=max(dp[next][k][t[i]],dp[cur][k][j]+p[i]);
			}
			swap(cur,next);
		}
		int ans=0;
		rep(i,366)rep(j,366)ans=max(ans,dp[cur][i][j]);
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 1944
x,y=map(int,input().split())

g1=[4,6,9,11]
g2=[1,3,5,7,8,10,12]

if x==y:
  print("Yes")
elif x in g1 and y in g1:
  print("Yes")
elif x in g2 and y in g2:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
# -*- coding: utf-8 -*-

import sys
import os
import math


dice = list(map(int, input().split()))
orders = input().strip()
for c in orders:
    copy = dice[:]
    if c == 'E':
        dice[2] = copy[0]
        dice[5] = copy[2]
        dice[3] = copy[5]
        dice[0] = copy[3]
    elif c == 'N':
        dice[0] = copy[1]
        dice[4] = copy[0]
        dice[5] = copy[4]
        dice[1] = copy[5]
        pass
    elif c == 'S':
        dice[1] = copy[0]
        dice[0] = copy[4]
        dice[4] = copy[5]
        dice[5] = copy[1]
    elif c == 'W':
        dice[0] = copy[2]
        dice[2] = copy[5]
        dice[5] = copy[3]
        dice[3] = copy[0]
print(dice[0])

Measured memory_bytes: 7792
N = int(input())
a = [input().split() for i in range(N)]
Set = {}
n = list(range(1,14))
Set['S'] = n.copy()
Set['H'] = n.copy()
Set['C'] = n.copy()
Set['D'] = n.copy()

for suit,num in a:
    Set[suit].remove(int(num))

for i in Set['S']:
    print("S {}".format(i))
for i in Set['H']:
    print("H {}".format(i))
for i in Set['C']:
    print("C {}".format(i))
for i in Set['D']:
    print("D {}".format(i))

Measured memory_bytes: 7724
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

class RMQ2{
public:
  int n,dat[1555555];
  void init(int _n){
    n=1;
    while(n<_n)n*=2;
    fill(dat,dat+2*n-1,-MAX);
  }
  void update(int k,int a){
    k+=n-1;dat[k]=a;
    while(k>0){
      k=(k-1)/2;
      dat[k]=max(dat[k*2+1],dat[k*2+2]);
    }
  }
  int query(int a,int b){return query(a,b,0,0,n);}
  int query(int a,int b,int k,int l,int r){
    if(r<=a||b<=l) return -MAX;
    if(a<=l&&r<=b) return dat[k];
    int vl=query(a,b,k*2+1,l,(l+r)/2);
    int vr=query(a,b,k*2+2,(l+r)/2,r);
    return max(vl,vr);
  }
};

RMQ2 t;

void Main() {
  ll n,m;
  cin >> n >> m;
  ll a[n];
  rep(i,n) R a[i];
  t.init(333333);
  rep(i,n) {
    ll x=max(0,t.query(max(0LL,a[i]-m),min(300000LL,a[i]+m)+1));
    t.update(a[i],x+1);
  }
  pr(t.query(0,333333));
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 10020
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>



#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))

using namespace std;
int a;

int main(){
  cin >> a;
  cout << a*(a+1)/2 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <cassert>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <limits>
#include <numeric>
#include <iterator>

using namespace std;



int main(){
  ios::sync_with_stdio(false);
  const int ub_a = 10000;
  int n;
  vector<int> a; // 1 .. 10000
  cin >> n;
  for(int i = 0; i<n; ++i){int a_i; cin >> a_i; a.push_back(a_i);}

  sort(a.begin(), a.end());

  //output
  for(int i=0; i<n; ++i){
    cout << (i==0?"":" ") << a[i];
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 11240
//  SMOKE SHISHA PLAY FIFA  // 
#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define mod 1000000007
#define lp(start,end) for(ll i=start;i<=end;i++) 
#define deb1(a) cout<<#a<<" = "<<(a)<<endl;
#define deb2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define deb3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;


ll modu(ll a, ll b)
{
	ll ans =1;
	while(b>0)
	{
		if(b&1)
		ans = (ans*a)%mod;
		b/=2;
		a = (a*a)%mod;
	}
	return ans;
}

int main()
{
	fastio
	ll n;
	cin >> n;
	if(n%1000==0)
		cout << "0" << endl;
	else
	{
		n= 1000 - n%1000;
		cout << n << endl;
	}
	return 0;	
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;

int main(){
  int a,b,ans=0;
  string s,t;
  cin >> s >>t;
  for(int i=0; i<3; i++){
    if(s.at(i)==t.at(i)){
    ans++;
    }
  }
    
  cout << ans << endl;
}

Measured memory_bytes: 256
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>
#include <cassert>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll conbinationMemo[100][100];

void cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
//-----------------------ここから-----------
int main(void){
    ll n, m, k;
    cin >> n >> m >> k;
    vector<ll> a(n), b(m);
    rep(i, n) cin >> a[i];
    rep(i, m) cin >> b[i];

    vector<ll> sa(n + 1, 0), sb(m + 1, 0);
    rep(i, n) sa[i + 1] = sa[i] + a[i];
    rep(i, m) sb[i + 1] = sb[i] + b[i];
    ll ans = 0;
    rep(i, n + 1){
        if(k - sa[i] < 0) break;
        auto itr = upper_bound(all(sb), k - sa[i]);
        itr--;
        ans = max(ans, (ll)(itr - sb.begin() + i));

    }
    cout << ans << endl;

}


Measured memory_bytes: 9588
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long int num,K;
 	 cin>>num>>K;

	vector<int> goods(num);
  for(int i=0;i<num;i++){
    cin>>goods.at(i);
  }
  sort(goods.begin(),goods.end());
  vector<int> numdiff(num);
  for(int i=0;i<num-1;i++){
    numdiff.at(i)=goods.at(i+1)-goods.at(i);
  }
  numdiff.at(num-1)=goods.at(num-1)-goods.at(num-2);
  vector<int> totalnum(num-K+1);
  for(int i=0;i<num-K+1;i++){
    int sum=0;
    for(int j=i;j<i+K-1;j++){
      sum+=numdiff.at(j);
    }
    totalnum.at(i)=sum;
  }
  sort(totalnum.begin(),totalnum.end());
  cout<<totalnum.at(0)<<endl;
}

Measured memory_bytes: 1408
#include <iostream>
#include <vector>

using namespace std;

bool check(int state, const vector<vector<int>>& s, const vector<int>& p) {
    for (int i = 0; i < s.size(); i++) {
        int on = 0;
        for (auto sw : s[i]) {
            if ((state >> (sw-1)) & 1) on++;
        }
        if (on % 2 != p[i]) return false;
    }
    return true;
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> s(m);
    for (int i = 0; i < m; i++) {
        int k;
        cin >> k;
        for (int j = 0; j < k; j++) {
            int tmp;
            cin >> tmp;
            s[i].push_back(tmp);
        }
    }
    vector<int> p(m);
    for (int i = 0; i < m; i++) {
        cin >> p[i];
    }
    int ans = 0;
    for (int state = 0; state < (1 << n); state++) {
        if (check(state, s, p)) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int l,r,n,ans;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>l>>r;
        ans+=r-l+1;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int T = sc.nextInt();
        
        double a = ((double)T + 0.5)/A;
        
        System.out.println((int)a*B);
    }
}


Measured memory_bytes: 22868
#include<stdio.h>
#include<math.h>
int main(){
  int i,n;
  double s,a,sum,powsum,ave;
  while(1){
    sum=0.0,powsum=0.0;
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%lf",&s);
      sum+=s;
      powsum+=s*s;
    }
    ave=sum/(double)n;
    a=pow((powsum/(double)n-ave*ave),0.5);
    printf("%f\n",a);
  }
  return 0;
}

Measured memory_bytes: 2932
#include <bits/stdc++.h>
#define range(i, l, r) for(long long int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (long long int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    if (v.size() == 0) return os << "]";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    os << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        os << ", " << *it;
    }
    return os << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    os << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        os << ", " << *it;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    os << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        os << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    os << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        os << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

lint pow(lint num, lint e, lint MOD) {
    lint res = 1;
    lint cur_num = num;
    while (e) {
        if (e & 1) {
            res *= cur_num;
            res %= MOD;
        }
        cur_num *= cur_num;
        cur_num %= MOD;
        e >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    lint A, B; cin >> A >> B;
    lint n = (B - 1) / (A - 1) + ((B - 1) % (A - 1) == 0 ? 0 : 1);
    cout << n << "\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

map<pair<long long, long long>, long long> mp;
long long func(long long b, long long n){
    if (b < 2 || n < 1) return 0;
    if (mp[{b, n}] != 0) return mp[{b, n}];
    if (b > n) return n;
    return func(b, n / b) + n % b;
}

int main(){
    long long n, s;
    cin >> n >> s;
    if (n == s) {
        cout << n + 1 << endl;
        exit(0);
    }
    for (int b = 2; b <= sqrt(n); b++){
        if (func(b, n) == s){
            cout << b << endl;
            exit(0);
        }
    }
    for (int p = (int)sqrt(n); p >= 1; p--){
        if ((n - s) % p == 0){
            if (func((n - s) / p + 1, n) == s){
                cout << (n - s) / p + 1 << endl;
                exit(0);
            }
        }
    }
    cout << - 1 << endl;
}

Measured memory_bytes: 59904
// 2020-08-24 14:48:56
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

void answer() {
  string s;
  cin >> s;
  int a = (s[0] == s[s.size()-1]);
  int b = s.size() % 2;
  string ans = "Second";
  if(a ^ b) ans = "First";
  cout << ans << '\n';
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 3780
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
  int N, M;
  cin >> N >> M;
  priority_queue<double> A;
  rep(i, N){
    int price;
    cin >> price;
    A.push(price);
  } 
  
  rep(i, M){
    int half = A.top();
    A.pop();
    half /= 2;
    A.push(half);
  }

  
  int64_t ans = 0;
  rep(i, N){
    double ans_floor = floor(A.top());
    ans += (int64_t)ans_floor;
    A.pop();
  }
  
  cout << ans << endl;

}

Measured memory_bytes: 1400
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int>P;

#define INF INT_MAX;
#define F first
#define S second

int n;
int a[100005][3];
int memo[100005][3];

int func(int now,int b){
  if(b!=-1&&memo[now][b]!=-1){
    return memo[now][b];
  }else if(now==n){
    return 0;
  }else{
    int ans=0;
    for(int i=0;i<3;i++){
      if(i!=b){
	ans=max(ans,func(now+1,i)+a[now][i]);
      }
    }
    memo[now][b]=ans;
    return ans;
  }
}

int main(){
  scanf("%d",&n);
  fill(memo[0],memo[n],-1);
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
      scanf("%d",&a[i][j]);
    }
  }

  printf("%d\n",func(0,-1));

  return 0;
}


Measured memory_bytes: 8832
#include<bits/stdc++.h>
using namespace std;
int n,m,mapp[55][55],x[8]={1,1,1,-1,-1,-1,0,0},y[8]={0,1,-1,0,1,-1,1,-1};
inline int bfs(int a,int b){
    int cnt=0;
    for(register int i=0;i<8;i++){
        int l=a+x[i];
        int ll=b+y[i];
        if(l>=1&&l<=n&&ll>=1&&ll<=m){
            if(mapp[l][ll]=='#') cnt++;
        }
    }
    return cnt;//
}
int main(){
    scanf("%d%d",&n,&m);
    for(register int i=1;i<=n;i++){
        for(register int j=1;j<=m;j++){
            scanf(" %c",&mapp[i][j]);
        }
    }
    for(register int i=1;i<=n;i++){
        for(register int j=1;j<=m;j++){
            if(mapp[i][j]=='#'){
                printf("#");
                continue;
            }
            printf("%d",bfs(i,j));
        }
        printf("\n");
    } 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;

long long gcd(long long a,long long b){
    if(b == 0){
        return a;
    }
    return gcd(b,a %b);
}
//2つの自然数の最大公約数を求める関数

long long lcm(long long a,long long b){
    return a*b/gcd(a,b);
}
//2つの自然数の最大公約数から最小公倍数を求める関数


int main() {
    long long a,b;
    long long c,d;
    cin>>a>>b>>c>>d;
    long long to_b_c = b/c;
    long long to_a_c = (a-1)/c;
    long long to_a_d = (a-1)/d;
    long long to_b_d = b/d;
    long long lcm_cd = lcm(c,d);
    long long to_a_cd = (a-1)/lcm_cd;
    long long to_b_cd = b/lcm_cd;
    long long can_divide_num = (to_b_c - to_a_c)+(to_b_d - to_a_d)-(to_b_cd - to_a_cd);
    long long ans = (b-(a-1))-can_divide_num;
    cout<<ans<<endl;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
m = []
sum_ = 0
for i in range(n-1):
    sum_ += (-1) ** (i+1) * a[i]
m.append((a[-1] - sum_)//2)
for i in range(1, n):
    m.append(a[i-1] - m[i-1])
print(' '.join(map(lambda k: str(k*2), m)))

Measured memory_bytes: 19148
import java.util.Scanner;

public class Main {
    void run() {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        int max = 0;
        int g = 0;
        for (int i = 0; i < n; i++) {
            int num = scan.nextInt();
            g = gcd(g, num);
            max = Math.max(max, num);
        }
//        System.out.println(g);
        if (k%g == 0 && max >= k)
            System.out.println("POSSIBLE");
        else
            System.out.println("IMPOSSIBLE");
    }
    
    int gcd(int a, int b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


Measured memory_bytes: 46240
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    x,n = LI()
    p = LI()
    s = set(p)

    for i in range(101):
        if x - i not in s:
            return x - i
        if x + i not in s:
            return x + i

    return -1


print(main())




Measured memory_bytes: 11024
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define mod 1000000007
#define N 13000005
using namespace std;

typedef long long ll;

ll n, dp[N];

ll fen[N];

void up(int x, int y){
	for(; x < N; x += x&-x)
		fen[x] = (fen[x] + y)%mod;
}

int qu(int x){
	ll top = 0;
	for(; x > 0; x -= x&-x)
		top = (top + fen[x])%mod;
	return top;
}

int main() {
	// freopen("in.txt", "r", stdin);
	// freopen("out.txt", "w", stdout);
	scanf("%lld",&n);
	dp[n] = n;
	up(n, n);
	for(int i = n + 1; i <= n+n; i++){
		dp[i] = 1;
		up(i, 1);
	}
	for(int i = n - 1; i >= 1; i--){
		dp[i] = (dp[i + 1])%mod;
		dp[i] = (dp[i] + qu(i + n + 1) - qu(i + 2) + mod)%mod;
		dp[i] = (dp[i] + (i + n + 1 - i - 2)*(n - 1)%mod)%mod;
		up(i, dp[i]);
		// for(int j = 2; j <= n; j++)
		// 	dp[i] = (dp[i] + dp[i + j + 1] + n - 1)%mod;
	}
	printf("%lld\n", dp[1]);
	return 0;
}

Measured memory_bytes: 41216
import java.io.*;
import java.util.*;

class Main{
    public static void main(String args[]){
                
        BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
        for(int i=0;i<3000;i++){
            try{
                String s=reader.readLine();
                StringTokenizer st = new StringTokenizer(s);
                
                String x=st.nextToken();
                String y=st.nextToken();
                
                int xn=Integer.parseInt(x);
                int yn=Integer.parseInt(y);
                
                if(xn==0&&yn==0){
                    break;
                }else if(xn>yn){
                    System.out.println(yn+" "+xn);
                }else{
                    System.out.println(xn+" "+yn);
                }
                
                
            }catch(IOException e){
                
            }

        }
    }
}

Measured memory_bytes: 26716
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define P pair<int,int>
using namespace std;
signed main(){
    string s;
    cin >> s;
    int n = s.size();
    vec(a,n);
    if(n == 2 && s[0] == s[1]){
        cout << "1 2" << endl;
        return 0;
    }
    REP(i,n-2){
        if(s[i] == s[i+1]){
            cout << i+1 << " " << i+3;
            return 0;
        }
        else if(s[i] == s[i+2]){
            cout << i+1 << " " << i+3;
            return 0;
        }
    }
    if(s[n-2] == s[n-1]){
        cout << n-2 << " " << n;
    }
    else{
        cout << "-1 -1" << endl;
    }
    return 0;
}


Measured memory_bytes: 1280
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>; 
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
constexpr long long LINF = 1001001001001001001;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main() {
   string a,b,c; cin >> a >> b >> c;
   cout << (char)toupper(a[0]) << (char)toupper(b[0]) << (char)toupper(c[0]) << ln;
}


Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;

#define INF (1<<31-1)

int main(){

	int A[3];

	cin >> A[0] >> A[1] >> A[2];

	int t, r=INF;
	for (int g = 0; g <= 50; g++){
		t = 0;
		for (int i = 0; i < 3; i++){
			if (A[i] > g) t += abs(A[i] - g);
			else{
				if (abs(A[i] - g) % 2 == 0)
					t += abs(A[i] - g) / 2;
				else
					t += (abs(A[i] - g) + 3) / 2;
			}
		}
		if (t < r)	r = t;
	}


	cout << r << endl;	

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i,n) for(ll i=0;i<(n);i++)
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<ll>>;
template<typename T=ll,typename U=ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
template<typename T> T chmax(T &a,T b) {return a=max(a,b);}
const ll INF = (ll)1e9;
const ll MOD = (ll)1e9+7;
void a();

class b{
    ll h,w;
    public:
    b(){
        cin >> h>>w;
        ll ans1 = (w+1)/2; 
        ll ans2 = w/2;
           ans1 = (h+1)/2*ans1;
           ans2 = h/2*ans2;
        cout << ans1+ans2;
    }
};

void c(){
    ll a,b,c;
    cin >> a >> b >> c;

    if((c-a-b)>0&&(4*a*b)<((c-a-b)*(c-a-b))){
        cout << "Yes";
    }else{
        cout << "No";
    }
}

int main(){
    c();
    return 0;
}

void a(){
    ll k;
    cin >> k;
    v<> s = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    cout << s[k-1];
    return;
}



Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main(){
  int i,max,kind,cont,cards[5],ume[13],j;
  while(scanf("%d,%d,%d,%d,%d",cards,cards+1,cards+2,cards+3,cards+4)!=EOF){
    max=kind=0;
    cont=13;
    for(i=0;i<13;i++) ume[i]=0;
    for(i=0;i<5;i++){
      if(ume[cards[i]-1]){
	ume[cards[i]-1]++;
	if(ume[cards[i]-1]>max) max=ume[cards[i]-1];
      }else{
	kind++;
	if(cont>(cards[i]-1))
	  cont=cards[i]-1;
	ume[cards[i]-1]++;
      }
    }
    //    printf("max:%d cont:%d kind:%d\n",max,cont,kind);
    if(max==4){
      printf("four card\n");
    }else if(max==3){
      printf("%s\n",kind==2?"full house":"three card");
    }else if(max==2){
      printf("%s\n",kind==3?"two pair":"one pair");
    }else{
      /*      for(i=0;i<13;i++) printf("%d ",ume[i]);
	      printf("\n");*/
      if(cont==0&&
	 (ume[0]&&ume[9]&&ume[10]&&ume[11]&&ume[12])){
	printf("straight\n");
	continue;
      }
      for(i=0;ume[(i+cont)%13];i++)
	;
      if(i==5){
	if(ume[0]){
	  if((ume[1]&&!ume[12])||(!ume[1]&&ume[12]))
	    printf("straight\n");
	  else printf("null\n");
	}else{
	  printf("straight\n");
	}
      }else{
	printf("null\n");
      }
    }
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
#define INF 1e18
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector < pair<int, int> > vii;
typedef long double ld;
typedef tree<pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	ll n;
	cin >> n;
	string s, s1;
	cout << 0 << endl;
	cin >> s;
	if(s=="Vacant"){
		return 0;
	}
	else{
		string s1 = s;
		cout << n-1 << endl;
		cin >> s;
		if(s=="Vacant"){
			return 0;
		}
		else{
			string s2 = s;
			int lo = 0, hi = n-1, mid;
			while(lo<=hi){
				mid=lo+(hi-lo)/2;
				cout << mid << endl;
				cin >> s;
				if(s=="Vacant"){
					return 0;
				}
				else{
					if(s==s1){
						if((mid-lo)%2==1){
							hi=mid;
							s2=s;
						}
						else{
							lo=mid;
							s1=s;
						}
					}
					else{
						if(s2==s){
							if((hi-mid)%2==1){
								lo=mid;
								s1=s;
							}
							else{
								hi=mid;
								s2=s;
							}
						}
						else{
							if((mid-lo)%2==0){
								hi=mid;
								s2=s;
							}
							else{
								lo=mid;
								s1=s;
							}
						}
					}
				}
			}
		}
	}
	
	return 0;
}


Measured memory_bytes: 852
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define PI 3.1415926535897932384626433
#define mod 1000000007
 
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
 
int lcm(int a, int b) { return a * b / gcd(a, b); }
 
int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    for (ll i = 0; i < n; i++){
        cin >> a[i];
        b[i] = a[i];
    }
    sort(a.begin(), a.end(), greater<int>());
    for (ll i = 0; i < n; i++){
        if(a[0] == b[i]){
            cout << a[1] << endl;
        }else{
            cout << a[0] << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 4736
#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n,k,q;
	while(cin>>n>>k>>q)
	{
		int arr[n],b[q];
		for(int i=0;i<n;i++)
			arr[i]=k;
		for(int i=0;i<q;i++)
		{
			cin>>b[i];
			arr[b[i]-1]++;
		}
		for(int i=0;i<n;i++)
		{
			arr[i]-=q;
			if(arr[i]>0)
				cout<<"Yes\n";
			else
				cout<<"No\n";
		}
	}
	return 0;
}

Measured memory_bytes: 1408
#if 0

#endif

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef complex<double> xy_t;
const double EPS = 1e-11;

double dot_product(xy_t a, xy_t b) {
  return (conj(a)*b).real();
}
double cross_product(xy_t a, xy_t b) {
  return (conj(a)*b).imag();
}
xy_t projection(xy_t p, xy_t b) {
  return b*dot_product(p,b)/norm(b);
}

double x[4], y[4];
int N;
int main() {
  cin >> N;
  for (int t=0; t<N; ++t) {
    for (int i=0; i<4; ++i)
      cin >> x[i] >> y[i];
      xy_t a[2] = {
        xy_t(x[0],y[0]) - xy_t(x[1],y[1]),
        xy_t(x[2],y[2]) - xy_t(x[3],y[3])
      };
      bool p = abs(cross_product(a[0], a[1])/2.0) < EPS;
      cout << (p ? "YES" : "NO") << endl;
  }
}



Measured memory_bytes: 3036
#define LEN 11
#include<cstdio>
#include<set>

typedef std::set<int> Set;

int main() {
    int N, d;
    Set set;
    scanf("%d", &N);
    while(N--) {
        scanf("%d", &d);
        set.insert(d);
    }
    printf("%d\n", set.size());
  //  scanf(" ");
    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    i=bisect_left(a,a[-1]//2)
    if i==n-1:
        print(a[-1],a[i-1])
    else:
        if min(a[i],a[-1]-a[i])>min(a[i-1],a[-1]-a[i]):
            print(a[-1],a[i])
        else:
            print(a[-1],a[i-1])
    

if __name__ == '__main__':
    main()


Measured memory_bytes: 62704
#include <bits/stdc++.h>

using namespace std;

int main(void)
{

  while(1){
    int n; cin >> n;

    vector<int> array(n, 0);
    if(n == 0) break;

    int sum = 0;
    for(int i = 0; i < n; i++){
      int input; cin >> input;
      array[i] = input;
    }
   
    sort(array.begin(), array.end() );

   
    for(int i = 1; i < n-1; i++){
      sum += array[i];
    }
    cout << sum/(n - 2)<< endl;
  }
  return 0;
}

Measured memory_bytes: 3156
#include <bits/stdc++.h>
using namespace std;
#define ll	    long long
#define vi      vector <ll>
#define vii     vector <pair<int,int>>
#define ii      pair<int,int>
#define loop(n)	for(int i=0;i<n;i++)
#define pb      push_back
const ll mod=1e9+7;
void fast();
int main()
{
    fast();
    int n,m;
    cin>>n>>m;
    priority_queue<int>q;
    loop(n){
        int x;
        cin>>x;
        q.push(x);
    }
    while(m--){
        int x=q.top();
        q.pop();
        q.push(x/2);
    }
    ll res=0;
    while(!q.empty())
        res+=q.top(),q.pop();
    cout<<res;
}
void fast(){
std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
/*

*/


Measured memory_bytes: 892
#include <bits/stdc++.h>
#include <chrono>
#include <math.h>
using namespace std;
#pragma GCC optimize("-O3")
#define endl "\n"
#define mp make_pair
#define st first
#define nd second
#define pii pair<int, int>
#define pb push_back
#define _upgrade ios_base::sync_with_stdio(0), cout.setf(ios::fixed), cout.precision(10), cin.tie(0), cout.tie(0);
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FWD(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define fwd(i, a, b) for (int i = (a); i < (b); ++i)
#define all(c) (c).begin(), (c).end()
#define sz(X) (int)((X).size())
#define what(x) cerr << #x << " is " << x << endl;

int32_t main()
{
    _upgrade;
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;

    int dif = m2 - m1 + (h2 - h1) * 60;
    cout << dif - k << endl;
}

Measured memory_bytes: 3640