akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define ull unsigned long long
#define rep(i,n,N) for(ll i=n;i<=N;++i)
#define rap(i,n,N) for(ll i=n;i>=N;--i)
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
//#define ff fi.fi
//#define fs fi.se
#define sf se.fi
#define ss se.se
#define lc (id<<1)
#define rc ((id<<1)|1)
#define db(x) cerr << ">>>>>> " << #x << " -> " << x << endl
#define nani(x) cerr <<  "Line " << __LINE__ << ": " << #x << " is " << x << endl
#define all(x) x.begin(),x.end()
#define pii pair<int,int> 
#define pll pair<ll,ll>
#define plll pair<ll,pll>
#define piii pair<int,pii>
#define piiii pair<pii,pii>
#define psi pair<string,int>
#define endl '\n'
const int MAX = 5e5+5;
const ll MAX2 = 11;
const ll MOD = 1000000007;
const ll MOD2 = 1000005329;
const ll INF = 2e18;
const int dr[]={1,0,-1,0,1,1,-1,-1,0};
const int dc[]={0,1,0,-1,1,-1,1,-1,0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 2000;
 
ll n,k,dp[105][MAX],x[105];
 
int main(){
//	cout<<fixed<<setprecision(4);
//    freopen("input.txt", "r", stdin);
//	freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin>>n>>k;
    rep(i,1,n)cin>>x[i];
    rep(i,0,k)dp[0][i] = 1;
    
    rep(i,1,n){
    	dp[i][0] = 1;
    	rep(j,1,k){
    		dp[i][j] = (dp[i][j-1] + dp[i-1][j] - (j-x[i]>0 ? dp[i-1][j-x[i]-1] : 0))%MOD;
    		if(dp[i][j]<0)dp[i][j]+=MOD;
		}
	}
	cout<<(dp[n][k] - dp[n][k-1] + MOD)%MOD<<endl;
    return 0;
}

Measured memory_bytes: 285696
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = sc.next();
    String ans = "No";
    if(s.equals(t)) ans = "Yes";
    for(int i = 1; i < s.length(); i++) {
      String s1 = s.substring(0, s.length() - i);
      String s2 = s.substring(s.length() - i);
      String s0 = s2 + s1;
      if(s0.equals(t)) ans = "Yes";
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int k;
string s;

int main(){
	cin>>s>>k;
	int n=s.size();
	vvl dp(k+1,vl(2));
	for(int i=0;i<n;i++){
		vvl DP(k+1,vl(2));
		int t=s[i]-'0';
		if(i==0){
			DP[1][0]+=t-1;
			DP[1][1]++;
		}
		else DP[1][0]+=9;
		for(int j=0;j<=k;j++){
			for(int l=0;l<10;l++){
				int I=j+(l?1:0);
				if(I<=k) DP[I][0]+=dp[j][0];
				if(I<=k&&l<=t) DP[I][(l<t?0:1)]+=dp[j][1];
			}
		}
		dp=DP;
//		for(int j=0;j<=k;j++) cout<<dp[j][0]<<' '<<dp[j][1]<<endl;
//		cout<<endl;
	}
	cout<<dp[k][0]+dp[k][1]<<endl;
}

Measured memory_bytes: 256
import itertools
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
n=int(input())

a=["M","A","R","C","H"]
cnt=[0]*5
for i in range(n):
    s=input()
    for i in range(5):
        if s[0]==a[i]:
            cnt[i]+=1
ans=0
for i in itertools.combinations(range(5),3):
    ans+=cnt[i[0]]*cnt[i[1]]*cnt[i[2]]
print(ans)

Measured memory_bytes: 3064
<?php
list($N, $K) = array_map(function ($n) {
    return (int)$n;
}, explode(' ', fgets(STDIN)));

$A = array_map(function ($n) {
    return (int)$n;
}, explode(' ', fgets(STDIN)));

$i = 0;
$town_went = [];
$town_went[1] = 0;
$last_town = 1;
$loop_length = 0;
while ($i < $K) {
    if (isset($town_went[$A[$last_town - 1]])) {
        $loop_length = count($town_went) - $town_went[$A[$last_town - 1]];
        break;
    }
    $town_went[$A[$last_town - 1]] = $i + 1;
    $last_town = $A[$last_town - 1];
    $i++;
}

if ($loop_length === 0) {
    echo $last_town;
    return;
}

echo array_search(($K - (count($town_went) - $loop_length)) % $loop_length + count($town_went) - $loop_length, $town_went);

Measured memory_bytes: 39244
#include <bits/stdc++.h>
#define bp __builtin_popcountll
#define pb push_back
#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\
		freopen((string(s) + "." + end2).c_str(), "w", stdout);
#define fi first
#define se second
#define bw(i, r, l) for (int i = r - 1; i >= l; i--)
#define fw(i, l, r) for (int i = l; i < r; i++)
#define fa(i, x) for (auto i: x)
using namespace std;
typedef pair<int, int> ii;
const int mod = 1e9 + 7, inf = 1061109567;
const long long infll = 4557430888798830399;
const int N = 1e5 + 5;
int n, m;
bool outEdges[N];
vector<int> g[N], child[N];
bool vis[N], outOfSubtree[N];
vector<ii> edgeDirections;
void dfs(int u, int p) {
	//Point all back - edges in a certain direction.
	vis[u] = 1;
	outOfSubtree[u] = 1;
//	cout << "u = " << u << " p = " << p << "\n";
	fa (v, g[u]) if (v != p) {
		if (!vis[v]) {
			child[u].pb(v);
			dfs(v, u);
		} else {
			if (outOfSubtree[v]) {
				//u - v is a back - edge.
				edgeDirections.pb(ii(u, v));
				outEdges[u] ^= 1;
			}
		}
	}
	outOfSubtree[u] = 0;
}
void assignDirections(int u, int p) {
	fa (v, child[u]) {
		assignDirections(v, u);
	}
	if (p != -1) {
		if (outEdges[u] & 1) {
			edgeDirections.pb(ii(u, p));
			outEdges[u] ^= 1;
		} else {
			edgeDirections.pb(ii(p, u));
			outEdges[p] ^= 1;
		}
	}
}
signed main() {
	#ifdef BLU
	in("blu.inp");
	#endif
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	fw (i, 0, m) {
		int u, v;
		cin >> u >> v;
		u--, v--;
		g[u].pb(v), g[v].pb(u);
	}
	if (m & 1) {
		cout << "-1";
		return 0;
	}
	dfs(0, -1);
	assignDirections(0, -1);
	fa (edge, edgeDirections) {
		cout << edge.fi + 1 << " " << edge.se + 1 << "\n";
	}
	return 0;
}

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

int main() {
  vector <char> N(4);
    
    for (int i = 0; i < 4; i++){
      cin >> N.at(i); 
    }
   
   if ( N.at(0) == N.at(1) &&  N.at(0) == N.at(2)){
        cout << "Yes" <<endl;
     }
  else if ( N.at(1) == N.at(2) &&  N.at(1) == N.at(3)){
        cout << "Yes" <<endl;
     }
   else cout << "No" << endl;
}

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

using namespace std;

const int N = 500017;

string s;

bool read() {
    if (!(cin >> s))
        return false;

    return true;
}

void solve() {
    for (int i = 0; i < s.size() - 1; ++i)
        if (s[i] == s[i + 1]) {
            cout << "Bad\n";
            return ;
        }

    cout << "Good\n";
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    while (read())
        solve();

    return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#define MAXN 100010

struct edge{
	int to,next;
	edge(int _to=0,int _next=0):to(_to),next(_next){}
}e[MAXN<<1];

int n;
int g[MAXN],nume;
int f[MAXN],h[MAXN];

void addEdge(int u,int v){
	e[nume]=edge(v,g[u]);
	g[u]=nume++;
}

void dfs(int x,int p){
	int c0=0,cf=0,cg=0;
	for(int i=g[x];~i;i=e[i].next)
		if(e[i].to^p){
			c0++;
			dfs(e[i].to,x);
			if(f[e[i].to]) cf++;
			if(h[e[i].to]) cg++;
		}
	if(cf>=2 || cg==c0) f[x]=1;
	if(cf>=1) h[x]=1;
}

int main(){
	memset(g,-1,sizeof g);
	scanf("%d",&n);
	for(int i=1;i<n;i++){
		int u,v;
		scanf("%d%d",&u,&v);
		addEdge(u,v);
		addEdge(v,u);
	}
	dfs(1,0);
	if(f[1]) puts("First");
	else puts("Second");
	return 0;
}


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

using namespace std;

#define F first
#define S second
#define modulo ll (1e9 + 7)

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

void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int N = 2e5 + 9, M = 1e6, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;



ll power(ll b, ll p){
    if(p == 0)return 1;
    ll res = power(b,p/2);
    res *= res;
    res %= modulo;
    if(p & 1)res *= b;
    return res % modulo;
}


int main(){
    init();

    int k, s;    cin >> k >> s;

    int ans = 0;
    for(int i = 0;i <= k;i++){
        for(int j = 0;j <= k;j++){
            int u = s - i - j;
            if(u >= 0 && u <= k)    ans++;
        }
    }
    cout << ans;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

fn main() {
    input! {
        n: u32, x: u64
    }

    println!("{}", rec(n, x));
}

fn level(l: u32) -> u64 {
    2u64.pow(l + 2) - 3
}

fn rec(n: u32, x: u64) -> u64 {
    if n == 0 && x == 1 {1}
    else if x <= 1 {0}
    else if x <= 1 + level(n-1) {rec(n-1,x-1)}
    else if x <= 2 + level(n-1) {rec(n-1,level(n-1)) + 1}
    else if x <= 2 + 2*level(n-1) {rec(n-1,level(n-1)) + 1 + rec(n-1,x-2-level(n-1))}
    else {rec(n-1,level(n-1)) * 2 + 1}
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define rep(n) for(int i=0;i<n;i+=1)
#define fill(c,v) memset(c,v,sizeof(c));
#define _h cout<<"here"<<endl;
#define pr(a) cout<<a<<endl;
#define prarr(a,n) rep(n) cout<<a[i]<<" \n"[i==n-1]; 
#define fi first
#define se second
#define pu push_back
#define inf 1000000001
#define MOD 1000000007 
#define INF 100000000000001
const int MAXN = 1e5+10;
int fl(int i,int k)
{
	if(i%k==0) return i/k;
	else return i/k+1;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,k;
    cin>>n>>k;
    int a[MAXN];
    int ind = 0;
    rep(n)
    {
     cin>>a[i];
    	if(a[i]==1)
    		ind  = i;
    }
    int ans = inf;
    for(int i = max({0,ind-k+1});i<=min({n-1,ind+k-1});i++)
    {
    	ans = min({ans,fl(i,k-1)+fl(n-i-1,k-1)});
    }
    cout<<ans<<endl;
    return 0;

}


Measured memory_bytes: 640
#include<iostream>
#include<string>

int main() {
	int num;
	std::string str("ABC");
	
	std::cin >> num; 

	std::cout << str + std::to_string(num) << std::endl;  //std::cout << str << num << std::endl;でも良かったが int から　string へのキャスト練習

	return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
D = {i: [0] for i in range(1, n+1)}
for i in range(n+1):
  D[a[i]][0] += 1
  D[a[i]].append(i)
pl, pr = 0, 0
for i in D:
  if D[i][0] == 2:
    pl = D[i][1]
    pr = D[i][2]
    break
L = pl
M = pr - pl - 1
N = n - pr
mod = int(1e9) + 7 # <-- input modulo
maxf = n+11          # <-- input factional limitation

def make_fact(n, k):
    tmp = n
    perm = [i for i in range(k)]
    L = [0 for _ in range(k)]
    for i in range(k):
        L[i] = tmp % (i + 1)
        tmp //= i + 1
    LL = [0 for _ in range(k)]
    for i in range(k):
        LL[i] = perm[L[-i-1]]
        for j in range(L[-i-1]+1, k):
            perm[j-1] = perm[j]
    return LL

def doubling(n, m, modulo=mod):
    y = 1
    base = n
    tmp = m
    while tmp != 0:
        if tmp % 2 == 1:
            y *= base
            if modulo > 0:
                y %= modulo
        base *= base
        if modulo > 0:
            base %= modulo
        tmp //= 2
    return y

def inved(a, modulo=mod):
    x, y, u, v, k, l = 1, 0, 0, 1, a, modulo
    while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % modulo

fact = [1 for _ in range(maxf+1)]
invf = [1 for _ in range(maxf+1)]

for i in range(maxf):
    fact[i+1] = (fact[i] * (i+1)) % mod
invf[-1] = inved(fact[-1])
for i in range(maxf, 0, -1):
    invf[i-1] = (invf[i] * i) % mod

for i in range(1, n+2):
  S = fact[n]*invf[i-1]*invf[n-i+1]%mod
  if i <= n-1:
    S += fact[n-1]*invf[i]*invf[n-1-i]%mod
    S %= mod
  if i <= n-M:
    S -= fact[n-1-M]*invf[i-1]*invf[n-M-i]%mod
    S %= mod
  if i <= n:
    S += fact[n-1]*invf[i-1]*invf[n-i]%mod
    S %= mod
  print(S)

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll;  typedef pair<ll,ll> pii;
typedef vector<int> VI; typedef vector<ll> VL;
const int MD = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }


int main(){
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI ck(100100, 0);
	rep(i, n){
		int p; cin >>p;
		if(i==p-1) ck[p-1] =1;
	}
	int ans =0;
	rep(i, 100010){
		if(ck[i] ==1 && ck[i+1] ==1){
			ans++; ck[i] = ck[i+1] = 0;
		}
	}
	rep(i, 100010){
		if(ck[i] ==1) ans++;
	}
	
	cout << ans <<"\n";
	return 0;
}


Measured memory_bytes: 640
// Try AtCoder
// author: Leonardone @ NEETSDKASU
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var scn = bufio.NewScanner(os.Stdin)

func init() {
	scn.Buffer(make([]byte, 1e7), 1e7)
}
func gets() string {
	scn.Scan()
	return scn.Text()
}
func toI(s string) int {
	v, _ := strconv.Atoi(s)
	return v
}

func main() {
	xs := make([]bool, 3e5+1)
	pr := make([]int, 0, 3e5+1)
	pr = append(pr, 2)
	for i := 3; i < 3e5; i += 2 {
		if xs[i] {
			continue
		}
		pr = append(pr, i)
		for p := i + i; p < 3e5; p += i {
			xs[p] = true
		}
	}
	ys := make([]bool, 1e5+1)
	for _, p := range pr {
		e := p*2 - 1
		if e > 1e5 {
			break
		}
		if !xs[e] {
			ys[e] = true
		}
	}
	zs := make([]int, 1e5+1)
	for i := 1; i <= 1e5; i++ {
		if ys[i] {
			zs[i] = zs[i-1] + 1
		} else {
			zs[i] = zs[i-1]
		}
	}

	n := toI(gets())
	for i := 0; i < n; i++ {
		ss := strings.Split(gets(), " ")
		lx, rx := toI(ss[0]), toI(ss[1])
		ans := zs[rx] - zs[lx-1]
		fmt.Println(ans)
	}
}


Measured memory_bytes: 12380
n0 = int(1e5)+1
x = [0]*n0

n = int(input())
a0 = list(map(int,input().split()))
q = int(input())
bcs = []
for i in range(q):
    bcs.append(list(map(int,input().split())))

for a in a0:
    x[a] += 1
sum0 = sum(a0)

for bc in bcs:
    sum0 = sum0 + bc[1]*x[bc[0]] - bc[0]*x[bc[0]]
    x[bc[1]] += x[bc[0]]
    x[bc[0]] = 0
    print(sum0)

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

public class Main {
	
	public static void main(String[] args) {
		FastReader in = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		String s = in.next(), t = in.next();
		int moves = 0;
		for(int i = 0; i<s.length(); i++) {
			if(t.charAt(i)!=s.charAt(i)) {
				moves++;
			}
		}
		out.print(moves);
		
		out.close();
				
    }
	static int search(int[] time, int key, int low, int high) {
		while(low<=high) {
			int mid = (low+high)/2;
			if(time[mid]>key) high = mid-1;
			else if(time[mid]<key) low = mid+1;
			else return mid+1;
		}
		return low;
	}

	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
		
}

Measured memory_bytes: 37168
from collections import Counter, defaultdict
N = int(input())
A = [int(i) for i in input().split()]
C = Counter(A)
Q = int(input())

S = sum(A)

for i in range(Q):
    s, t = [int(i) for i in input().split()]
    S += (t-s)*C[s]
    C[t] += C[s]
    C[s] = 0

    print(S)

Measured memory_bytes: 24012
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/




int N, A[201010];
//---------------------------------------------------------------------------------------------------
ll B[201010];
ll get(int L, int R) { // [L,R)
    if (L == R) return 0;
    ll res = B[R - 1];
    if (L) res -= B[L - 1];
    return res;
}
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 0, N) cin >> A[i];

    B[0] = A[0];
    rep(i, 1, N) B[i] = B[i - 1] + A[i];

    ll ans = infl;
    // [0,a) [a,b) [b,c) [c,N)
    rep(b, 2, N - 1) {
        int a, c;
        ll P, Q, R, S;

        {
            int ok = 0, ng = b;
            while (ok + 1 != ng) {
                int md = (ng + ok) / 2;
                if (get(0, md) < get(md, b)) ok = md;
                else ng = md;
            }
            vector<int> v;
            if (ok) v.push_back(ok);
            if (ok + 1 != b) v.push_back(ok + 1);
            if (v.size() == 1) a = v[0];
            else if (1 < v.size()) {
                int a0 = v[0], a1 = v[1];
                if (abs(get(0, a0) - get(a0, b)) < abs(get(0, a1) - get(a1, b))) a = a0;
                else a = a1;
            } else assert(0);
        }
        
        {
            int ok = b, ng = N;
            while (ok + 1 != ng) {
                int md = (ng + ok) / 2;
                if (get(b, md) < get(md, N)) ok = md;
                else ng = md;
            }
            vector<int> v;
            if (ok) v.push_back(ok);
            if (ok + 1 != N) v.push_back(ok + 1);
            if (v.size() == 1) c = v[0];
            else if (1 < v.size()) {
                int c0 = v[0], c1 = v[1];
                if (abs(get(b, c0) - get(c0, N)) < abs(get(b, c1) - get(c1, N))) c = c0;
                else c = c1;
            }
            else assert(0);
        }

        P = get(0, a);
        Q = get(a, b);
        R = get(b, c);
        S = get(c, N);

        ll mi = min(min(P, Q), min(R, S));
        ll ma = max(max(P, Q), max(R, S));

        chmin(ans, ma - mi);
    }

    cout << ans << endl;
}


Measured memory_bytes: 2560
def doc_string():
    """
    I can fly.
    """

while True:
    list = []
    stack = []
    if __name__ == "__main__":
        try:
            list = raw_input().split()
        except EOFError:
            break
            
        for var in list:
            try:
                stack.append(float(var))
            except:
                if var == "+":
                    a = stack.pop()
                    b = stack.pop()
                    stack.append(b + a)
                if var == "-":
                    a = stack.pop()
                    b = stack.pop()
                    stack.append(b - a)
                if var == "*":
                    a = stack.pop()
                    b = stack.pop()
                    stack.append(b * a)
                if var == "/":
                    a = stack.pop()
                    b = stack.pop()
                    stack.append(b / a)

        print stack.pop()

Measured memory_bytes: 6240
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
 
import java.util.*;
import java.lang.*;
import java.io.*;

@SuppressWarnings("unchecked")
public class Main implements Runnable {

  static BufferedReader in;
  static PrintWriter out;
 
  public static void main(String[] args) {
      new Thread(null, new Main(), "whatever", 1<<29).start();
  }


  /* Iterative Function to calculate 
    (x^y)%p in O(log y) */
    static long power(long x, long y, long p) 
    { 
          
        // Initialize result 
        long res = 1L; 
      
        // Update x if it is more than or 
        // equal to p 
        x = x % p; 
                      
        while (y > 0L) 
        { 
              
            // If y is odd, multiply x 
            // with result 
            if (y % 2 == 1L) 
                res = (res * x) % p; 
      
            // y must be even now 
            y = y >> 1L; // y = y/2 
            x = (x * x) % p; 
        } 
          
        return res; 
    } 

    // Returns n^(-1) mod p 
    static long modInverse(long n, long p) 
    { 
        return power(n, p-2, p); 
    } 
      
    // Returns nCr % p using Fermat's 
    // little theorem. 
    static long nCrModPFermat(long n, long r, 
                                    long p) 
    { 
          
        // Base case 
        if (r == 0L) 
            return 1L; 
      
        // Fill factorial array so that we 
        // can find all factorial of r, n 
        // and n-r 
        long fac = 1L;
          
        for (int i = 1 ;i <= r; i++) {
          fac = (fac * (n-(i-1))) % p;
          fac = (fac * modInverse(i, p)) % p;
        }
      
        return fac; 
    }
 
  public void run() {
    in = new BufferedReader(new InputStreamReader(System.in));
    out = new PrintWriter(System.out, false);
 
    try
    {
      // in = new BufferedReader(new FileReader("class_treasurer.txt"));
      // out = new PrintWriter("output.txt");

      int t,x1,n,a,b,MOD=1000000007;
      String str;
      String[] token;

      str=in.readLine().trim();
      token=str.split(" ");
      n=Integer.parseInt(token[0]);
      a=Integer.parseInt(token[1]);
      b=Integer.parseInt(token[2]);

      int waystoA=(int)nCrModPFermat(n, a, MOD);
      int waystoB=(int)nCrModPFermat(n, b, MOD);
      int totalWays=(int)power(2, n, MOD)-1;
      if(totalWays<0) {
        totalWays+=MOD;
      }

      totalWays-=waystoA;
      if(totalWays<0) {
        totalWays+=MOD;
      }

      totalWays-=waystoB;
      if(totalWays<0) {
        totalWays+=MOD;
      }

      out.println(totalWays);


      out.flush();
      out.close();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
}


Measured memory_bytes: 25428
#include<stdio.h>

#define N 21

int main(){
  int map[N][N], i, j, ans;
  int n, m, x, y, dis, x_bin, y_bin, t;
  char dir[2];

  while(scanf("%d", &n), n){
    for(i=0; i<N; i++){
      for(j=0; j<N; j++){
	map[i][j]=0;
      }
    }

    for(i=0; i<n; i++){
      scanf("%d%d", &x, &y);
      map[y][x]=1;
    }

    scanf("%d", &m);

    x_bin=y_bin=10;
    for(i=0; i<m; i++){
      scanf("%s%d", dir, &dis);

      //      printf("%d %d\n", dir[0], dis);
      switch(dir[0]){
      case 'N':
	for(j=1; j<dis+1; j++){
	  map[x_bin+j][y_bin]=0;
	}
	x_bin+=dis;
	break;
      case 'S':
	for(j=1; j<dis+1; j++){
	  map[x_bin-j][y_bin]=0;
	}
	x_bin-=dis;
	break;
      case 'E':
	for(j=1; j<dis+1; j++){
	  map[x_bin][y_bin+j]=0;
	}
	y_bin+=dis;
	break;
      case 'W':
	for(j=1; j<dis+1; j++){
	  map[x_bin][y_bin-j]=0;
	}
	y_bin-=dis;
	break;
      }
      
    }

    t=0;
    for(i=0; i<N; i++){
      for(j=0; j<N; j++){
	if(map[i][j]==1){
	  t=1;
	  break;
	}
      }
    }

    if(t==0){
      printf("Yes\n");
    }else{
      printf("No\n");
    }
    
  }
  return 0;
}

Measured memory_bytes: 584
/*******************************************************
 Auther :- Avinash Kumar Sharma 
 collage :- BIRLA INSTITUTE OF THECHNOLOGY
 At coder :- Multiple of 9... 
 status :- solved.
 ********************************************************/
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n=0,c=0;
    cin>>n;
    vector<long int>ar;
    for(long int i=0;i<n;i++)
    {
        long int p=0;
        cin>>p;
        ar.push_back(p);
    }
    for(long int i=0;i<n-1;i++)
    {
        
        if(ar[i]==ar[i+1])
        {
            continue;
        }
        else if(ar[i]<ar[i+1])
        {
            continue;
        }
        
       
      else if(ar[i]>ar[i+1])
        {
            c=c+(ar[i]-ar[i+1]);
            ar[i+1]=ar[i];
            
        }
        
       
    }
    cout<<c;

}

Measured memory_bytes: 5240
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("Heisei")
    else:print("TBD")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())


#n = ip()                              #入力整数1つ
#n,k= (int(i) for i in input().split())      #入力整数横2つ
#n,x,y = (int(i) for i in input().split())    #入力整数横3つ
#n,a,b,c= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
l = len(a)
for i in range(l-1,-1,-1):
    e = a[:i]
    if len(a)%2 == 0:
        b = len(e)//2
        c = e[b:]
        d = e[:b]
        if c==d:
            print(b*2)
            exit(0)

Measured memory_bytes: 13612
N,K=map(int,input().split())
x=[int(i) for i in input().split()]
cost=[]

for i in range(N-K+1):
	length=abs(x[i]-x[i+K-1])
	cost.append(length+abs(x[i]))
	cost.append(length+abs(x[i+K-1]))
print(min(cost))

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

int main(void){
    int c[4][4];
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            int a;
            cin >> a;
            c[i+1][j+1] = a;
        }
    }
    if(c[1][3] - c[1][2] == c[2][3]-c[2][2] && c[3][3] - c[3][2] == c[2][3]-c[2][2]){
        if(c[1][2] - c[1][1] == c[2][2]-c[2][1] && c[3][2] - c[3][1] == c[2][2]-c[2][1]){
            if(c[3][3]-c[2][3] == c[3][2]-c[2][2] && c[3][2]-c[2][2] == c[3][1]-c[2][1]){
                if(c[2][3]-c[1][3] == c[2][2]-c[1][2] && c[2][2]-c[1][2] == c[2][1]-c[1][1]){
                    cout << "Yes" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

class City:
    def __init__(self, i1, p, y, o=None):
        self.i1 = i1
        self.p = p
        self.y = y
        self.o = o

    # def __repr__(self):
    #     return f"City({self.i1}, {self.p}, {self.y}, {self.o})"

    def get_id(self):
        return "%06d%06d" % (self.p, self.o)

def put_ids(n, cities):
    years = {i: [] for i in range(1, n + 1)}
    for c in cities:
        years[c.p].append(c.y)

    year_to_order = {i: {} for i in range(1, n + 1)}
    for i in range(1, n + 1):
        ys = sorted(years[i])
        for j0, y in enumerate(ys):
            year_to_order[i][y] = j0 + 1

    for c in cities:
        c.o = year_to_order[c.p][c.y]

def main():
    n, m = map(int, input().split())
    cities = []
    for i0 in range(m):
        p, y = map(int, input().split())
        city = City(i0, p, y)
        cities.append(city)
    put_ids(n, cities)
    for c in cities:
        print(c.get_id())

main()


Measured memory_bytes: 110692
/*
        karmany evadhikaras te
        ma phalesu kadacana 
        ma karma-phala-hetur bhur
        ma re sango'stv akarmani (B.G.-2.47)
 
Translation:
        Lord Krsna to Arjuna.
You have a right to perform your prescribed duty, 
but you are not entitled to the fruits of action. 
Never consider yourself the cause of the results of your activities, 
and never be attached to not doing your duty.    
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 200005;
const ll mod = 1e9+7;
#define ld long double
#define PI 3.14159265358979323846
const int X = 200005;

void flash()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(10);
}

//3. Structure or classes
struct Value{
    int value=-1;
};
//3. Ends here

//1. Data structures declaration here

//1. Ends here

//2. Extra Functions here
//2. Ends here


void solve();
int32_t main()
{
    flash();
    int t;
    t = 1;
    //cin>>t;
    for (int zz = 0; zz < t; zz++)
    {
        solve();
        //cout<<"\n";
    }
    return 0;
}

void solve()
{
    map<int,int>mp;
    int n;
    cin>>n;
    int x;
    ll sum=0;
    for(int i=0;i<n;i++){
        cin>>x;
        mp[x]++;
        sum+=x*1ll;
    }
    int q;
    cin>>q;
    int b,c;
    for(int i=0;i<q;i++){
        cin>>b>>c;
        if(mp[b]!=0){
            sum-=1ll*b*mp[b];
            sum+=1ll*c*mp[b];
            mp[c]+=mp[b];
            mp[b]=0;
        }
        cout<<sum<<"\n";
    }
    return;
}



Measured memory_bytes: 7812
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Edge=pair<ll,ll>;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

////////// 二分探索 //////////

vector<ll> A;

// index が条件を満たすかどうか
bool isOK(ll index,ll key) {
  if(A[index]>=key) return true;
  else return false;
}

// 汎用的な二分探索のテンプレ
ll binary_search(ll key) {
  ll ng=-1; //「index = 0」が条件を満たすこともあるので、初期値は -1
  ll ok=(ll)A.size(); // 「index=a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
  while(abs(ok-ng)>1){
    ll mid=(ok+ng)/2;
    if(isOK(mid,key)) ok=mid;
    else ng=mid;
  }
  return ok;
}

//////////////////////////////////////////////////

int main(){
  ll N,M,ans=0;
  cin>>N>>M;
  REP(i,N){
    ll a;
    cin>>a;
    A.PB(-a);
  }
  SORT(A);
  
  ll SUM[N+1];
  SUM[0]=0;
  REP(i,N) SUM[i+1]=SUM[i]-A[i];
  
  ll ye=INF,no=0; // Ax+Ayとして取れる値
  while(ye-no>1){
    ll mid=(ye+no)/2,cnt=0,sum=0;
    
    REP(i,N){
      ll it=binary_search(-mid-A[i]+1);
      cnt+=it;
      sum+=SUM[it]-A[i]*it;
    }
    
    if(cnt<=M){
      ye=mid;
      chmax(ans,sum);
      if(ye-no==1){
        chmax(ans,sum+(M-cnt)*no);
      }
    }
    else{
      no=mid;
      if(ye-no==1){
        chmax(ans,sum+(M-cnt)*no);
      }
    }
  }
  
  co(ans);
  return 0;
}

Measured memory_bytes: 4868
#include <iostream>
using namespace std;
int main(void) {
	int A, B, K;
	cin >> A >> B >> K;

	for (int i = 0; i < K; i++)
	{
		if (i % 2 == 0) {
			if (A % 2 == 1) {
				A--;
			}
			A /= 2;
			B += A;
		}
		else {

			if (B % 2 == 1) {
				B--;
			}
			B /= 2;
			A += B;
		}

	}

	cout << A << " " << B << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define inf (1LL) << 30
using namespace std;
vector <ll> a[100005];
ll b[100005];
ll dfs(ll v){
	if(b[v] > 0) return b[v];
	ll minn = 0;
	for(auto x : a[v]){
		minn = max(minn,dfs(x));
	}
	b[v] = minn + 1;
	return b[v];
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n,m;
	cin >> n >> m;
	while(m--){
		ll x,y;
		cin >> x >> y;
		a[x].push_back(y);
	}
	memset(b,0,sizeof(b));
	for(ll i = 1;i <= n;i++){
		b[i] = dfs(i);
	}
	ll maxx = 0;
	for(ll i = 1;i <= n;i++){
		maxx = max(maxx,b[i]);
	}
	cout << maxx - 1 << "\n";
 	return 0;
}

Measured memory_bytes: 8576
import java.util.*

fun main(args:Array<String>?): Unit {
    val neighbors = listOf(Point(1, 0), Point(-1, 0), Point(0, 1), Point(0, -1))
    while(true){
        val (w, h) = readLine()!!.trim().split(' ').map(String::toInt)
        if (w == 0 && h == 0) return
        val board = Array(h){IntArray(w){0}}
        val (sx, sy) = readLine()!!.trim().split(' ').map(String::toInt)
        val (gx, gy) = readLine()!!.trim().split(' ').map(String::toInt)
        val start = Point(sx - 1, sy - 1)
        val goal = Point(gx - 1, gy - 1)
        val n = readLine()!!.trim().toInt()
        repeat(n){
            val (c, d, x, y) = readLine()!!.trim().split(' ').map(String::toInt)
            for (cell in Block(Point(x - 1, y - 1), d).cells()) {
                board[cell.y][cell.x] = c
            }
        }
        val queue: Queue<Point> = LinkedList()
        if (board[start.y][start.x] != 0) queue.add(start)
        while(queue.isNotEmpty() && queue.peek() != goal){
            val current = queue.poll()
            for (neighbor in neighbors.map{it + current}) if (neighbor.y in 0 until h && neighbor.x in 0 until w && board[neighbor.y][neighbor.x] != 0){
                if (board[current.y][current.x] == board[neighbor.y][neighbor.x]){
                    queue.add(neighbor)
                }
            }
            board[current.y][current.x] = 0
        }
        println(
                if (queue.isNotEmpty()) "OK" else "NG"
        )
    }
}
data class Point(val x: Int, val y: Int) {
    operator fun plus(that: Point): Point = Point(x + that.x, y + that.y)
}
data class Block(val position: Point, val state: Int) {
    fun cells(): Iterable<Point> {
        return when(state){
            0 -> listOf(Point(0, 0), Point(1, 0), Point(2, 0), Point(3, 0),
                    Point(0, 1), Point(1, 1), Point(2, 1), Point(3, 1)).map{it + position}
            else -> listOf(Point(0, 0), Point(0, 1), Point(0, 2), Point(0, 3),
                    Point(1, 0), Point(1, 1), Point(1, 2), Point(1, 3)).map{it + position}
        }
    }
}


Measured memory_bytes: 31752
#include "bits/stdc++.h"

using namespace std;

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;cin>>n;
    vector<P> v(n);
    ll mi=1e10,ma=-1;
    for(int i=0;i<n;i++){
        ll x,y;cin>>x>>y;
        if(x>y) swap(x,y);
        mi=min(mi,x);
        ma=max(ma,y);
        v[i]=P(x,y);
    }
    sort(v.begin(),v.end());
    ll rmin=1e10;
    for(int i=0;i<n;i++) rmin=min(rmin,v[i].second);
    ll res=(v[n-1].first-mi)*(ma-rmin);
    set<P> st; // blue candidate
    st.insert(P(v[0].second,-1LL)); 
    for(int i=1;i<n;i++) st.insert(P(v[i].second,i));
    while(true){
        ll dif=(*st.rbegin()).first-(*st.begin()).first;
        res=min(res,dif*(ma-mi));

        P p=(*st.rbegin());
        st.erase(p);
        if(p.second==-1) break;
        st.insert(P(v[p.second].first,-1LL));        
    }
    cout<<res<<endl;
}

Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define all(x) (x).begin(),(x).end()

constexpr auto INF = INT_MAX/2;
constexpr auto MOD = 1000000007;

int main() {

	int n;
	cin >> n;

	vector<vs> s(n+1);
	s[0] = { "" };
	s[1] = { "a" };

	rep(i, n-1) {
		int k = i + 2;

		rep(j, s[k - 1].size()) {
			string ne = s[k - 1][j];
			int last = 0;

			rep(l, ne.size())last = max(last, ne[l] - 'a');
			
			rep(m, last+2) {
				string nes = ne;
				char sd = 'a' + m;
				nes += sd;
				s[k].push_back(nes);
			}
		}
	}
	rep(i, s[n].size()) cout << s[n][i] << endl;
}

Measured memory_bytes: 11380
#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 n;
    cin >> n;
    vector<int> d(n);
    rep(i,n) cin >> d[i];
    sort(d.begin(), d.end());
    int mid = n/2;
    cout << d[mid]-d[mid-1] << endl;
    return 0;
}

Measured memory_bytes: 3800
#include<iostream>
using namespace std;
int main(){
  int n,b,f,r,v,i,j,k,a;
  int kousya[4][3][10]={};
  cin >> n;
  for( a=0;a<n;a++){
    cin >> b >> f >> r >> v;
    kousya[b-1][f-1][r-1]+=v;
  }
  for(i=0;i<4;i++){
    for( j=0;j<3;j++){
      for( k=0;k<10;k++){
	cout << " "<< kousya[i][j][k];
      }
      cout << endl;
    }
    if(i<3)cout << "####################" << endl;
  }
  return 0;
}



Measured memory_bytes: 3108
//                                                  '-.-'
   //                                         ()      __.'.__
   //                                      .-:--:-.  |_______|
   //                               ()      \____/    \=====/
   //                               /\      {====}     )___(
   //                    (\=,      //\\      )__(     /_____\
   //    __    |'-'-'|  //  .\    (    )    /____\     |   |
   //   /  \   |_____| (( \_  \    )__(      |  |      |   |
   //   \__/    |===|   ))  `\_)  /____\     |  |      |   |
   //  /____\   |   |  (/     \    |  |      |  |      |   |
   //   |  |    |   |   | _.-'|    |  |      |  |      |   |
   //   |__|    )___(    )___(    /____\    /____\    /_____\
   //  (====)  (=====)  (=====)  (======)  (======)  (=======)
   //  }===={  }====={  }====={  }======{  }======{  }======={
   // (______)(_______)(_______)(________)(________)(_________)
   //
   // Credits :- Joan G. Stark
   //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
   //|                      AUTHOR - KASPAROVIAN                                     |
   //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define frr(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fr first
#define sc second
#define mk make_pair
#define endl '\n'
#define MOD 1000000007
#define in insert
#define sz(x) (ll)(x).size()
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pi;
typedef pair<int,pi> ppi;
typedef vector<vi> graph;
template<class T> void mxi(T & a, const T & b) { a = max(a, b); }
template<class T> void mni(T & a, const T & b) { a = min(a, b); }
ld EPS=1e-9;
void solve()
{
  int d,t,s;
  cin>>d>>t>>s;
  if(d>s*t)
  	cout<<"No\n";
  else
  	cout<<"Yes\n";

}
signed main()
{
  fast;
  int t,tab;
  t=1;
  tab=t;
  while(t--)
  {
    //cout<<"Case #"<<(tab-t)<<": ";
    solve();
  }
}
//APPROACHING A QUESTION
//+ Think of binary search (max of min etc also if n<=2*10^5)
//+ Think of common dp states (Even if it appears as maths but constraints are small)
//+ Check constraints
//+ Keep calm and enjoy the question
//+ Be sure to remove MOD from binpow (if needed)
//+ Try bidirectional analysis for constructive questions
//+ If given some sequence try thinking of prefix sums
//+ If constraints are too large maybe its simple maths
//+ In questions with binary operations think of bits independently and also the change pattern
//+ If two or more binary operations are given mostly there is a relation between them and an arithmatic operator

Measured memory_bytes: 3632
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long ll;
#define REP(i,n) for (int i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

int main ()
{
	ll N,K;
	cin >> N >> K;

	vector < ll > A(N),F(N);
	REP(i,N) cin >> A[i];
	REP(i,N) cin >> F[i];

	sort(A.begin(), A.end());
	sort(F.begin(), F.end());
	reverse(F.begin(), F.end());

	ll l = -1, r = 1e13;
	while (r - l > 1) {
		ll mid = (l + r) / 2;
		ll sum = 0;
		REP(i,N) {
			ll t = max(0LL, (A[i] * F[i] - mid));
			ll x = t / F[i] + ((t % F[i]) > 0 ? 1 : 0);
			sum += x;
		}
		if (sum <= K) {
			r = mid;
		} else {
			l = mid;
		}
	}

	cout << r << endl;

    return 0;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 0x7ffffff;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll a, b, x;
	cin >> a >> b >> x;
	ll ans = b / x;
	ll res = a / x;
	ans -= res;
    if(a % x == 0) ans++;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll mod = 1000000007;
const ll mod998 = 998244353;
const ll intmax = 2147483647;
const ll llmax = 9223372036854775807;
const char sp = ' ';
const int dx[4] = { 0,0,1,-1 }, dy[4] = { 1,-1,0,0 };

struct point {
	double x, y;
};

int N;
double x[50], y[50], res;

double dist(double x1, double y1, double x2, double y2) {
	return sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
}

point func(int i, int j, int k) {
	double a, b, c, d, e, f;
	a = 2 * (x[j] - x[i]);
	b = 2 * (y[j] - y[i]);
	c = x[i] * x[i] + y[i] * y[i] - x[j] * x[j] - y[j] * y[j];
	d = 2 * (x[j] - x[k]);
	e = 2 * (y[j] - y[k]);
	f = x[k] * x[k] + y[k] * y[k] - x[j] * x[j] - y[j] * y[j];
	if (abs(b*d - a*e) < 0.0000001)return{ 0,0 };
	return{ (b*f - c*e) / (a*e - b*d),(a*f - c*d) / (b*d - a*e) };
}

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i];
	}
	res = 0xE869120E869120;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			point p = { (x[i] + x[j]) / 2,(y[i] + y[j]) / 2 };
			double d = 0;
			for (int l = 0; l < N; l++) {
				d = max(d, dist(p.x, p.y, x[l], y[l]));
			}
			res = min(res, d);
		}
	}
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			for (int k = j + 1; k < N; k++) {
				point p = func(i, j, k);
				double d = 0;
				for (int l = 0; l < N; l++) {
					d = max(d, dist(p.x, p.y, x[l], y[l]));
				}
				res = min(res, d);
			}
		}
	}
	printf("%.10f\n", res);
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define int ll
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
signed main(){
    int n; cin>>n;
    int ans=0;
    vector<int>v(n);
    rep(i,n)cin>>v[i];
    int sum=0;
    rep(i,n){
        if(v[i])sum+=v[i];
        else {ans+=sum/2;sum=0;}
    }
    ans+=sum/2;
    cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pii pair <int, int>
#define fi first
#define sc second
#define ALL(x) x.begin(), x.end()
#define RALL(X) x.begin(), x.end()
#define FOR(i, n, k) for(i=0; i<n; i+=k)
#define FO(i, n, k) for(i=1; i<=n; i+=k)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define N 100005
#define mid ((l+r)/2)
#define dbg(x) (cerr << #x << " : " << x << endl)
#define endl "\n"
#define MOD 100000009

using namespace std;

typedef long long int lli;

int main(){
	ios_base::sync_with_stdio(false);
	int a;
	cin >> a;
	string s;
	cin >> s;
	if(a >= 3200){
		cout << s;
	}else{
		cout << "red";
	}
	return 0;
}

Measured memory_bytes: 256