akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdlib.h>

typedef long long ll;
#define N_MAX 100000

int cmp(const void *a, const void *b)
{
	const int *pa, *pb;
	pa=a;
	pb=b;
	if(*pa>*pb) return -1;
	return (*pa<*pb);
}


void combsort(int a[], int n)
{
	int h, t, i, c;

	h=n*10/13;
	for(;;)
	{
		c=0;
		for(i=0;i+h<n;i++)
		{
			if(a[i]<a[i+h])
			{
				t=a[i];
				a[i]=a[i+h];
				a[i+h]=t;
				c=1;
			}
		}
		if(h>1)
		{
			h=h*10/13;
		}
		else
		{
			if(!c) break;
		}
	}
}


int main(void)
{
	int N, i;
	static int a[N_MAX*3];
	ll sum;

	while(scanf("%d", &N)==1)
	{
		for(i=0;i<3*N;i++)
		{
			scanf("%d", &a[i]);
		}
		combsort(a, 3*N);

		sum=0;
		for(i=0;i<N;i++)
		{
			sum+=a[i*2+1];
		}
		printf("%lld\n", sum);
	}

	return 0;
}


Measured memory_bytes: 1280
#include<iostream>
    #include<string>
    using namespace std;
     
    int main(){
      string a, b, c;
      
      cin >> a >> b >> c;
      
      if(a[a.length()-1] == b[0] && b[b.length()-1] == c[0]){
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N;
  bool four_color = false;
  
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    string color;
    cin >> color;
    
    if ( color == "Y" )
      four_color = true;
  }
  
  if ( four_color == true )
    cout << "Four" << endl;
  else
    cout << "Three" << endl;
       
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main{

	public static void main(String[] args) {


		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();


		if(N < 4){
			System.out.println("No");
		}else{

			boolean flag = check(false,N);
			if(flag){
				System.out.println("Yes");

			}else{
				System.out.println("No");
			}
		}


	}


	static	boolean check(boolean flag,int N){
		if(N == 0){
			return flag = true;
		}

		if(N < 0){
			return flag;
		}

		flag =  check(flag,N-4);
		flag = check(flag, N-7);

		return flag;


	}







}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	string s;
	cin>>s;
	
	for (auto &it:s){
		if (it=='?') it='D';
	}
	
	cout<<s<<endl;
}


Measured memory_bytes: 3796
#include <iostream>
using namespace std;
int n,a[4],k = 1, p;
int main()
{

    cin >> n;
    if(n < 1000 || n > 9999)
        return 0;
    for(int i=0;i<=3;i++)
    {
        a[i] = n % 10;
        n = n / 10;
    }
    bool c = true;
    for(int i=0;i<=2;i++)
    {
        if(a[i] == a[i+1])
            {
                k++;
                if(k == 3)
                {
                    cout << "Yes";
                    c = false;
                }
            }
        else
            k = 1;

    }
    if(c)
        cout << "No";
    return 0;
}


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

int main() {
    int N;
    std::cin >> N;
    std::vector<int> an;
    for (int i = 0; i < N; ++i) {
        int a;
        std::cin >> a;
        an.push_back(a);
    }
    std::cout << *std::max_element(an.begin(), an.end()) - *std::min_element(an.begin(), an.end()) << std::endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<string> blue(N);
  for(int i = 0; i < N; i++) cin >> blue.at(i);
  int M;
  cin >> M;
  vector<string> red(M);
  for(int i = 0; i < M; i++) cin >> red.at(i);

  int sum = 0;
  for(int i = 0; i < N; i++) {
    string s = blue.at(i);
    if(s == "") continue;

    int b = 0;
    for(int j = 0; j < N; j++) {
      if(blue.at(j) == s) {
        blue.at(j) == "";
        b++;
      }
    }
    
    for(int j = 0; j < M; j++) {
      if(red.at(j) == s) b--;
    }
    
    if(b > sum) sum = b;
  }
  
  cout << sum << endl;
}


Measured memory_bytes: 3588
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger ans = new BigInteger("1");
        boolean b = true;
        String[] s = new String[n];
        for (int i=0;i<n&&b;i++){
            s[i]=sc.next();
            if (s[i].equals("0")){
                b=false;
                ans=new BigInteger("0");
            }
        }
        for (int i=0;i<n&&b;i++){
            ans=ans.multiply(new BigInteger(s[i]));
            if (ans.toString().length()>18&& !ans.toString().equals("1000000000000000000")){
                b=false;
                ans = new BigInteger("-1");
            }
        }
        System.out.println(ans.toString());
    }
}


Measured memory_bytes: 69124
import java.util.NoSuchElementException
import java.lang.Math.*

fun main(args: Array<String>) {
    val scan = FastScanner()
    val a = scan.nextLong()
    val b = scan.nextLong()
    val c = scan.nextLong()
    if (a * b * c % 2 == 0L) {
        println(0)
    } else {
        println(min(min(a*b,a*c),b*c))
    }
}

class FastScanner {
    private val printable = 33..126
    val `in` = System.`in`
    val buffer = ByteArray(1024)
    var ptr = 0
    var buflen = 0
    fun hasNextByte(): Boolean {
        if (ptr < buflen) {
            return true
        } else {
            ptr = 0
            buflen = `in`.read(buffer)
            if (buflen <= 0) {
                return false
            }
        }
        return true
    }
    fun readByte(): Byte {
        return if (hasNextByte()) buffer[ptr++] else return -1
    }
    fun hasNext(): Boolean {
        while (hasNextByte() && buffer[ptr] !in printable) ptr++
        return hasNextByte()
    }
    fun next(): String {
        if (!hasNext()) throw NoSuchElementException()
        val sb = StringBuilder()
        var b = readByte()
        while (b in printable) {
            sb.appendCodePoint(b.toInt())
            b = readByte()
        }
        return sb.toString()
    }
    fun nextLong(): Long {
        if (!hasNext()) throw NoSuchElementException()
        var n = 0L
        var minus = false
        var b = readByte()
        if (b == '-'.toByte()) {
            minus = true
            b = readByte()
        }
        if (b !in '0'.toByte()..'9'.toByte()) {
            throw NumberFormatException()
        }
        while (true) {
            if (b in '0'.toByte()..'9'.toByte()) {
                n *= 10
                n += b - '0'.toByte()
            } else if (b == (-1).toByte() || b !in printable) {
                return if (minus) -n else n
            } else {
                throw NumberFormatException()
            }
            b = readByte()
        }
    }
    fun nextInt(): Int {
        val nl = nextLong()
        if (nl !in Integer.MIN_VALUE..Integer.MAX_VALUE) throw NumberFormatException()
        return nl.toInt()
    }
    fun nextDouble(): Double {
        return next().toDouble()
    }
}

Measured memory_bytes: 31132
import java.util.*;

// UVa 11504

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		
		if (a == b && b == c) {
			System.out.println(1);
		} else if (a == b || b == c || a == c) {
			System.out.println(2);
		} else {
			System.out.println(3);
		}
	}
}

Measured memory_bytes: 22740
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>

using namespace std;
typedef long long ll;
typedef pair<int,int>P;

vector<int> Y[100001];
int main()
{
	int N,M;
	cin>>N>>M;
	vector<P>PP;
	for(int i=0;i<M;i++)
	{
		int p,y;
		cin>>p>>y;
		Y[p].push_back(y);
		PP.push_back(make_pair(p,y));
	}
	for(int i=1;i<=N;i++)
		sort(Y[i].begin(),Y[i].end());
	for(auto it=PP.begin();it!=PP.end();it++)
	{
		int c=(*it).first;
		int y=(*it).second;
		printf("%06d%06d\n",c,lower_bound(Y[c].begin(),Y[c].end(),y)-Y[c].begin()+1);
	}
 	return 0;
}

Measured memory_bytes: 7796
//By Zank100
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define din(t) long long t;cin>>t;
#define in(t) cin>>t;
ll mul(ll a, ll b)
{
    return(((a%mod)*(b%mod))%mod);
}
ll modexp(ll b, ll e){
	ll res = 1;
	for(; e; b = b * b % mod, e >>= 1) if(e & 1) res = res * b % mod;
	return res;
}
ll modinv(ll a){
    ll x=mod-2;
	return modexp(a,x);
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	string s,t;
	in(s);in(t);
	ll ans=0;
	for(ll i=0;i<s.size();i++){
        if(s[i]!=t[i])ans++;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3784
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>

int main() {

        int n;
        std::cin >> n;
        std::vector<int> a_list(n);

        for (auto& v : a_list) {
                std::cin >> v;
        }

        std::sort(std::begin(a_list), std::end(a_list));

        std::cout << (a_list.back() - a_list.front()) << std::endl;

        return 0;
}

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

#ifdef LOCAL
#include "../dump.hpp"
#else
#define dump(...)
#endif

#define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;i++)
#define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;i++)
#define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;

const ll inf = 1ll<<62;
const ll mod = 1e9+7;

#define int ll

main()
{
  int n,w,h; cin >> n >> w >> h;
  vi a(w+1), b(h+1);

  rep(i,n){
    int x,y,c; cin >> x >> y >> c;
    a[max(0ll,x-c)]++;
    a[min(w,x+c)]--;
    b[max(0ll,y-c)]++;
    b[min(h,y+c)]--;
  }
  bool ansx = true, ansy = true;
  rep(i,w){
    if(a[i] == 0) ansx = false;
    a[i+1] += a[i];
  }
  rep(i,h){
    if(b[i] == 0) ansy = false;
    b[i+1] += b[i];
  }
  if(ansx or ansy) cout << "Yes\n";
  else cout << "No\n";
  dump(a,b);
}


Measured memory_bytes: 4424
#include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#define endl "\n"
using namespace std;

int main() 
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  float a, b;
  float c;
  cin >> a >> b;
  c = a / b;
  cout << c << endl;
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for ( int i=1; i<=int(n); i++ )  
#define MP make_pair
#define PB push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define X first
#define Y second
template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

typedef long long LL;
typedef long double LD;
const int INF = 0x3f3f3f3f;

template <class T>  
inline bool RD(T &ret) {  
        char c; int sgn;  
		if (c = getchar(), c == EOF) return 0;  
        while (c != '-' && (c<'0' || c>'9')) c = getchar();  
        sgn = (c == '-') ? -1 : 1 , ret = (c == '-') ? 0 : (c - '0');  
        while (c = getchar(), c >= '0'&&c <= '9') ret = ret * 10 + (c - '0');  
        ret *= sgn;  
        return 1;  
}  
template <class T>  
inline void PT(T x) {  
        if (x < 0) putchar('-') ,x = -x;  
        if (x > 9) PT(x / 10);  
        putchar(x % 10 + '0');  
}
typedef pair<LL, LL> pii;


const int N = 2e5 + 100;

char s[N];
map<int, int> dp;

int main() {
    scanf("%s", s);
    dp[0] = 0;
    int len = strlen(s);
    int cur = 0;
    for(int i = 0; s[i]; i ++) {
        int ch = s[i] - 'a', val = INF;
        cur ^= (1 << ch);
        if(dp.count(cur)) val = dp[cur] + 1;
        for(int bit = 0; bit < 26; bit ++) {
            int nxt = cur ^ (1 << bit);
            if(dp.count(nxt)) val = min(val, dp[nxt] + 1);
        }
        if(dp.count(cur)) dp[cur] = min(dp[cur], val);
        else dp[cur] = val;
        if(i == len - 1) printf("%d\n", val);
    }

}


Measured memory_bytes: 9856
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a1 = scan.nextInt();
    int a2 = scan.nextInt();
    int b1 = scan.nextInt();
    int b2 = scan.nextInt();
    while ((b1>0)&&(a1>0)){
      b1-=a2;
      a1-=b2;
    }
    if (b1<=0){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }
  }
}


Measured memory_bytes: 35748
function Main(input) {
  r = input.split(' ')[0] * 1
  d = input.split(' ')[1] * 1
  x = input.split(' ')[2] * 1
  for (i = 0; i < 10; i++) {
      x = r * x - d
      console.log(x)
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21320
base = 123
mod = 10**9+7
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
base_m = pow(base, N-1, mod)
ans = [True]*N
for k in range(30):
    tmp = []
    mask = 1<<k
    a_k = []
    a_k_r = []
    b_k = []
    for i in range(N):
        if a[i]&mask:
            a_k.append(1)
            a_k_r.append(0)
        else:
            a_k.append(0)
            a_k_r.append(1)
        if b[i]&mask:
            b_k.append(1)
        else:
            b_k.append(0)
    b_hash = b_k[0]
    a_hash = a_k[0]
    a_hash_r = a_k_r[0]
    for i in range(1, N):
        b_hash = (b_hash*base+b_k[i])%mod
        a_hash = (a_hash*base+a_k[i])%mod
        a_hash_r = (a_hash_r*base+a_k_r[i])%mod
    for i in range(N):
        if a_hash == b_hash or a_hash_r == b_hash:
            pass
        else:
            ans[i] = False
        a_hash = ((a_hash-a_k[i]*base_m)*base+a_k[i])%mod
        a_hash_r = ((a_hash_r-a_k_r[i]*base_m)*base+a_k_r[i])%mod
for i in range(N):
    if ans[i]:
        x = a[i]^b[0]
        print(i, x)



    


Measured memory_bytes: 144180
#include<bits/stdc++.h>
using namespace std;
#define il inline
#define rg register
#define ll long long
#define CL(a,b) memset(a,b,sizeof a)
const int N=2e5+7,inf=0x3f3f3f3f;
char s[N];
int a[N];
int black[N],white[N];
int main()
{
    //freopen("3.in","r",stdin);
  //  freopen("3.out","w",stdout);
    int n;
    scanf("%d",&n);
    scanf("%s",s);
    for(int i=0;i<n;i++)
        if(s[i]=='.')
        a[i+1]=0;
        else a[i+1]=1;
        int ans=inf;
    for(int i=1;i<=n;i++)
        if(a[i]==0)
        {
            white[i]=white[i-1]+1;
            black[i]=black[i-1];
        }
        else
        {
            black[i]=black[i-1]+1;
            white[i]=white[i-1];
        }
    for(int i=0;i<=n;i++)
        ans=min(black[i]+white[n]-white[i],ans);
        cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 2816
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
## libs ##
from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left
#======================================================#

def main():
    n, a, b = MII()
    if (b-a)%2 == 0:
        print((b-a)//2)
    else:
        if n-a < b-1:
            print((n-b+1)+(n-(a+(n-b+1)))//2)
        else:
            print(a+((b-a)-1)//2)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3564
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
typedef long long int lli;
typedef long long ll; 
typedef pair<ll, ll> pll; 
typedef pair<string, string> pss;   
typedef vector<pll> vop; 
typedef vector<ll> vl; 
typedef vector<vl> vvl;
#define REP(i,a,b) for(long long int i=a;i<b;i++)
#define REPR(i,a,b) for(long long int i=a;i>=b;i--)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define endl "\n"
#define mem(a,b) memset(a,b,sizeof(a))
#define mod 1000000007
ll dp[201][201];

ll gcd(ll a, ll b) 
{ 
    if (b == 0) 
        return a; 
    if(dp[a][b]!=-1)
    	return dp[a][b];
    else
    {
   		 dp[a][b]=gcd(b, a % b);
   		 dp[b][a]=dp[a][b];
   		 return dp[a][b];
    }  
      
} 

int main()
{
	fastIO;
	ll t,b=0;
	//cin>>t;
	t=1;
	while(t--)
	{
		ll n,ans=0;
		cin>>n;
		mem(dp,-1);
  		REP(i,1,n+1)
  		{
  			REP(j,1,n+1)
  			{
  				REP(k,1,n+1)
  				{
  					ll c=gcd(i,j);
  					ans+=gcd(c,k);
  				}
  			}
  		}
  		cout<<ans<<endl;
	}
	return 0;
}



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

int main() {
    ll n;
    cin >> n;
    string ans = "";

    while(n >= 1)
    {
        int a = n % 26;
        if (a == 0) {
            a = 26;
            n -= 1;
        }

        ans += 96 + a;
        
        n /= 26;
    }
    
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <cctype>
using namespace std;
#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

int a[200];
int chk(int n, int k){
    int ms = 0;
    rep(i,n-k+1){
        int p = 1;
        for(int j=i;j<i+k;j++){
            p *= a[j];
        }
        ms = max(ms, p);
    }
    return ms;
}

int main(){
    int n, k;
    while(cin>>n>>k && n){
        rep(i,n)cin>>a[i];
        int x = chk(n, k);
        int y=0;
        rep(i,n)rep(j,i){
            swap(a[i],a[j]);
            y = max(y,chk(n,k));
            swap(a[i],a[j]);
        }
        cout << y - x << endl;
    }
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
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 (a>b) { a = b; return 1; } return 0; }

int main(){
    ll N;
    string S;
    cin >> N >> S;
    ll max = 0;
    REP(i, N-1) {
        map<char, ll> M;
        ll c = 0;
        REP(s, i+1) M[S[s]] = 1;
        FOR(s, i+1, N) {
            if (M[S[s]]==1){
                c++;
                M[S[s]] = 2;
            }
        }
        chmax(max, c);
    }
    cout << max << "\n";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const int N=1e5+10;
int f[N];
struct node
{
    int x,y,cnt;
    node(int xx=0,int yy=0,int c=0):x(xx),y(yy),cnt(c){}
}no[N];
struct edge
{
    int from,to,w;
    edge(int s=0,int e=0,int ww=0):from(s),to(e),w(ww){}
}edg[N*10];
bool cmp1(node a,node b)
{
    return a.x<b.x;
}
bool cmp2(node a,node b)
{
    return a.y<b.y;
}
int find(int x)
{
    if(f[x]!=x) f[x]=find(f[x]);
    return f[x];
}
bool cmp(edge a,edge b)
{
    return a.w<b.w;
}
int main()
{
    int n,m=0;
    ll ans=0;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&no[i].x,&no[i].y),no[i].cnt=i;
    sort(no+1,no+n+1,cmp1);
    for(int i=1;i<n;i++)
    {
        edg[++m].from=no[i].cnt;
        edg[m].to=no[i+1].cnt;
        edg[m].w=min(abs(no[i].x-no[i+1].x),abs(no[i].y-no[i+1].y));
    }
    sort(no+1,no+n+1,cmp2);
    for(int i=1;i<n;i++)
    {
        edg[++m].from=no[i].cnt;
        edg[m].to=no[i+1].cnt;
        edg[m].w=min(abs(no[i].x-no[i+1].x),abs(no[i].y-no[i+1].y));
    }
    for(int i=1;i<=n;i++) f[i]=i;
    sort(edg+1,edg+m+1,cmp);
    int k=0;
    for(int i=1;i<=m;i++)
    {
        int s1=find(edg[i].from);
        int s2=find(edg[i].to);
        if(s1==s2) continue;
        f[s1]=s2;
        ans+=edg[i].w;
        k++;
        if(k==n-1) break;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 13568
N=int(input())
kekka=[]
for i in range(N):
    A,B=map(int,input().split())
    kekka.append([B,A])
kekka=sorted(kekka)
#print(kekka)
hour=0
task=0
for i in range(N):
    hour=kekka[i][0]
    task+=kekka[i][1]
    if hour <task:
        print("No")
        break
    if i==N-1:
        print("Yes")

Measured memory_bytes: 37272
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define F first
#define S second
#define ll long long
#define N 100010
using namespace std;
ll n,m,v,p,pos,mx,ans=0,q[N];
vector<ll> a;
bool check(int x)
{
	if(x<=pos)
	{
		return true;
	}
	ll lft=n-x,ttv=m*v,sum,xt,p;
	if(lft+mx+1>=v)
	{
		if(a[x]+m>=a[mx+1])
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	else
	{
		if(a[x]+m<a[mx+1])
		{
			return false;
		}
		ttv-=(lft+mx+1)*m;
		sum=q[x]-q[mx+1];
		xt=a[x]+m;
		xt=xt*(x-mx-1)-sum;
		ttv-=xt;
		if(ttv<=0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	return true;
}
int main(){
	ll i,x;
	cin>>n>>m>>v>>p;
	for(i=0;i<n;i++)
	{
		cin>>x;
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	reverse(a.begin(),a.end());
	q[0]=0;
	for(i=0;i<n;i++)
	{
		q[i+1]=q[i]+a[i];
	}
	i=0;
	//cout<<a[10]<<endl;
	while((i<p||a[i]==a[i-1])&&i<n)
	{
		i++;
	}
	pos=i-1;
	i=pos;
	while(a[i]==a[pos]&&i>=0)
	{
		i--;
	}
	mx=i;
	for(i=0;i<n;i++)
	{
		if(check(i))
		{
			ans++;
		}
	}
	cout<<ans<<endl;
	//cout<<pos<<" "<<mx<<endl;
	return 0; 
}

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

using namespace std;

#define ll long long
#define ff first
#define ss second
#define e endl

void solve() {
    ll n; cin >> n;
    ll d1[n], d2[n], f = 0;
    for(ll i = 0;i < n;i++){
        cin >> d1[i] >> d2[i];
        if(i >= 2){
            if(d1[i] == d2[i]){
                if(d1[i-1] == d2[i-1]){
                    if(d1[i-2] == d2[i-2]) f = 1;
                }
            }
        }
    }
    if(f == 1) cout << "Yes\n";
    else cout << "No\n";
}

int main()
{
	//ll t; cin >> t; while (t--)
	solve();
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
//typedef vector<unsigned int>vec;
typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef vector<vector<int>> Graph;

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
//const ll MOD = 998244353;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> V(N);
    ll ans = 0;
    int pre = -1;
    V.push_back(-1);
    REP(i,N){
        cin >> V[i];
    }
    REP(i,N){
        if(V[i] >= V[i+1]) ans++;
    }
    cout << ans << endl;
    cout << N << endl;
}


Measured memory_bytes: 3624
#include "bits/stdc++.h"
using namespace std;
#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define PI 3.1415926535
typedef long long ll;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<Pll> vPll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<double>> vvd;
typedef vector<vector<Pi>> vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
string YN(bool y) { return (y?"YES":"NO"); }
string yn(bool y) { return (y?"Yes":"No"); }
string ON(bool y) { return (y?"OK":"NG"); }
int main(void)
{
	int n, m, size;
	
	cin>>n>>m;

	vi list;

	vPi edge(m);

	rep(i, m) cin>>edge[i].first>>edge[i].second;

	bool flag=false;

	sort(all(edge));

	int ptr=0;
	rep(i, m){
		if(edge[i].first==1){
			list.push_back(edge[i].second);
		}else{
			size=(int)list.size();
			while(size!=0&&ptr<size){
				if(edge[i].first==list[ptr]){
					if(edge[i].second==n){
						flag=true;
					}
					break;
				}else if(edge[i].first>list[ptr]){
					ptr++;
					if(ptr>=size) break;
				}else{
					break;
				}
			}
		}
		if(flag) break;
	}
	if(flag){
		cout<<"POSSIBLE"<<endl;
	}else{
		cout<<"IMPOSSIBLE"<<endl;
	}
}

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

const string YES = "Yes";
const string NO = "No";
using ll = long long;

void solve(long long D, long long T, long long S){
    if(1.0 * D / S <= T){
        cout<<YES<<endl;
    }else{
        cout<<NO<<endl;
    }
}

int main(){
    long long D;
    scanf("%lld",&D);
    long long T;
    scanf("%lld",&T);
    long long S;
    scanf("%lld",&S);
    solve(D, T, S);
    return 0;
}


Measured memory_bytes: 3760
//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define mp(a, b) make_pair(a, b)
#define F first
#define S second
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) (((a) + (b) - 1) / (b))
#define tomax(a, b) ((a) = max((a), (b)))
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}

//#define TEST

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;
using tiii = tuple<int, int, int>;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream& operator<<(ostream& o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

ll inv(ll a){
    ll base = a;
    ll ans = 1;
    ll now = MOD - 2;
    while(now){
        if(now & 1) ans = ans * base % MOD;
        base = base * base % MOD;
        now >>= 1;
    }
    return ans;
}

vector<ll> f(500001);
ll p(ll n, ll k){
    if(n < k) return 0;
    return f[n] * inv(f[n - k]) % MOD;
}
ll c(ll n, ll k){
    if(n < k) return 0;
    return f[n] * inv(f[n - k]) % MOD * inv(f[k]) % MOD;
}

int main(){
    StarBurstStream

    f[0] = 1;
    for(int i = 1; i <= 500000; i++) f[i] = f[i - 1] * i % MOD;

    int n, m;
    cin >> n >> m;

    ll ans = 0;
    ans += p(m, n);
    for(int i = 1; i <= n; i++){
        if(i % 2) ans -= p(m - i, n - i) * c(n, i);
        else ans += p(m - i, n - i) * c(n, i);
        ans = (ans % MOD + MOD) % MOD;
    }
    ans = ans * p(m, n) % MOD;
    cout << ans << "\n";

    return 0;
}

Measured memory_bytes: 7044
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define watch(x) cout << (#x) << " is " << (x) << endl

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

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

    vi W(N);
    rep(i, N) cin >> W[i];

    partial_sum(W.begin(), W.end(), W.begin());
    int ans = 1e9;
    rep(i, W.size()) ans = min(ans, abs(W.back() - 2 * W[i]));
    cout << ans << endl;

    return 0;
}


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

int main(){

  string s;
  cin >> s;
  int cnt = 0;
  for(int i=0;i<s.size();i++){
  	if(s[i]=='o')cnt++;
  }
  cout << (700+cnt*100) << endl;
  
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sort_(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; 0 <= i; i--)
#define for_(i, start, end) for (int i = start; i < end; i++)
#define rfor(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1'050'000'000;
constexpr long long INF64 = 4'000'000'000'000'000'000;
constexpr int MOD7        = 1'000'000'007;
constexpr int MOD53       = 998'244'353;
constexpr double PI       = 3.14159265358979323846;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

template <class T> vector<T> prime(T N) {
    vector<T> pri;
    vector<bool> is_prime;
    is_prime    = vector<bool>(N + 1, true);
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i < N + 1; i++) {
        if (is_prime[i]) {
            pri.push_back(i);
            for (int j = 2 * i; j < N + 1; j += i)
                is_prime[j] = false;
        }
    }
    return pri;
}

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

    int q;
    scan(q);
    vector<int> v((int)1e5 + 1);
    auto pri = prime((int)1e5 + 1);
    rep(i, pri.size()) {
        if (pri[i] % 2 == 1) {
            int nxt = (pri[i] + 1) / 2;
            if (*lower_bound(all(pri), nxt) == nxt) {
                v[pri[i]]++;
            }
        }
    }
    for_(i, 1, v.size()) { v[i] += v[i - 1] + v[i]; }
    rep(i, q) {
        int l, r;
        scan(l, r);
        print((v[r] - v[l - 1]) / 2);
    }

    return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define irep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
int main() {
    int a,b;
    cin>>a>>b;
    if(a==1) a=14;
    if(b==1) b=14;
    string ans="Draw";
    if(a>b) ans="Alice";
    if(a<b) ans="Bob";
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")  
#pragma GCC optimize ("-fno-defer-pop") 
#define ll long long int
#define ps push_back
#define pb pop_back
#define fs first
#define sc second
#define mkp make_pair
#define mod 1000000007
const int N=1e5;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	ll i,j,k,l,n;
	cin>>n;
	ll ar[n][3],an[n][3];
	for(i=0;i<n;i++){
		cin>>ar[i][0]>>ar[i][1]>>ar[i][2];
	}
	an[0][0]=ar[0][0];
	an[0][1]=ar[0][1];
	an[0][2]=ar[0][2];
	for(i=1;i<n;i++){
		for(j=0;j<3;j++){
			if(j==0){
				if(an[i-1][1]>an[i-1][2]){
					an[i][j]=ar[i][j]+an[i-1][1];
				}
				else {
					an[i][j]=ar[i][j]+an[i-1][2];
				}
			}
			else if(j==1){
				if(an[i-1][0]>an[i-1][2]){
					an[i][j]=ar[i][j]+an[i-1][0];
				}
				else {
					an[i][j]=ar[i][j]+an[i-1][2];
				}
			}
			else {
				if(an[i-1][1]>an[i-1][0]){
					an[i][j]=ar[i][j]+an[i-1][1];
				}
				else {
					an[i][j]=ar[i][j]+an[i-1][0];
				}
			}
		}
	}
	ll aa=max(an[n-1][0],max(an[n-1][1],an[n-1][2]));
	cout<<aa;
	return 0;
}

Measured memory_bytes: 4992
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.function.Predicate;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();

		int max = Math.max(a, b);
		max = Math.max(max, c);

		if (max == a + b + c - max) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

	//***********************以下共通関数************************************************
	/**
	 * 文字列を反転して返す
	 * @param pStr 文字列
	 * @return 反転した文字列
	 */
	public static String myReverse(String pStr) {
		if (pStr.length() < 1) {
			return "";
		}

		StringBuffer sb = new StringBuffer(pStr);
		return sb.reverse().toString();
	}

	/**
	 * 余りを求める。
	 * @param a
	 * @param b
	 * @return 余り。余りがマイナスの時はプラスで返す。
	 */
	public static long myMod(long a, long b) {
		long ret = 0;

		ret = a % b;

		if (ret < 0) {
			ret += b;
		}

		return ret;
	}

	/**
	 * 乗数を求める ※mod対応
	 * @param kisu 基数
	 * @param josu 乗数
	 * @param primeNumMod_0 法 mod値 使わない場合は「0」
	 * @return
	 */
	public static long myPowWithMod(long kisu, long josu, long primeNumMod_0) {

		long ans = 1;

		//乗数が0の場合→1
		if (josu == 0)
			return 1;

		if (primeNumMod_0 == 0) {
			//modを使わないとき

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= kisu;
					josu = josu / 2;
				} else {
					//累乗が奇数の時
					ans *= kisu;
					josu--;
				}
			}

			return ans;

		} else {
			//modを使うとき

			//初めに桁を落とす
			kisu = myMod(kisu, primeNumMod_0);

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= myMod(kisu, primeNumMod_0);
					josu = josu / 2;

				} else {
					//累乗が奇数の時
					ans *= myMod(kisu, primeNumMod_0);
					josu--;

				}
			}

			return myMod(ans, primeNumMod_0);

		}

	}

}


Measured memory_bytes: 27020
from math import cos, sqrt, radians
a, b, h, m = map(int, input().split())
angle = abs(h*30 - m*5.5)
angle = min(angle, 360 - angle)
angle = radians(angle)
c = sqrt(a**2 + b**2 - 2*a*b*cos(angle))
print(c)

Measured memory_bytes: 9436
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int p=0;
	for(int i=1;i<n-1;i++)
	{
		if(a[i]<a[i+1] && a[i]>a[i-1])
		{
			p++;
		}
		else if(a[i]>a[i+1] && a[i]<a[i-1])
		{
			p++;
		}
	}
	cout<<p<<endl;
}

Measured memory_bytes: 256
package main

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

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() (int, []int) {
	n := readInt()
	return n, readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int

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

func main() {
	defer stdout.Flush()
	x := readInt()
	if x == 1 {
		println("Hello World")
	} else {
		println(readInt() + readInt())
	}
}

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


Measured memory_bytes: 640
n = int(input())
a = list(map(int,input().split()))

ans = [0]*(n+1)
#for i in range(0, a[0]*2+1, 2):
#    ans[0] = i
while True:
    for j in range(n):
        ans[j+1] = (a[j] - ans[j]//2) *2
    if ans[0] == ans[n]:
        print(' '.join(map(str, ans[0:len(ans)-1])))
        exit(0)
    else:
        ans[0] += ans[n]//2


Measured memory_bytes: 19900
#include<stdio.h>

int strlen(char *a){for(int i=0;;i++)if(a[i]=='\0')return i;}

int main(){
	char a[4][100];
	scanf("%s%s%s",a[0],a[1],a[2]);
	int l1 = strlen(a[0]),l2=strlen(a[1]);
	if(a[0][l1-1]==a[1][0]&&a[1][l2-1]==a[2][0])puts("YES");
	else puts("NO");
	return 0;
}


Measured memory_bytes: 128
fn main() {
    let mut buf = String::new();
    let _ = std::io::stdin().read_line(&mut buf).ok();
    let n: usize = buf.trim().parse().unwrap();
    let mut g = Vec::new();
    for _ in 0..n {
        let mut buf = String::new();
        let _ = std::io::stdin().read_line(&mut buf).ok();
        let mut buf = buf.split_whitespace();
        let id: usize = buf.next().unwrap().parse().unwrap();
        let k: usize = buf.next().unwrap().parse().unwrap();
        let mut e = Vec::new();
        for _ in 0..k {
            let p: usize = buf.next().unwrap().parse().unwrap();
            e.push(p);
        }
        g.push((id,e));
    }
    let mut dis: Vec<i64> = vec![-1; n];
    dis[0] = 0;
    for distance in 0..n {
        for i in 0..n {
            if dis[i] == distance as i64 {
                for j in &g[i].1 {
                    if dis[*j-1] == -1 {
                        dis[*j-1] = distance as i64 + 1;
                    }
                }
            }
        }
    }
    //println!("{:?}", g);
    //println!("{:?}", dis);
    for (i, d) in dis.iter().enumerate() {
        println!("{} {}", i+1, d);
    }
}



Measured memory_bytes: 5032
#include <stdio.h>
int main()
{
    int A,B;
    scanf("%d %d",&A,&B);
    if(A+B>A-B)
    {
        if(A+B>A*B)
        {
            printf("%d\n",A+B);
        }
        else
        {
            printf("%d\n",A*B);
        }
    }
    else
    {
        if(A-B>A*B)
        {
            printf("%d\n",A-B);
        }
        else
        {
            printf("%d\n",A*B);
        }
    }
}


Measured memory_bytes: 128
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while (!(line = br.readLine()).equals("0 0")) {
            String[] input = line.split(" ");
            int H = Integer.parseInt(input[0]);
            int W = Integer.parseInt(input[1]);
            char[][] tiles = new char[H][W];
            boolean[][] b = new boolean[H][W];

            for (int i = 0; i < H; i++) {
                tiles[i] = br.readLine().toCharArray();
            }

            int posX = 0;
            int posY = 0;
            String result = "LOOP";

            while (!b[posY][posX]) {
                b[posY][posX] = true;
                if (tiles[posY][posX] == '.') {
                    result = posX + " " + posY;
                    break;
                } else if (tiles[posY][posX] == 'v') {
                    posY++;
                } else if (tiles[posY][posX] == '<') {
                    posX--;
                } else if (tiles[posY][posX] == '>') {
                    posX++;
                } else if (tiles[posY][posX] == '^') {
                    posY--;
                }
            }

            System.out.println(result);
        }
    }
}


Measured memory_bytes: 24500
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputs = new List<string>();

            // 入力が終わるまで全行読み込む
            for (int i = 0; i < 1; i++) 
            {

                string input = Console.ReadLine();
                if (input == null)
                    break;
                else
                    inputs.Add(input);
            };

            String[] temp = inputs[0].Split(' ');
            int r = int.Parse(temp[0]);
            int D = int.Parse(temp[1]);
            int x = int.Parse(temp[2]);

            for (int i = 0, y = x; i < 10; i ++ )
            {
                y = calc(r, D, y);
                Console.WriteLine(y);
            }

            return;
        }

        private static int calc (int r, int D, int x)
        {
            return r * x - D;
        }
    }
}


Measured memory_bytes: 11220
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import qualified Data.Text.Lazy.Read as T
import qualified Data.Vector.Unboxed as VU

main :: IO ()
main = do
  let
    modulus = 998244353 :: Int
    modAdd :: Int -> Int -> Int
    modAdd x y = (x + y) `mod` modulus
  [n, k] <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  lrs <- map (fmap succ . unsafeListToPair . map unsafeTextToInt . T.words) . T.lines <$> T.getContents :: IO [(Int, Int)]
  let
    (ls, rs) = unzip lrs :: ([Int], [Int])
    dp = VU.constructN n rec :: VU.Vector Int
      where
        rec :: VU.Vector Int -> Int
        rec v | l == 0    = 1
              | l == 1    = ((foldl modAdd 0 . map (v VU.!) . filter (0 <=). map (l -) $ ls) - (foldl modAdd 0 . map (v VU.!) . filter (0 <=) . map (l -) $ rs)) `mod` modulus
              | otherwise = (VU.last v + (foldl modAdd 0 . map (v VU.!) . filter (0 <=). map (l -) $ ls) - (foldl modAdd 0 . map (v VU.!) . filter (0 <=) . map (l -) $ rs)) `mod` modulus
          where
            l = VU.length v :: Int
  print . VU.last $ dp

unsafeListToPair :: [Int] -> (Int, Int)
unsafeListToPair = (,) <$> head <*> head . tail
{-# INLINE unsafeListToPair #-}

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}


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






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

        int array[size];
        int value[size];
        for(int i=0; i<size; i++){
                int next; cin >> next;
                value[i]=next;
        }

        for(int i=0; i<size; i++){
                array[i]=INT_MAX;
        }
        array[0]=0;
        for(int i=0; i<size; i++){
                if( (i+1) < size){
                        array[i+1]=min(array[i+1], array[i]+abs(value[i]-value[i+1]));
                }
                if((i+2) < size){
                        array[i+2]=min(array[i+2],array[i]+abs(value[i]-value[i+2]));
                }

        }


        cout << array[size-1];

}

Measured memory_bytes: 4380
import itertools
import numpy as np
H, W = map(int, input().split())
arr = []
for _ in range(H):
    S = input().split()
    S = [int(s) for s in S]
    arr.append(S)
x = list(itertools.combinations(arr,2))
count = 0
for i in range(len(x)):
    vec_a = np.array(x[i][0])
    vec_b = np.array(x[i][1])
    d = np.linalg.norm(vec_a - vec_b)
    d2 = int(d)
    if d == d2:
        count+=1
print(count)
print()

Measured memory_bytes: 12456
class SegmentTree
  def initialize(n)
    @sz=1
    while @sz<n
      @sz*=2
    end
    @seg=Array.new(2*@sz-1){0}
    @root=0
    @nil=-1
  end

  attr_accessor :seg

  def max(a, b, i=@root, l=0, r=@sz)
    if b<=l or r<=a
      @nil
    elsif a<=l and r<=b
      @seg[i]
    else
      m=(r+l)/2
      vl=max(a, b, 2*i+1, l, m)
      vr=max(a, b, 2*i+2, m, r)
      [vl, vr].max
    end
  end

  def update(i, data)
    i+=@sz-1
    @seg[i]=data
    while i.nonzero?
      i=(i-1)/2
      @seg[i]=[@seg[2*i+1], @seg[2*i+2]].max
    end
  end

  def answer
    @seg[@root]
  end
end


n=gets.to_i
a=[]
n.times do |i|
  e=gets.to_i
  a<< [e, -i]
end

b=a.sort_by do |_a|
  [_a[0], _a[1]]
end

st=SegmentTree.new(n)
b.each do |_b|
  i=-_b[1]
  st.update(i, st.max(0, i+1)+1)
end

puts st.answer

Measured memory_bytes: 23824