akhauriyash/Code-Regression huggingface dataset:
/*
By Snickeen
*/
#include<bits/stdc++.h>
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <math.h>
#include <algorithm>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <string>
#include <vector>
#include <bitset>
#include <functional>
using namespace std;
typedef long long  LL;
typedef unsigned long long ULL;
typedef double db;
typedef long double ldb;
#define rep(i,a,b) for(i=a;i<b;i++)
#define repu(i,a,b) for(i=a;i<=b;i++)
#define repd(i,a,b) for(i=a;i>=b;i--)
#define repc(i,a,b,c) for(i=a;i<b;i+=c)
#define repcu(i,a,b,c) for(i=a;i<=b;i+=c)
#define repcd(i,a,b,c) for(i=a;i>=b;i-=c)
#define FIN freopen("input.in","r",stdin)
#define FOUT freopen("output.out","w",stdout)
#define CC(a) memset(a,0,sizeof(a))
#define MST(a,b) memset(a,b,sizeof(a))
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define VI vector<int>
#define VL vector<LL>
#define VII vector<PII >
#define VLL vector<PLL >
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define pf push_front
#define FF first
#define SS second

template<typename T>inline void gn(T &x){
	x=0;T f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
template<typename T>inline void gt(T x){
	if(!x)return;
	gt(x/10);putchar(x%10+'0');
}
 
const LL MAXN=2e6+10;
LL t,n,m,ans,tot;
LL MOD=1e9+7,inf=0x1f1f1f1f;
db eps=1e-5;

LL f[MAXN];

int main()
{
	//ios_base::sync_with_stdio(false);cin.tie(0);
	LL i,j,k,l,r,ca=0,u=0,v=0,w;
	LL mmax=0,maxsub=0,cnt=0;
	cin>>n>>m;
	repu(i,1,n)cin>>f[i];
	repd(i,n,1){
		if(f[i]>mmax)mmax=f[i];
		if(mmax-f[i]>maxsub){
			maxsub=mmax-f[i];
			cnt=1;
		}
		else if(mmax-f[i]==maxsub)cnt++;
		//printf("%I64d %I64d %I64d %I64d %I64d***\n",i,f[i],mmax,maxsub,cnt);
	}
	cout<<cnt<<endl;
	return 0;
}



Measured memory_bytes: 1024
void main() {
	auto ip = readAs!(int[]), N = ip[0], K = ip[1];
	
	double p = 0;
	foreach(i; 1..N+1) {
		auto j = ceil(log2(K) - log2(i));
		if(i >= K) j = 0;
		double tmp = 1./N * pow(1/2., j);
		p += tmp;
		//tmp.writeln;
	}
	writefln("%.10f", p);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int> 
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int a[105];
int n;
int main(){
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n;i++)
        if(a[i]%2==0){
            if(a[i]%3!=0 && a[i]%5!=0){
                cout<<"DENIED"<<endl;
                return 0;
            }
        }
    cout<<"APPROVED"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
typedef long long ll;

int n;  
string s;

int main() {
  cin >> s;
  char c[3]; int sum;
  for(int i=0;i<(1<<3);i++){
    sum=s[0]-'0';
    for(int j=0;j<3;j++){
      if(i&(1<<j)){
        sum+=s[j+1]-'0'; c[j]='+';
      }else{
        sum-=s[j+1]-'0'; c[j]='-';
      }
    }
    if(sum==7){
      cout << s[0] << c[0] << s[1] << c[1] << s[2] << c[2] << s[3] << "=7" << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
#define INF 0x3f3f3f3f
int n, m;
int a[55], b[55];
int map[55][55];
int vis[55];
void dfs(int u)
{
    vis[u] = 1;
    for(int i=1;i<=n;++i)
    {
        if(map[u][i] == 0)
            continue;
        if(vis[i] == 1)
            continue;
        dfs(i);
    }
}
int main()
{
    while(~scanf("%d%d", &n, &m))
    {
        memset(map,0,sizeof(map));
        for(int i = 0; i < m; ++i)
        {
            scanf("%d%d", &a[i], &b[i]);
            map[a[i]][b[i]] = map[b[i]][a[i]] = 1;
        }
        int sum = 0;
        for(int i=0;i<m;++i)
        {
            map[a[i]][b[i]] = map[b[i]][a[i]] = 0;
            for(int j = 1;j<=n;++j)
            {
                vis[j] = 0;
            }
            dfs(1);
            int bridge = 0;
            for(int j=1;j<=n;++j)
            {
                if(vis[j] == 0)
                {
                    bridge = 1;
                }
            }
            if(bridge)
                sum++;
            map[a[i]][b[i]] = map[b[i]][a[i]] = 1;
        }
        printf("%d\n",sum);
    }
}

Measured memory_bytes: 384
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N = ini()


def solve():
    k = 26
    a = 0
    l = 1
    while a + k < N:
        a += k
        k *= 26
        l += 1
    m = N - a - 1
    s = [None] * l
    for i in range(l):
        d = m % 26
        s[i] = chr(ord("a") + d)
        m //= 26
    return "".join(reversed(s))


print(solve())


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

int charToInt(char c){
    char zero_num = '0';
    return (int)c - (int)zero_num;
}

signed main(){
    vec_int x(5);
    rep(i,5){
        cin>>x.at(i);
        if(x.at(i)==0){
            cout<<i+1<<endl;
            return 0;
        }

    }

    return 0;
}

Measured memory_bytes: 3628
// #pragma GCC optimize("O3", "unroll-loops")
// #pragma GCC target("avx2")

#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;

typedef long long int ll;
#define endl '\n'
#define ld long double
#define all(a) a.begin(),a.end()
#define int long long
#define pb push_back
#define pii pair <int, int>
#define ff first
#define ss second
#define sz(v) (int)v.size() 
#define UB upper_bound
#define LB lower_bound
#define OST tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update>

const int INF = 1e15 + 0;
const int mod = 1e9 + 7;
//const int mod = 998244353;

int C(int n) {
    return (n*(n+1))/2;
}

void solve() {
    int n, k; cin >> n >> k;
    int ans = 0;
    for(int i = k; i <= n+1; i++) {
        int s = C(i-1) % mod;
        int b = C(n)-C(n-i);
        b %= mod;
        ans += (b-s+mod+1LL);
        ans %= mod;
    }
    cout << ans << '\n';
}

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    // #ifndef ONLINE_JUDGE
    //   freopen("input.txt", "r", stdin);
    //   //freopen("output.txt", "w", stdout);
    // #endif
    int t = 1; // cin >> t;
    for(int i = 1; i <= t; i++) {
        solve();
    }
}


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

int main() {
  int K,N;
  cin>>K>>N;
  vector<int> site(N);
  for(int i=0; i<N;i++){
    cin>>site.at(i);
  }
  vector<int> X(N);
  for(int i=0; i<N-1; i++){
    X.at(i)=site.at(i+1)-site.at(i);
  }
  X.at(N-1)=K-site.at(N-1)+site.at(0);
   sort(X.begin(),X.end());
   cout<<K-X.at(N-1)<< endl;
  
}


Measured memory_bytes: 1792
#include<iostream>

using namespace std;

int main(){
  int  N[100];
  int n,i;

  cin >> n;
  for(i=0; i<n; i++){
    cin >> N[i];
  }
  for(; i>1; i--){
    cout << N[i-1] << " ";
  }
  cout << N[i-1] <<endl;
}

Measured memory_bytes: 1164
import sys, collections

def solve():
    file = sys.stdin.readline
    N = int(file())
    mindig = collections.defaultdict(int)
    nim = 0
    for i in range(N):
        a = int(file())
        nim ^= a
        mindig[a^(a-1)] += 1
    if nim == 0: print(0)
    else:
        nim = format(nim, "b").zfill(30)
        flip = 0
        for i in range(30):
            if int(nim[i]) != flip % 2:
                if mindig[pow(2, 30-i) - 1] == 0:
                    print(-1)
                    break
                else: flip += 1
        else: print(flip)
    return 

if __name__ == "__main__":
    solve()

Measured memory_bytes: 3316
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cmath>
#include <queue>
#include <sstream>
#include <string.h>
#include <bitset>
#include <stack>

using namespace std;
typedef long long ll;

vector<vector<pair<int, int>>> vec;
vector<bool> visited;

void dfs(int v) {
  visited[v] = true;
  for (int i = 0; i < vec[v].size(); i++) {
    int u = vec[v][i].first;
    if (visited[u]) continue;
    dfs(u);
  }
}

int main(int argc, const char * argv[]) {
  int N, M;
  cin >> N >> M;
  vec.resize(N);
  visited.resize(N, false);
  for (int i = 0; i < M; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    x--; y--;
    vec[x].push_back({y, z});
    vec[y].push_back({x, z});
  }
  
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (!visited[i]) {
      ans++;
      dfs(i);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 8832
#include <stdio.h>
 
int main(void){ 
    long L,R,n,m;
    scanf("%ld %ld",&L,&R);
    for(long i=L;i<=R;i++){
        if((i%2019)==0){
            printf("0");
            return 0;
        }
    }
    n=(L*R)%2019;
    for(long i=L;i<R;i++){
        for(long j=i+1;j<=R;j++){
            m=(i*j)%2019;
            if(m<n){
                n=m;
            }
            if(n==1) break;
        }
    }
    printf("%ld",n);
    return 0;
}

Measured memory_bytes: 128
#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() {
    int a;
    cin >> a;

    cout << a + a * a + a * a * a << endl;
}

Measured memory_bytes: 3632
package main

import "fmt"

const maxn = 1e5 + 5

var (
	sto [maxn]int
	gra [105][105]int
)

func main() {
	var h, w int
	fmt.Scanf("%d %d\n", &h, &w)
	var n int
	fmt.Scanf("%d\n", &n)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d", &sto[i])
	}
	cnt := 1
	for i := 1; i <= h; i++ {
		if i%2 == 0 {
			for j := 1; j <= w; j++ {
				if sto[cnt] > 0 {
					gra[i][j] = cnt
					sto[cnt]--
				} else if sto[cnt] == 0 {
					cnt++
					gra[i][j] = cnt
					sto[cnt]--
				}
			}
		} else {
			for j := w; j >= 1; j-- {
				if sto[cnt] > 0 {
					gra[i][j] = cnt
					sto[cnt]--
				} else if sto[cnt] == 0 {
					cnt++
					gra[i][j] = cnt
					sto[cnt]--
				}
			}
		}
	}
	for i := 1; i <= h; i++ {
		for j := 1; j <= w; j++ {
			if j != w {
				fmt.Printf("%d ", gra[i][j])
			} else {
				fmt.Printf("%d\n", gra[i][j])
			}
		}
	}
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define Task ""

using namespace std;
typedef long long ll;

const int maxn = 1 << 18;

bool testbit(int x, int n)
{
    return x >> n & 1;
}

int addbit(int x, int n)
{
    return x + (1 << n);
}

pair<int, int> S[maxn];
int a[maxn], N;
ll f[maxn];

void merges(pair<int, int> & a, pair<int, int> b)
{
    if (a.fi < b.fi) a.se = max(a.se, a.fi), a.fi = b.fi;
    else a.se = max(a.se, b.fi);
}

signed main(void)
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    if (fopen("A.INP", "r")){
        freopen("A.INP", "r", stdin);
        freopen("A.OUT", "w", stdout);
    }
    if (fopen(Task".INP", "r")){
        freopen(Task".INP", "r", stdin);
        freopen(Task".OUT", "w", stdout);
    }
    cin >> N;
    for (int i=0; i<(1<<N); ++i){
        cin >> a[i];
        S[i] = mp(a[i], -1e9);
    }
    for (int j=0; j<N; ++j){
        for (int i=0; i<(1<<N); ++i){
            if (testbit(i, j)){
                int nxt = i - (1 << j);
                merges(S[i], S[nxt]);
            }
        }
    }
    for (int i=0; i<(1<<N); ++i){
        f[i] = S[i].fi + S[i].se;
        f[i] = max(f[i], f[i-1]);
        if (i) cout << f[i] << '\n';
    }
}


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

#define int long double
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(),container.end()

#define fast ios::sync_with_stdio(0); cin.tie(0)
#define print(...) __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1> void __f(const char* name, Arg1&& arg1){
    cout << name << ": " << arg1 << '\n';
}

template <typename Arg1, typename... Args> void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

int32_t main(){
    
    fast;
    int n; cin >> n;
    int prod = 1;

    vector<int> vec;

    for(int i=0;i<n;i++){
        int x; cin >> x;
        vec.pb(x);
        prod*=x;
    }

    int num = prod;
    int deno = 0;

    for(int i=0;i<n;i++){
        deno+=(prod/vec[i]);
    }
    
    int ans = num/deno;

    cout << ans;
 
    return 0;
}   

Measured memory_bytes: 256
#include <stdio.h>
 #include <string.h>
int main(void) {
    int n,i,c,k,prime[999999] = {0},t;
    for(i = 2; 999999 >= i; i++){
        if(!prime[i])
    		for(c = i*2; 999999 >= c; c += i)prime[c] = 1;
    }
    while(scanf("%d",&n) != EOF){
    	i = 0;
    for(c = 2; n >= c; c++){
        	if(!prime[c]) i++;
        }
    printf("%d\n",i);
    }
     
    return 0;
}

Measured memory_bytes: 4940
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T&v)
{fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0; return gcd(a, b, x, y);}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
ll n, c, m[3][30], d[30][30];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> c;
  FOR(i, 0, c) FOR(j, 0, c) cin >> d[i][j];
  FOR(i, 0, n) FOR(j, 0, n){
    ll t;
    cin >> t;
    m[(i+j)%3][t-1]++;
  }
  ll ans = linf;
  FOR(i, 0, c){
    ll c0 = 0;
    FOR(h, 0, c) c0 += d[h][i] * m[0][h];
    FOR(j, 0, c){
      if(i == j) continue;
      ll c1 = 0;
      FOR(h, 0, c) c1 += d[h][j] * m[1][h];
      FOR(k, 0, c){
        if(i == k) continue;
        if(j == k) continue;
        ll c2 = 0;
        FOR(h, 0, c) c2 += d[h][k] * m[2][h];
        mins(ans, c0 + c1 + c2);
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
class dice:
    def __init__(self,dice):
        self.dice = dice

    def roll_n(self):
        d = self.dice
        self.dice = [d[1],d[5],d[2],d[3],d[0],d[4]]

    def roll_e(self):
        d = self.dice
        self.dice = [d[3],d[1],d[0],d[5],d[4],d[2]]

    def roll_s(self):
        d = self.dice
        self.dice = [d[4],d[0],d[2],d[3],d[5],d[1]]
    
    def roll_w(self):
        d = self.dice
        self.dice = [d[2],d[1],d[5],d[0],d[4],d[3]]

    def top(self):
        return self.dice[0]

    def roll(self,command):
        if command=='N':self.roll_n()
        if command=='E':self.roll_e()
        if command=='S':self.roll_s()
        if command=='W':self.roll_w()

def main():
    com1 = 'SSSWSSS'
    com2 = 'WWWW'
    d = dice(list(map(int,input().split())))
    q = int(input())
    for _ in range(q):
        a,b = map(int,input().split())
        for c in com1:
            if b==d.dice[1]:break
            d.roll(c)
        for c in com2:
            if a==d.dice[0]:print (d.dice[2])
            d.roll(c)

if __name__ == '__main__':
    main()




Measured memory_bytes: 5608
import numpy as np
import math

n, d = map(int, input().strip().split())
points = np.array([list(map(int, input().strip().split())) for _ in range(n)])


def is_square(num):
    root = int(math.sqrt(num))
    return root ** 2 == num

counts = 0
for i in range(n):
    for j in range(i + 1, n):
        pi = points[i]
        pj = points[j]
        d2 = np.sum((pi - pj) ** 2)
        if is_square(d2):
            counts += 1

print(counts)


Measured memory_bytes: 12440
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    dead_code
)]
use proconio::input;
//use proconio::marker::Usize1;
//use proconio::marker::Chars;
//use std::collections::HashSet;
//use std::cmp::*;
fn main() {
    input! {
        mut x:u64
    }
    let mut y = 100;
    let mut ans = 0;
    while y < x {
        // if (ans > 3588) {
        //     println!("y={} ans={}", y, ans);
        // }
        y = y / 100 + y;
        ans = ans + 1;
    }
    println!("{}", ans);
}


Measured memory_bytes: 2100
import math

N, D = map(int, input().split())
X = []
Y = []
ans = 0

for i in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
    
    l = math.sqrt(x**2+y**2)
    if l <= D:
        ans += 1

print(ans)

Measured memory_bytes: 24912
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

//Code Short
#define REP(i,n) for(int i = 0;i < n;++i)
#define PB(s) push_back(s)
#define DSORT(n) sort(n.begin(),n.end())
#define QECHO(n) cout << n
#define QECHOS(n) cout << n << " "

//Define Math
const double EPS = 1e-10;
const double PI  = acos(-1.0);

using namespace std;
typedef long long ll;
/* prototype */
int EDSum(ll);//各桁の和
vector<int> SOE(int,int);//素数 (Min,Max)
int MinCM(int,int);//最小公倍数(num1,num2)
int MaxCD(int,int);//最大公約数(num1,num2)
vector<int> igets(int);//cin * N
ll nPr(ll,ll); //(n,r)
ll nE(ll); //(n)
ll nCr(ll,ll); //(n,r)

void solve(){
    //START
    string a,b;
    cin >> a >> b;
    if(a<b)cout << "<" << endl;
    else if(a>b)cout << ">" << endl;
    else cout << "=" << endl;
}

int main(void){cin.tie(0);ios::sync_with_stdio(false);solve();}
int EDSum(ll number) {
  int ans = 0;
  while (1) {
    ans += number % 10;
    number /= 10;
    if (number == 0) break;
  }
  return ans;
}

vector < int > SOE(int min, int max) {
  if (min < 2) min = 2;
  vector < int > int_array;
  for (int i = min; i <= max; i++) int_array.push_back(i);
  vector < int > sosu;
  double stop = sqrt(max);
  while (true) {
    sosu.push_back(int_array.front());
    int_array.erase(int_array.begin());
    if (stop < (double)(sosu.back())) break;
    for (int i = 0; i < (int) int_array.size(); i++) {
      if (int_array[i] % sosu.back() == 0)
        int_array.erase(int_array.begin() + i);
    }
  }
  sosu.insert(sosu.end(), int_array.begin(), int_array.end());
  return sosu;
}

int MinCM(int a, int b) {
  int c = a * b;
  if (a < b)
    swap(a, b);
  int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return c / b;
}

int MaxCD(int a, int b) {
  if (a < b)
    swap(a, b);
  int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
vector < int > igets(int N) {
  vector < int > A;
  int temp;
  for (int i = 0; i < N; ++i) {
    cin >> temp;
    A.push_back(temp);
  }
  return A;
}

ll nPr(ll n, ll r) {
  ll ans = 1;
  r = n - r;
  while (n != r) {
    ans *= n;
    --n;
  }
  return ans;
}

ll nE(ll n) {
  return nPr(n, n);
}

ll nCr(ll n, ll r) {
  if (r == 0) return -1;
  else {
    if (0 != n - r && n - r < r) r = n - r;
    return nPr(n, r) / nE(r);
  }
}

Measured memory_bytes: 256
n, k = map(int, input().split())
mp1 = [[0] * k for _ in range(k)]
mp2 = [[0] * k for _ in range(k)]
for _ in range(n):
  x, y, c = input().split()
  t = int(x) // k + int(y) // k
  x = int(x) % k
  y = int(y) % k
  if c == "B":
    t += 1
  if t % 2:
    mp1[y][x] += 1
  else:
    mp2[y][x] += 1

for x in range(1, k):
  mp1[0][x] += mp1[0][x - 1]
  mp2[0][x] += mp2[0][x - 1]

for y in range(1, k):
  acc1 = 0
  acc2 = 0
  for x in range(k):
    acc1 += mp1[y][x]
    mp1[y][x] = acc1 + mp1[y - 1][x]
    acc2 += mp2[y][x]
    mp2[y][x] = acc2 + mp2[y - 1][x]

ans = 0
sum1 = mp1[k - 1][k - 1]
sum2 = mp2[k - 1][k - 1]
mp1k = mp1[k - 1]
mp2k = mp2[k - 1]
for y in range(k):
  mp1y = mp1[y]
  mp1yk = mp1y[k - 1]
  mp2y = mp2[y]
  mp2yk = mp2y[k - 1]
  for x in range(k):
    mp1yx = mp1y[x]
    mp2yx = mp2y[x]
    mp1kx = mp1k[x]
    mp2kx = mp2k[x]

    ans = max(ans, 2 * mp1yx + sum1 - mp1yk - mp1kx + mp2kx + mp2yk - 2 * mp2yx)
    ans = max(ans, 2 * mp2yx + sum2 - mp2yk - mp2kx + mp1kx + mp1yk - 2 * mp1yx)

print(ans)

Measured memory_bytes: 65368
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

bitset<4000010> dp("1");

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int sum = accumulate(ALL(a), 0);
    for(int i = 0; i < n; i++) {
        dp |= (dp << a[i]);
    }
    for(int i = (sum + 1) / 2; i <= sum; i++) {
        if(dp[i]) {
            cout << i << endl;
            return 0;
        }
    }
}

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

// Loops
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define _rrep(i, n) rrepi(i, n, 0)
#define rrepi(i, a, b) for (int i = int(a) - 1; i >= int(b); --i)

#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(xi, x) for (auto &&xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)

// typedef
template <class T> using vec = vector<T>;
using ll = long long;
using vi = vec<ll>;
using vvi = vec<vi>;
using vvvi = vec<vvi>;
using pii = pair<ll, ll>;

// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define mp make_pair

// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase(unique(all(v)), v.end())
#define perm(c)                                                                \
  sort(all(c));                                                                \
  for (bool c##p = 1; c##p; c##p = next_permutation(all(c)))

template <class T> pair<T, size_t> max(vector<T> &x) {
  auto it = max_element(all(x));
  return mp(*it, it - x.begin());
}
template <class T> pair<T, size_t> min(vector<T> &x) {
  auto it = min_element(all(x));
  return mp(*it, it - x.begin());
}

template <class T> inline bool chmax(T &maxval, const T &newval) {
  if (maxval < newval) {
    maxval = newval;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &minval, const T &newval) {
  if (minval > newval) {
    minval = newval;
    return 1;
  }
  return 0;
}

// Utilities
// Grid world utilities
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
#define inside(H, W, y, x) 0 <= (x) && (x) < (W) && 0 <= (y) && (y) < (H)

// Debug
#ifdef LOCAL
#include "dump.hpp"
#define debug(x) cerr << #x << ": " << x << '\n'
#else
#define dump(...)
#define debug(x)
#endif

// Paste snippets here!!

//

void solve(long long A, long long B, long long C) {
  bool kawaisou = false;
  if(A==B && B!=C) kawaisou = true;
  if(A==C && C!=B) kawaisou = true;
  if(C==B && A!=C) kawaisou = true;
  if(kawaisou) cout << "Yes" << endl;
  else cout <<"No"<<endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false); // Magic for faster cin
  cout.precision(12);
  long long A;
  std::cin >> A;
  long long B;
  std::cin >> B;
  long long C;
  std::cin >> C;
  solve(A, B, C);
  return 0;
}


Measured memory_bytes: 3508
import sys
import queue

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

class node:
	def __init__(self,a_val, a_parent=None):
		self.val=a_val
		self.parent=a_parent
		self.right=None
		self.left=None

def main2():
	n, m = IN()
	vl=[]
	for n in range(n):
		a,b = IN()
		vl.append((a,b))
		
	vl.sort(key=lambda x:-x[1])
	ret = 0
	nwdl=[-1]*(m+1) #list(range(m+1))
	for a, b in vl:
		j=m-a
		while j >= 0:
			if nwdl[j]==-1:
				nwdl[j]=0
				ret+=b
				break
			j-=1
		#pa((a,b,m-a,nwdl))
	print(ret)
	
	
def main():
	n, m = IN()
	st_day=[[] for _ in range(m+1)]
	for n in range(n):
		duration, pay = IN()
		if duration > m:
			continue
		st_day[m-duration].append(pay)
	
	pq=queue.PriorityQueue()
	ret = 0
	for di in range(m+1):
		day=m-di
		for pay in st_day[day]:
			pq.put(-pay)
		if not pq.empty():
			v = pq.get()
			ret -= v
	print(ret)
			
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 24732
let dbg = Printf.printf "[debug]%s"

let id = fun x -> x
let tuple2 x y = (x,y)

let (++) n m =
  let rec aux i =
    if i = m then [m]
    else i :: aux (i+1) in
  if n > m then [] else aux n

let (++^) n m = n ++ (m-1)

let scanf fmt f = Scanf.sscanf (read_line ()) fmt f

let scanfs n fmt f =
  List.map (fun _ -> scanf fmt f) (0++^n)

let scan_array n conv =
  let b = Scanf.Scanning.from_string @@ read_line () in
  Array.init n (fun _ -> Scanf.bscanf b " %s" conv)

let scan_matrix n m e conv =
  let arr = Array.make_matrix n m e in
  Array.iteri (fun i line ->
      let s = Scanf.Scanning.from_string @@ read_line () in
      Array.iteri (fun j _ ->
          arr.(i).(j) <- Scanf.bscanf s " %s" conv;
        ) line) arr; arr

let between n x m = n <= x && x < m

let (n,m) = scanf "%d %d" tuple2
let coins = scan_array m int_of_string

let () =
  let memo = Array.make_matrix (m+1) (n+1) max_int in
  memo.(0).(0) <- 0;
  List.iter (fun i ->
      let c = coins.(i-1) in
      List.iter (fun j ->
          memo.(i).(j) <-
            if j -c >= 0 then
              let x = if memo.(i-1).(j-c) <> max_int
                then memo.(i-1).(j-c) + 1 else max_int in
              let y = if memo.(i).(j-c) <> max_int
                then memo.(i).(j-c) + 1 else max_int in
              min memo.(i-1).(j) @@ min x y
            else
              memo.(i-1).(j)
        ) (0++n)
    ) (1++m);
  Printf.printf "%d\n" memo.(m).(n)



Measured memory_bytes: 20212
#include<bits/stdc++.h>
using namespace std;
/*------- Constants---- */

#define LL                      long long
#define Ulong                   unsigned long long
#define REP(i,n)                for(long long i=0; i < n ; i++ )
#define mp                      make_pair
#define pb                      push_back
#define all(x)                  (x).begin(),(x).end()
#define PI                      acos(-1.0)
#define EPS                     1e-14
#define F                       first
#define S                       second
#define di(x)                   int x; input(x)
#define in(x)                   input(x)
#define in2(x,y)                in(x),in(y)
#define in3(x,y,z)              in(x),in2(y,z)
#define lc                      ((n)<<1)
#define rc                      ((n)<<1|1)
#define db(x)                   cout << #x << " -> " << x << endl
#define nl                      cout<<endl
#define ms(ara_name,value)      memset(ara_name,value,sizeof(ara_name))
#define IO                      ios_base::sync_with_stdio(0);cin.tie(0)
#define READ                    freopen("/home/matrixcode/Desktop/in.txt","r",stdin)
#define WRITE                   freopen("out.txt","w",stdout)
template<class T> inline void input(T &x) {
  register char c = getchar();x = 0;
  int neg = 0;
  for(; ((c<48 || c>57) && c != '-'); c = getchar());
  if(c=='-'){neg = 1;c = getchar();}
  for(; c>47 && c<58 ; c = getchar()){x = (x<<1) + (x<<3) + c - 48;}
  if(neg) x = -x;
}
inline long long bigmod(long long p,long long e,long long M){
  long long ret = 1;
  for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  } return ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}

/***************************** END OF TEMPLATE *******************************/

const int N = 3e5+5;
int a[N];
int dp[N];
int main()
{
  int n,k;
  in2(n,k);
  for(int i = 1; i <= n; i ++) in(a[i]);
  dp[0] = 0;
  for(int i= 1; i <= k; i ++) {
    dp[i] = 0;
    for(int j = 1; j <= n; j ++) {
      if(i >= a[j] && dp[i - a[j]] == 0) {
        dp[i] = 1;
      }
    }
  }
  printf("%s", dp[k] ? "First" : "Second");
}


Measured memory_bytes: 640
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math
from bisect import bisect_left, bisect_right
n = getN()

nums = getList()
nums.sort()

ans = 0
for i, num1 in enumerate(nums):
    for j , num2 in enumerate(nums[i+1:]):
        tmp = num1 + num2
        idx_min = bisect_left(nums, tmp)
        idx_max = bisect_right(nums, num2 - num1)
        # print(num1, num2, idx_min - idx_max)
        ans += idx_min - idx_max - 2
        if num2 >= num1 * 2:
            ans += 1
# print("=======")
# anss = 0
# for i, n1 in enumerate(nums):
#     for j, n2 in enumerate(nums):
#         for k, n3 in enumerate(nums):
#             if i != j and j != k and k != i:
#                 if n1 < n2 + n3 and n2 < n1 + n3 and n3 < n1 + n2:
#                     print(n1, n2, n3)
#                     anss += 1

print(ans// 3)
# print(anss/6)

"""
1 2 1  0
1 3 1  0
1 4 1  0
1 5 1  0
2 3 3  234 - 23 > 1 234
2 4 3  345 - 4 > 234, 245 
2 5 2  45 - 5 > 245
3 4 4  2345 - 34 > 234, 345
3 5 3  345 - 35 > 345 
4 5 4  2345 - 45 > 245, 345 
"""

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

using namespace std;

const int N = 3e5 + 5;
int n, k, a[N], dp[N][5];

int solve(int i, int pre, int f) {
    if (i == n) {
        return 0;
    }
    int &re = dp[i][f];
    if (re != -1) {
        return re;
    }
    re = 0;
    if (pre == -1) {
        re = max(re, solve(i + 1, pre, 0));
        re = max(re, solve(i + 1, a[i], 1) + 1);
    }
    else {
        for (int j = i; j < n; j++) {
            if (a[j] - pre <= k && a[j] - pre >= 0) {
                re = max(re, solve(j + 1, a[j], 1) + 1);
                break;
            }
        }
        for (int j = i; j < n; j++) {
            if (pre - a[j] <= k && pre - a[j] >= 0) {
                re = max(re, solve(j + 1, a[j], 2) + 1);
                break;
            }
        }
    }
    return re;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cin >> n >> k;
    memset(dp, -1, sizeof(dp));
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    cout << solve(0, -1, 0) << endl;
    return 0;
}





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

using namespace std;
typedef long long ll;

vector<vector<ll>> G;
ll N,M,S;
ll A[50][50];
ll B[50][50];
ll C[50];
ll D[50];

priority_queue<pair<ll, pair<ll,ll>>, vector<pair<ll, pair<ll,ll>>>, greater<pair<ll, pair<ll,ll>>>> pq;
ll m[50][5010];

bool check(){
    for(int i=0;i<N;i++){
        if(m[i][0] == 1e15) return true;
    }
    return false;
}

int main(){
    cin >> N >> M >> S;
    G.resize(N);
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            A[i][j] = B[i][j] = 1e15;
        }
    }
    for(int i=0;i<50;i++){
        for(int j=0;j<=5005;j++){
            m[i][j] = 1e15;
        }
    }
    for(int i=0;i<M;i++){
        ll a,b,c,d;
        cin >> a >> b >> c >> d;
        G[a-1].push_back(b-1);
        G[b-1].push_back(a-1);
        A[a-1][b-1] = A[b-1][a-1] = c;
        B[a-1][b-1] = B[b-1][a-1] = d;
    }
    for(int i=0;i<N;i++) cin >> C[i] >> D[i];
    pq.push(make_pair(0, make_pair(0,min(S,(ll)5000))));
    while(check()){
        pair<ll, pair<ll,ll>> p = pq.top();
        pq.pop();
        ll cost = p.first;
        ll n = p.second.first;
        ll s = p.second.second;
        if(m[n][s] == 1e15){
            for(int i=0;i<=s;i++){
                if(m[n][i] > cost) m[n][i] = cost;
            }
        }else{
            continue;
        }
        if(s < 5000) pq.push(make_pair(cost + D[n], make_pair(n,min(s+C[n],(ll)5000))));
        for(auto &e : G[n]){
            if(s >= A[n][e]) pq.push(make_pair(cost + B[n][e], make_pair(e,s-A[n][e])));
        }
    }
    for(int i=1;i<N;i++) cout << m[i][0] << endl;
    return 0;
}

Measured memory_bytes: 5808
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
using namespace std;
int main()
{
	int A;
	cin >> A;
	cout << pow(A, 3) << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int md[1111111];
int main(void){
  int p,q;
  while(cin >> p >> q){
    memset(md,-1,sizeof(md));
    int n,m=-1;
    for(n = 0; p%q; n++){
      if(md[p%q]!=-1){
	m = md[p%q];
	break;
      }
      else md[p%q] = n;
      p = (p%q) * 10;
      cout << p/q;
    }
    cout << endl;
    if(m != -1){
      for(int i = 0; i < n; i++){
	cout << (i<m?' ':'^');
      }
      cout << endl;
    }
  }
}

Measured memory_bytes: 5508
import sys
readline = sys.stdin.readline

N = int(readline())
T, A = map(int,readline().split())

for i in range(N - 1):
  t,a = map(int,readline().split())
  # newT % t == 0 , newA % a == 0である
  # newT >= T , newA >= Aである
  
  # T以上の、tの倍数の最小値 = T / tの切り上げ
  minT = ((T + t - 1) // t) * t
  minA = minT * a // t
  if minA >= A:
    T,A = minT,minA
    continue
  minA = ((A + a - 1) // a) * a
  minT = minA * t // a
  T,A = minT,minA
  
print(T + A)  

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

int main()
{
  int n;
  cin >> n;
  int a, b, c;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c;
    if (a * a + b * b == c * c) cout << "YES" << endl;
    else if (a * a == b * b + c * c) cout << "YES" << endl;
    else if (a * a + c * c == b * b) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
}



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

typedef long long ll;

ll n, x;

ll f(ll a, ll b) {
	if (a == b)
		return a;
	if (a > b)
		swap(a, b);
	ll r = b / a - (b % a == 0);
	return r * 2 * a + f(a, b - r * a);
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n >> x;
	cout << n + f(n - x, x);
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <utility>
#include <numeric>
#include <iomanip>

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

using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<int> a(n);
    rep(i, n)
    {
        cin >> a[i];
    }

    int ans = 0;
    int count = 1;
    rep(i, n)
    {
        if (a[i] == count)
        {
            count++;
        }
        else
        {
            ans++;
        }
    }

    if (n == 1)
    {
        cout << 0 << endl;
    }
    else if (ans == n)
    {
        cout << -1 << endl;
    }
    else
    {
        cout << ans << endl;
    }
}

Measured memory_bytes: 1024
if __name__ == "__main__":
    K, S = [int(x) for x in input().split(" ")]

    count = 0
    for x in range(0, K + 1):
        for y in range(0, K + 1):
            if 0 <= (S - x - y) <= K:
                count += 1
    print(count)


Measured memory_bytes: 67328
/*
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define FRO freopen("in.txt","r",stdin);

int main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);


      int n,i,j



	return 0;
}

cout<<"Case "<<++tt<<": No"<<endl;

#define PI 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define FRO freopen("in.txt","r",stdin);

ll valu[102], weight[102], dp[102][100005],n;

ll fun(ll i, ll remain_weight)
{
      if(remain_weight<0) return INT_MIN;
      if(i>n) return 0;
      if(dp[i][remain_weight]!=-1) return dp[i][remain_weight];

      return dp[i][remain_weight]= max(fun(i+1,remain_weight),fun(i+1,remain_weight-weight[i])+valu[i]);
}


int main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);

      ll i,j,w;
      cin>>n>>w;
      for(i=1;i<=n;i++) cin>>weight[i]>>valu[i];
      memset(dp,-1,sizeof(dp));
      cout<<fun(1,w);


	return 0;
}


Measured memory_bytes: 80000
s="0 1 9 30 76 141 267 400 624 885 1249 1590 2208 2689 3411 4248 5248 6081 7485 8530 10248 11889 13687 15228 17988 20053 22569 25242 28588 31053 35463 38284 42540 46581 50893 55362 61824 65857 71247 76884 84388 89349 97881 103342 111528 120141 128047 134580 146316 154177 164817 174438 185836 194157 207927 218812 233268 245277 257857 268182 288216 299257 313635 330204 347836 362973 383709 397042 416448 434025 456967 471948 499740 515581 536073 559758 583960 604833 633651 652216 683712 709065 734233 754734 793188 818917 846603 874512 909496 933081 977145 1006126 1041504 1073385 1106467 1138536 1187112 1215145 1255101 1295142 1342852 1373253 1422195 1453816 1502376 1553361 1595437 1629570 1691292 1726717 1782111 1827492 1887772 1925853 1986837 2033674 2089776 2145333 2197483 2246640 2332104 2379085 2434833 2490534 2554600 2609625 2693919 2742052 2813988 2875245 2952085 3003306 3096024 3157249 3224511 3306240 3388576 3444609 3533637 3591322 3693924 3767085 3842623 3912324 4027884 4102093 4181949 4270422 4361548 4427853 4548003 4616104 4718640 4812789 4918561 5003286 5131848 5205481 5299011 5392008 5521384 5610705 5739009 5818390 5930196 6052893 6156139 6239472 6402720 6493681 6623853 6741078 6864016 6953457 7094451 7215016 7359936 7475145 7593865 7689630 7886244 7984165 8130747 8253888 8403448 8523897 8684853 8802826 8949612 9105537 9267595 9376656 9574704 9686065 9827097 9997134 10174780 10290813 10493367 10611772 10813692"
ss=s.split()
n=int(input())
print(ss[n])


Measured memory_bytes: 9152
//Shunji Lin 08-144505

#include <iostream>
#include <queue>
#include <cstdlib>
#include <vector>

using namespace std;


int main() {
  // create a vector to store inputs
  vector<int> inputs;
  int n_inputs = 0; // number of inputs
  int max_prime = 0; // max prime (to generate vector of prime numbers)
  int input;
  while (cin >> input) { // read input
    if (input == 0) break;
    if (input > max_prime) max_prime = input;
    ++n_inputs;
    inputs.push_back(input);
  }

  //create bool of prime numbers (index)
  vector<bool> primes_bool(max_prime + 1, true); 


  //Sieve of Eratosthenes (algorithm for generating prime numbers)
  //https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
  
  int cur_prime = 2; // first prime
  
  while (cur_prime <= max_prime) {
    if (primes_bool[cur_prime] == true) { // if prime
      for (int l = cur_prime * 2; l <= max_prime; l += cur_prime) { 
	primes_bool[l] = false; // set all greater multiples to false (not prime)
      }
    }
    ++cur_prime;
  }

  //solve for each inputs
  for (int i = 0; i < n_inputs; ++i) {
    queue<int> primes_Q; // queue of primes up to value of input
    int cur_input = inputs[i];
    for (int j = 2; j <= cur_input; ++j) {
      if (primes_bool[j] == true) { //if prime
	primes_Q.push(j);
      }
    }
    
    queue<int> sum_Q; //queue to track sum of consequetive primes

    int count = 0; //count of sums
    int cur_sum = 0; //dynamic sum

    while (true) {
      if (cur_sum == cur_input) {
	++count;
	cur_sum -= sum_Q.front();
	sum_Q.pop();
      } else if (cur_sum < cur_input) {
	if (primes_Q.empty()) break; // terminate
	cur_sum += primes_Q.front();
	sum_Q.push(primes_Q.front());
	primes_Q.pop();
      } else if (cur_sum > cur_input) {
	cur_sum -= sum_Q.front();
	sum_Q.pop();
      }
    }
    cout << count << endl;
  }
}
    

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

int main() {
  ll K;
  cin >> K;
  ll sum =0;
  for(ll i=1;i<K+1;i++){
    for(ll j=i;j<K+1;j++){
      for(ll k=j;k<K+1;k++){
        if(i==k && i==j){
          sum += i;
            continue;
        }
        stack<int> s;
        for(ll l=1;l<i+1;l++){
          if(i%l==0) s.push(l);
        }
        ll G =0;
        while(!s.empty()){
          if(j%s.top()==0 && k%s.top()==0){
            G = s.top();
            break;
          }
          s.pop();
        }
        if(i==k || i==j || j==k) sum += 3*G;
        else sum += 6*G;
      }
    }
  }
  cout << sum;
}


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

int main() {
	int N;
  	cin >> N;
  
  	vector<string> vec(N);
  	for(int i = 0; i < N; i++)
      cin >> vec.at(i);
  	
  	bool can = true;
  	for(int i = 0; i < N - 1; i++) {
    	string s = vec.at(i);
      	string s2 = vec.at(i + 1);
      	if(s.at(s.size() - 1) != s2.at(0)) {
        	can = false;
        }
        
      	for(int j = i + 1; j < N; j++) {
        	if(vec.at(i) == vec.at(j)) can = false;
        } 
    }
  	
  	if(can) {
  	cout << "Yes" << endl;
    }else {
    cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1000000000000
int MOD=1000000007;
struct edge {
    int to, cost;
};

int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}

map<int,int> factor(int n){
  map<int,int>res;
  for(int i=2;i*i<=n;i++){
      for(; n%i==0;n/=i) res[i]++;
  }
  if(n>1)res[n]++;
  return res;
}
////////////////////////////////////////////////////////////

signed main() {
  int n,k;
  cin>>n>>k;
  vector<int>a(n);
  rep(i,n)cin>>a[i];

  rep(i,n-k){
    if(a[i]<a[i+k])cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
}


Measured memory_bytes: 4840
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (ll)1e18
#define warmup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7; 

signed main()
{
    warmup
    
    int n,i;
    cin>>n;
    while(1)
    {
        for(i=2;i*i<=n;++i)
            if(n%i==0)
                break;
        if(i*i>n)
            return cout<<n, 0;
        ++n;
    }   
    
    
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;

#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()

const int INF = 1001001001;

int main(){
	int n, m; cin >> n >> m;
	map <ll, ll, greater<ll>> mp; 
	rep(i, n){
		int a; cin >> a;
		mp[a] += 1;
	}
	rep(i, m){
		ll b, c; cin >> b >> c;
		mp[c] += b;
	}
	ll cnt = 0;
	ll ans = 0;
	for (auto x : mp) {
		if (cnt + x.second > n) {
			ans += x.first * (n - cnt);
			break;
		} else {
			ans += x.second * x.first;
		}
		cnt += x.second;
	}

	cout << ans << endl;
}

Measured memory_bytes: 12800
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    
    ll X,Y,Z; cin >> X >> Y >> Z;
    if(X/(Y+Z)*(Y+Z) + Z <= X) cout << X/(Y+Z) << endl;
    else cout << X/(Y+Z)-1 << endl;
    return 0;
}


Measured memory_bytes: 256