akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

int main(){
    int n,l;
    cin >> n >> l;
    int eat=INT_MAX;
    int res = 0;
    REP(i,n){
        if(abs(eat)>abs(l+i)){
            eat=l+i;
        }
        res+=l+i;
    }
    put(res-eat);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,e,x;
    int m=0;
    int f=0;
    scanf("%d",&n);
    if(n==1){
        printf("1");
        return 0;
    }
    for(int i=n;i>0;i--){
        x=i;
        while(x%2==0){
            x=x/2;
            m++;
        }
        if(m>f){
            e=i;
            f=m;
        }
        m=0;
    }
    printf("%d",e);
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.math.*;
import java.util.*;
public class Main { 

	public static void main(String[] args) { //Look for adjacent outliers first
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		int ans = Integer.MAX_VALUE;
		for (long i = 1; i <= Math.sqrt(N); i++) {
			if (N%i==0) {
				long BigFactor = N/i;
				ans = Math.min(ans, Long.toString(BigFactor).length());
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
#define rg register
#define oo 0x7fffffff
#define ll long long
using namespace std;
inline int read()
{
	int out=0,fh=1;
	char jp=getchar();
	while ((jp>'9'||jp<'0')&&jp!='-')
		jp=getchar();
	if (jp=='-')
		{
			fh=-1;
			jp=getchar();
		}
	while (jp>='0'&&jp<='9')
		{
			out=out*10+jp-'0';
			jp=getchar();
		}
	return out*fh;
}
const int MAXN=2e5+10;
int n,m;
vector<int> G[MAXN];
int del[MAXN]={0};
char buf[MAXN];
int Fa[MAXN],Fb[MAXN];
void Remove(int u)
{
	del[u]=1;
	for(rg unsigned ll int i=0;i<G[u].size();++i)
		{
			int v=G[u][i];
			if(del[v])
				continue;
			if(buf[u]=='A')
				Fa[v]--;
			else
				Fb[v]--;
			if(Fa[v]==0 || Fb[v]==0)
				Remove(v);
		}
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	n=read(),m=read();
	scanf("%s",buf+1);
	for(rg int i=1;i<=m;++i)
		{
			int u=read(),v=read();
			G[u].push_back(v);
			G[v].push_back(u);
			if(buf[v]=='A')
				{
					Fa[u]++;	
				}
			else
				{
					Fb[u]++;
				}
			if(buf[u]=='A')
				{
					Fa[v]++;
				}
			else
				{
					Fb[v]++;
				}
		}
	for(rg int i=1;i<=n;++i)
		if(del[i]==0&&(Fa[i]==0||Fb[i]==0))
			Remove(i);
	for(rg int i=1;i<=n;++i)
		if(del[i]==0)
			{
				cout<<"Yes";
				return 0;
			}
	cout<<"No";
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}


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

int main(){
  int N,M;
  cin >> N >> M;
  vector<int> vec(M);
  for(int i=0; i<M; i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  vector<int> div(M-1);
  for(int i=0; i<M-1; i++){
    div.at(i) = vec.at(i+1) - vec.at(i);
  }
  sort(div.begin(),div.end());
  int ans = 0;
  for(int i=0; i<M-N; i++){
    ans += div.at(i);
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
import math
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
mod = 10**9 + 7
N = int(input())
N = math.factorial(N)
div = factorize(N)
setdiv = set(div)
ans = 1
for d in setdiv:
    ans *= div.count(d) + 1
print(ans%mod)

Measured memory_bytes: 3064
/*
    AUTHOR:hruday pabbisetty
    NIT ROURKElA
*/
#include <bits/stdc++.h>
#include <tr1/unordered_map>
using namespace std;
using namespace std::tr1;
#define opt ios_base::sync_with_stdio(0)
#define lli long long int
#define ulli unsigned long long int
#define I int
#define S string
#define D double
#define rep(i,a,b) for(i=a;i<b;i++)
#define repr(i,a,b) for(i=a;i>b;i--)
#define in(n) scanf("%lld",&n)
#define in2(a,b) scanf("%lld %lld",&a,&b)
#define in3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define out(n) printf("%lld\n",n)
#define inu(a) scanf("%lld",&a)
#define outu(a) printf("%llu",a)
#define ins(s) scanf("%s",&s)
#define outs(s) printf("%s",s)
#define mod 1000000007
#define inf 100000000000000
typedef long long       ll;
typedef pair<lli,lli>  plli;
typedef vector<lli>     vlli;
typedef vector<ulli>    vulli;
typedef vector<ll>      vll;
typedef vector<string>  vs;
typedef vector<plli>     vplli;
#define MM(a,x)  memset(a,x,sizeof(a));
#define ALL(x)   (x).begin(), (x).end()
#define P(x)       cerr<<"{"#x<<" = "<<(x)<<"}"<<endl;
#define P2(x,y)       cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<"}"<<endl;
#define P3(x,y,z)  cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<"}"<<endl;
#define P4(x,y,z,w)cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<", "#w" = "<<(w)<<"}"<<endl;
#define PP(x,i)     cerr<<"{"#x"["<<i<<"] = "<<x[i]<<"}"<<endl;
#define TM(a,b)     cerr<<"{"#a" -> "#b": "<<1000*(b-a)/CLOCKS_PER_SEC<<"ms}\n";
#define UN(v)    sort(ALL(v)), v.resize(unique(ALL(v))-v.begin())
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define sz() size()
#define nl cout<<"\n"
#define MX1 100005
#define MX2 1000005
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
lli dx[]={0,0,-1,1,-1,-1,1,1};
lli dy[]={1,-1,0,0,1,-1,-1,1};
lli power(lli a,lli b)
    {
    lli value;
    if(b==0)
        {
        return 1;
    }
    else if(b%2==0)
        {
        value=power(a,b/2)%mod;
        return(value*value)%mod;
    }
    else
        {
        value=power(a,b/2)%mod;
        return ((a*value)%mod*(value))%mod;
    }
}
lli f(lli n)
{
    lli ans=0;
    while(n)
    {
        ans+=n%10;
        n/=10;
    }
    return ans;
}
int main()
{
      /*  #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        #endif*/
    opt;
    lli n,a,b;
    cin>>n>>a>>b;
    lli ans=0,i;
    rep(i,1,1+n)
    {
        if(f(i)>=a and f(i)<=b)
        {
            ans+=i;
        }
    }
    cout<<ans;
}


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

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

	vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i];

	const int m = 9;

	vector<int> p(m);
	p[0] = 1;
	for (int i = 1; i < m; i++) p[i] = 400 * i;

	vector<int> num(m, 0);
	int cnt = 0;

	for (int i = 0; i < n; i++) {

		int tmp = a[i];

		if (p[0] <= tmp && tmp < p[1]) num[0]++;
		else if (p[1] <= tmp && tmp < p[2]) num[1]++;
		else if (p[2] <= tmp && tmp < p[3]) num[2]++;
		else if (p[3] <= tmp && tmp < p[4]) num[3]++;
		else if (p[4] <= tmp && tmp < p[5]) num[4]++;
		else if (p[5] <= tmp && tmp < p[6]) num[5]++;
		else if (p[6] <= tmp && tmp < p[7]) num[6]++;
		else if (p[7] <= tmp && tmp < p[8]) num[7]++;
		else cnt++;

	}

	int ans = 0;
	for (int i = 0; i < m - 1; i++) {
		if (0 < num[i]) ans++;
	}

	if (ans == 0) {
		cout << 1 << " " << cnt << endl;
	}
	else {
		cout << ans << " " << ans + cnt<< endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long ll;

int main() {
    int X; cin >> X;
    int ans = 0;
    for(ll i=0; i<1e5; i++){
        if(i*(i+1)/2 >= X){
            ans = i;
            break;
        }
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int N,K;
  cin>>N>>K;
  if(N%2==0){
    if(N/2>=K){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }else{
    N=N+1;
    if(N/2>=K){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
<?php

    function compare($a, $b){

        if($a < $b){

            echo("a < b");

        }else if($a > $b){

            echo("a > b");

        }else if($a == $b){

            echo("a == b");
        }

    }

    $num = preg_split('/ /', trim(fgets(STDIN)));

    compare($num[0], $num[1]);

?>

Measured memory_bytes: 15424
//using System;
//class p0003
//{
//    static void Main(string[] args)
//    {
//        int cnt = int.Parse(Console.ReadLine());
//        while (0 < cnt--)
//        {
//            var ary = Console.ReadLine().Split(' ');
//            Array.Sort(ary);
//            var x = (int)Math.Pow(double.Parse(ary[0]), 2);
//            var y = (int)Math.Pow(double.Parse(ary[1]), 2);
//            var z = (int)Math.Pow(double.Parse(ary[2]), 2);
//            Console.WriteLine((x + y == z) ? "YES" : "NO");
//        }
//    }
//}


using System;
 
public class p0003{
     
    public static void Main(string[] args){
        int n;
        string str;
        string[] s;
        int[] a = new int[3];

        while ((str = Console.ReadLine()) != null)
        {
            n = int.Parse(str);

            while (0 < n--)
            {
                s = (Console.ReadLine()).Split(' ');
                for (int i = 0; i < 3; ++i)
                {
                    a[i] = int.Parse(s[i]);
                    a[i] = a[i] * a[i];
                }
                Console.WriteLine("{0}", ((a[0] == a[1] + a[2] || a[1] == a[0] + a[2] || a[2] == a[0] + a[1]) ? "YES" : "NO"));
            }
        }
    }
     
}

Measured memory_bytes: 5464
#include<bits/stdc++.h>
using namespace std;
long long two[50];
int a[200105],b[200105];
int n,ans;
map<int,int>cnt;
void st(){
	two[0]=1;
	for(int i=1;i<=32;i++)two[i]=two[i-1]*2;
}
int main(){
	st();
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++)cnt[a[i]]++;
	for(int i=1;i<=n;i++){
		int L=0,R=32;
		while(L<R){
			int mid=(L+R)/2;
			if(two[mid]<=a[i])L=mid+1;
			else R=mid;
		}
		b[i]=two[L]-a[i];
	}
	for(int i=n;i>=1;i--){
	    if(cnt[a[i]]){
	    	cnt[a[i]]--;
	    	if(cnt[b[i]])cnt[b[i]]--,ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 20608
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    A.sort()

    ma = A[-1]
    B = [False] * (ma + 1)

    ans = 0
    for i, a in enumerate(A):
        if B[a]:
            continue
        for aa in range(a, ma + 1, a):
            B[aa] = True

        if i != len(A) - 1 and A[i] == A[i + 1]:
            continue

        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 31428
import math
import sys
n = int(input())
a = list(map(int, input().split()))

ga = a[0]
for i in range(n):
  ga = math.gcd(ga, a[i])

if ga != 1:
  print("not coprime")
  sys.exit()

m = 1000000
b = [0]*(m+1)

for i in range(2, m):
  if b[i] != 0:
    continue
  j = 1
  while True:
    t = i * j
    if t > m:
      break
    if b[t] == 0:
      b[t] = i
    j += 1

d = {}
for i in a:
  p = i
  while p != 1:
    if p in d:
      print("setwise coprime")
      sys.exit()
    d[p] = 1
    p = int(p/b[p])
print("pairwise coprime")


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

using namespace std;

const int MOD=1e9+7;
const double PI=3.14159265359;


int main(){
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin>>n;
    vector<int> v(2*n);
    for(int&i:v)cin>>i;
    sort(v.begin(),v.end());
    int ans=0;
    for(int i=0; i<2*n; i+=2){
        ans+=v[i];
    }
    cout<<ans;
    
    
    return 0;
    
    
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),k=sc.nextInt(),ans=0;
		for(int i=1;i<=n;i++)
		{
			if(sc.nextInt()>=k)
				ans++;
		}
		System.out.println(ans);
	}

}


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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

constexpr int INF = 1e9;
constexpr ll INFLL = 1e18;
constexpr int MOD = 1e9 + 7;
const ld PI = acosl(-1);

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

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    //cout << fixed << setprecision(6);
    vll in1(2), in2(2);
    rep (i, 2) cin >> in1[i];
    rep (i, 2) cin >> in2[i];

    if (in1[0] < 0 && in1[1] > 0) in1.push_back(0);
    if (in2[0] < 0 && in2[1] > 0) in2.push_back(0);
    ll ans = -INFLL;
    for (ll t1 : in1) for (ll t2 : in2) {
        ans = max(ans, t1*t2);
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3616
A, B, C, D = map(int, input().split()) 
i = 0
while True:
    if i % 2 == 0:
        C -= B
        if C <= 0:
            print("Yes")
            break
    else:
        A -= D
        if A <= 0:
            print("No")
            break
    i += 1

Measured memory_bytes: 9176
#include <iostream>
#include <vector>
#include <iomanip> 
#include <cmath>
#include <algorithm>
#define EPS 0.5
using namespace std;

char itoc(int n);

int main(){

    unsigned long long N; cin >> N;
    unsigned long long len;

    unsigned long long i = 0;
    vector<unsigned long long> div;
    div.push_back(26);
    while(1){
        if(N <= div.at(i)){
            len = i+1;
            break;
        }
        div.push_back(div.at(i) + pow(26, i+2) + EPS);
        i++;
    }

    // 余り格納
    vector<char> md(div.size());

    unsigned long long j = 0;
    for(int i=0; i<len; i++){
        if(N < 26){
            md.at(i) = itoc(N);
        }
        else if(0 == N % 26){
            md.at(i) = itoc(0);
            N /= 26;
            N--;
        }
        else{
            md.at(i) = itoc(N % 26);
            N /= 26;
        }
    }

    for(int i=md.size()-1; i>=0; i--){
        cout << md.at(i);
    }



    return 0;
}

char itoc(int n){
    switch(n){
        case 1: return 'a';
        case 2: return 'b';
        case 3: return 'c';
        case 4: return 'd';
        case 5: return 'e';
        case 6: return 'f';
        case 7: return 'g';
        case 8: return 'h';
        case 9: return 'i';
        case 10: return 'j';
        case 11: return 'k';
        case 12: return 'l';
        case 13: return 'm';
        case 14: return 'n';
        case 15: return 'o';
        case 16: return 'p';
        case 17: return 'q';
        case 18: return 'r';
        case 19: return 's';
        case 20: return 't';
        case 21: return 'u';
        case 22: return 'v';
        case 23: return 'w';
        case 24: return 'x';
        case 25: return 'y';
        case 0: return 'z';
        default : return 'A';
    }
}

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

int main() {
    int h,w;
    cin>>h>>w;
    vector<string> s(h);
    vector<vector<bool>> f(h,vector<bool>(w,true));
    rep(i,h) cin>>s[i];
    int dx[4]={1,0,-1,0};
    int dy[4]={0,1,0,-1};
    rep(i,h) {
        rep(j,w) {
            if (s[i][j]!='#') continue;
            rep(dir,4) {
                int nh=i+dy[dir];
                int nw=j+dx[dir];
                if (nh<0||nh>=h||nw<0||nw>=w) continue;
                if (s[nh][nw]=='#') {
                    f[i][j]=false;
                    f[nh][nw]=false;
                }
            }
        }
    }
    rep(i,h) {
        rep(j,w) {
            if (s[i][j]=='#'&&f[i][j]) {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
}



Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstring>
#include <bitset>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>

int l, r;
long long ans = 0x7f7f7f7f;

int main()
{
    std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
    std::cin >> l >> r;
    if (r - l >= 673)
        std::cout << 0 << std::endl;
    else
    {
        for (int i = l; i < r; ++i)
        {
            for (int j = i + 1; j <= r; ++j)
            {
                ans = std::min(1ll * i * 1ll * j % 2019, ans);
            }
        }
        std::cout << ans << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define X first
#define Y second
const int maxn = 2e5 + 5;
const int maxv = 2000;
const ll mod = 1e9 + 7;
int n;
pii p[maxn];
ll cnt[maxv*2+10][maxv*2+10];
ll fac[maxv*4+10];
ll add(ll x, ll y) {
    return ((x+y)%mod + mod)%mod;
}
ll mul(ll x, ll y) {
    return ((x*y)%mod + mod)%mod;
}
ll inv(ll x, ll y) {
    return 1<x ? y - inv(y%x,x)*y/x : 1;
}
ll get(ll x, ll y) {
    return mul(fac[x+y], inv(mul(fac[x], fac[y]), mod));
}
int main() {
    fac[0] = 1;
    for(int i=1;i<=maxv*4;i++) fac[i] = mul(fac[i-1], i);
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d%d",&p[i].X,&p[i].Y);
    for(int i=1;i<=n;i++) cnt[maxv-p[i].X][maxv-p[i].Y]++;
    for(int i=0;i<=maxv*2;i++) {
        for(int j=0;j<=maxv*2;j++) {
            if(j) cnt[i][j] = add(cnt[i][j], cnt[i][j-1]);
            if(i) cnt[i][j] = add(cnt[i][j], cnt[i-1][j]);
        }
    }
    ll res = 0;
    for(int i=1;i<=n;i++) {
        res = add(res, add(cnt[maxv+p[i].X][maxv+p[i].Y],-get(p[i].X*2,p[i].Y*2)));
//        printf("%lld - %lld\n",cnt[maxv+p[i].X][maxv+p[i].Y],get(p[i].X*2,p[i].Y*2));
    }
    printf("%lld",mul(res,inv(2,mod)));
}


Measured memory_bytes: 127488
# python3
# -*- coding: utf-8 -*-
import sys
import math
#from math import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint

INF = float('inf')

ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
sys.setrecursionlimit(1000000000)


def lcm(a, b):
    return (a * b) // gcd(a, b)


# main
X,Y,Z = mis()
print("" + str(Z) + " " + str(X) + " " + str(Y))

Measured memory_bytes: 3936
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  int N; cin >> N;
  map<string, int> mp;
  rep(i, N){
    string s; cin >> s;
    mp[s]++;
  }
  int M; cin >> M;
  rep(i, M){
    string s; cin >> s;
    mp[s]--;
  }

  int ans = 0;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr){
    ans = max(ans, itr->second);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < (n); ++i)

using ll = long long;
using P = pair<int, int>;


int main() {
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    rep(i, n) cin >> p[i];
    sort(p.begin(), p.end());
    int ans = 0;
    rep(i, k) ans += p[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const ll MOD = (ll) 998244353;
const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

void finish() {
    cout << -1 << endl;
    exit(0);
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20) << setiosflags(ios::fixed);
    ll n;
    cin >> n;
    ll Min = LINF;
    for (ll i = 1; i <= sqrt(n) + 1; ++i) {
        ll j = n / i;
        if (i * j == n) {
            Min = min(Min, i + j - 2);
        }
    }
    cout << Min << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
//const ll mod =  1000000007;
//const ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvll = vector<vll>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------

int main(){
   ll a,b,c;
   cin>>a>>b>>c;
   ll ans=c-(a-b);
   if(ans>0){
    cout<<ans<<endl;
   }else cout<<0<<endl;
}
   



Measured memory_bytes: 256
using System;
using System.Linq;
class Program
{
static void Main(string[] args){
var d = Console.ReadLine().ToCharArray().Select<char,int>(c => c-'0').ToArray();
Console.WriteLine(d.Skip(2).Select((int v,int ind) => Math.Abs(753-(d[ind]*100+d[ind+1]*10+d[ind+2]))).Min());
}
}


Measured memory_bytes: 11348
import java.io.*;
import java.util.*;
class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        long debt=100000;
        for(int i=1;i<=n;i++){
            debt+=(debt/20);
            if(debt%1000!=0){
                debt-=debt%1000;
                debt+=1000;
            }
        }System.out.println(debt);
    }
    
}

Measured memory_bytes: 24208
function Main(input) {
	input = input.trim().split("\n").map((list)=>Number(list));
  var N = input[0];
  var H = input[1];
  var W = input[2];
  console.log((N - H + 1) * (N - W + 1));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21192
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    A = list(map(int,input().split()))
    mod = 10**9 + 7
    sum_A = sum(A)%mod
    ans = 0
    for a in A:
        sum_A -= a
        ans += a*sum_A%mod
    print(ans%mod)

if __name__=='__main__':
    main()

Measured memory_bytes: 31480
#include<bits/stdc++.h>
#define ll long long int
#define ve vector<int>
#define vl vector<long long int>
#define vs vector<string>
#define vve vector<vector<int>>
#define all(a) a.begin(),a.end()
using namespace std;

int main(){
  string a,b,s;
  cin>>a>>b;
  int al,bl;
  cin>>al>>bl>>s;
  if(a==s)al--;
  else if(b==s)bl--;
  cout<<al<<' '<<bl<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <fstream>
#include <typeinfo>
#include <sstream>
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define I insert
#define pb push_back
#define F first
#define S second
#define br "\n"
#define repi(i, a, b) for (ll i = a; i < b; i++)
#define repj(j, a, b) for (ll j = a; j < b; j++)
#define vi vector<int>
#define pii pair<int, int>
#define vpii vector<pii>
#define mod 1000000007
#define lim 100001
#define pi 3.14159265

using namespace std;

bool isPrime(ll n)
{
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
    return true;
}
ll factorial(ll n)      {    return (n == 1 || n == 0) ? 1 : n * factorial(n - 1); }
ll gcd(ll a, ll b)      {    if (a == 0)  return b; else return gcd(b % a, a);}
ll power(ll a, ll n)    {    if (n == 1) return a;else if (n == 0) return 1; else{ ll r = power(a, n / 2);if (n % 2 == 0)    return r * r;    else    return r * a * r;}}
ll nCr(ll n, ll r)      {    return ((factorial(n)) / (factorial(n - r) * factorial(r))); }
double precise(double n){    return floor(pow(10, 250) * n) / pow(10, 250);}

ll calculate(ll w,ll n, ll weights[], ll value[], vector<vll>& rec){
    if((w==0) or (n==-1)){
        return 0;
    }
    if(rec[w][n]!=-1){
        return (rec[w][n]);
    }
    ll weight = weights[n];
    if(weight>w){
        return  rec[w][n] = calculate(w, n - 1, weights,value,rec);
    }
    else{
    return rec[w][n] = max(calculate(w, n - 1, weights, value, rec), value[n] + calculate(w - weight, n-1, weights, value, rec));
    }
}

void solve(){
    ll n;
    ll w;
    cin >> n >> w;
    ll value[n], weights[n];
    for (int i = 0; i < n;i++){
        cin >> weights[i]>>value[i];
    }
    vector<vll> rec;
    for (int i = 0; i < w+1;i++){
        vll foo;
        rec.pb(foo);
        for (int j = 0; j < n; j++)
        {
            rec[i].pb(-1);
        }
    }
    ll ans = calculate(w, n-1, weights, value,rec);
    cout << ans << br;
}

int main()
{    
/*#ifndef ONLINE_JUDGE
    // for getting input from input.
    freopen("running_on_fumes_chapter_1_validation_input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif*/
    ll t;
	t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	//cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
	return 0;
}


Measured memory_bytes: 107128
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL)
#define ll long long
#define fm_t  ll t;cin>>t;while(t--)
#define fr(i,a,b) for( ll i=a;i<b;i++)
#define fr1(i,n,a) for( ll i=n-1;i>=a;i--)
#define sz(x) (ll)(x).size()
#define all(v)  (v).begin(), (v).end()
#define Sort(x) sort(x.begin(),x.end())
#define ms(a) memset(a,0,sizeof(a))
#define endl '\n'
#define pb push_back
#define ff first
#define ss second
const ll mod = 998244353;
#define Mod 1000000007

#define inf 1e18
#define ld long double
#define pll pair<ll, ll> 
#define vi vector<int>
#define vl vector<ll> 
#define vvl vector< vector<ll> > 
#define vvi vector< vector<int> >
#define vlp vector< pair<ll, ll> >
#define vllp vector<pair<ll, ll>, ll >
#define pi pair<ll, ll>
#define ppi pair<pair<ll, ll>, ll>
#define ump unordered_map<ll,ll>
#define pri priority_queue< pair<ll,ll> , vector< pair<ll,ll> >, greater< pair<ll,ll> > >
void ingraph(vl graph[], ll m){ll x, y;fr(i,0,m){cin>>x>>y;x--, y--;graph[x].pb(y);graph[y].pb(x);}}

#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)

//setprecision(10)
//greater<int>()
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}


ll modmulti(ll a, ll b){
   return ((a%mod)*1ll*(b%mod))%mod;
}
ll modadd(ll a, ll b){
   ll asdfgh =  ((a%mod)+(b%mod)+mod+mod)%mod;
   asdfgh = (asdfgh+mod)%mod;
   return asdfgh;
}
ll modpower(ll a, ll n){
   if(n==0) return 1;
   if(n==1) return a%mod;
   ll b = modpower(a,n/2);
   b = modmulti(b,b);
   if(n%2==0) return b;
   return modmulti(a,b);
}
ll modinv(ll a){
    return modpower(a,mod-2);
}

//ld ans=0;
ld dp[3005][3005];

ld solve(ld p[],ll h,ll i)
{

  if(h==0)
      return 1;
    if(i<0)
      return 0;
    

    if(dp[i][h]>-0.1)
      return dp[i][h];

    return dp[i][h]=p[i]*solve(p,h-1,i-1)+(1-p[i])*solve(p,h,i-1);



}   
int main()
{
      
  fast;
  ll n;
  cin>>n;
  ld p[n];
  for(ll i=0;i<3005;i++)
    for(ll j=0;j<3005;j++)
      dp[i][j]=-1;
  fr(i,0,n)
    cin>>p[i];
  ld ans=solve(p,(n+1)/2,n-1);

  cout<<setprecision(10)<<ans<<endl;

    
//cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
return 0;
}

Measured memory_bytes: 145136
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

typedef long long LL;

const int N=5005;
const int MOD=1000000007;

int n,cnt,last[N],f[N][N],g[N],tmp[N],size[N];
struct edge{int to,next;}e[N*2];

void addedge(int u,int v)
{
	e[++cnt].to=v;e[cnt].next=last[u];last[u]=cnt;
	e[++cnt].to=u;e[cnt].next=last[v];last[v]=cnt;
}

void dfs(int x,int fa)
{
	size[x]=f[x][1]=1;
	for (int i=last[x];i;i=e[i].next)
	{
		if (e[i].to==fa) continue;
		dfs(e[i].to,x);
		for (int j=1;j<=size[x]+size[e[i].to];j++) tmp[j]=0;
		for (int j=1;j<=size[x];j++)
			for (int k=1;k<=size[e[i].to];k++)
			{
				(tmp[j+k]+=(LL)f[x][j]*f[e[i].to][k]%MOD)%=MOD;
				if (!(k&1)) (tmp[j]+=MOD-(LL)f[x][j]*f[e[i].to][k]%MOD*g[k]%MOD)%=MOD;
			}
		size[x]+=size[e[i].to];
		for (int j=1;j<=size[x];j++) f[x][j]=tmp[j];
	}
}

int main()
{
	scanf("%d",&n);
	for (int i=1;i<n;i++)
	{
		int x,y;scanf("%d%d",&x,&y);
		addedge(x,y);
	}
	for (int i=2;i<=n;i+=2)
	{
		g[i]=1;
		for (int j=i-1;j>=1;j-=2) g[i]=(LL)g[i]*j%MOD;
	}
	dfs(1,0);
	int ans=0;
	for (int i=2;i<=n;i+=2) (ans+=(LL)f[1][i]*g[i]%MOD)%=MOD;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 97280
#include <stdio.h>
#include<stdlib.h>
 
int n,S[100000];

 
int main(){
  int q,i,cnt=0,start,end,mid,key;
 
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&S[i]);
    }
 
    scanf("%d",&q); 
    for(i=0;i<q;i++){
 
        scanf("%d",&key);
        start=0;
	end=n;
        while(start < end){
            mid = (start + end) / 2;
 
            if(S[mid] > key){
                end = mid;
            }
            else if(S[mid] < key){
                start = mid + 1;
            }
            else if(S[mid] == key){
                cnt++;
		break;
            }
        }
    }
    printf("%d\n",cnt);
 
    return 0;
}



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

#define FILE
#define fr first
#define se second

using namespace std;

const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

int n;
vector<int> a;
int main()
{
    #ifdef FILEs
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);

    cin >> n;
    for(int i = 1; i <= n; i ++){
        int x;
        cin >> x;
        a.push_back(x);
    }
    if((int)(set<int> (a.begin(), a.end())).size() == n){
        cout << "YES\n";
    }
    else{
        cout << "NO\n";
    }
}


Measured memory_bytes: 10356
#include<stdio.h>
#include<stdlib.h>

int linearSearch(int * ,int, int);

int main(){

  int i,cnt=0;
  int n,*S,q,*T;

  //入力
  scanf("%d",&n);
  S=(int *)malloc(sizeof(int)*n);
  for(i=0;i<n;i++) scanf("%d",&S[i]);
  scanf("%d",&q);
  T=(int *)malloc(sizeof(int)*q);
  for(i=0;i<q;i++) scanf("%d",&T[i]);


  //search
  for(i=0;i<q;i++)  cnt+=linearSearch(S,T[i],n);

  //表示
  printf("%d\n",cnt);

  return 0;
}
int linearSearch(int *A,int key,int n){

  int i=0;
  A[n]=key;
  while(A[i]!=key){
    i++;
    if(i==n) return 0;
  }

  return 1;
}

Measured memory_bytes: 636
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<ll,ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
}
signed main(){
  init_io();
  ll n,k;
  cin >> n >> k;
  vector<ll> a(n),pre(n,-1);
  for(int i=0;i<n;i++){
    cin >> a[i];
    a[i]--;
  }
  ll p = 0,cnt=0;
  while(k!=0){
    if(pre[p]==-1){
      pre[p] = cnt;
      cnt++;
      p = a[p];
      k--;
    }else{
      ll dis = cnt-pre[p];
      cnt += (k/dis)*dis;
      k %= dis;
      break;
    }
  }
  while(k!=0){
    k--;
    p = a[p];
  }
  cout << p+1<<endl;
}


Measured memory_bytes: 6368
N = int(input())

 
# 隣接リスト
l = [[] for i in range(N+1)]

def tuika(l,a,b):
    l[a].append(b)
    l[b].append(a)

kisuu = [[] for i in range(N+1)] 
guusuu = [[] for i in range(N+1)]
for i in range(N-1):
    u,v,w = map(int,input().split())
    if w%2== 0:
        tuika(guusuu, u, v)
    else:
        tuika(kisuu, u, v)


colors = [0 for i in range(N+1)]

stack = [1]
colors[1] = 1
while stack:
    node = stack.pop()
    for next_node in guusuu[node]:
        if colors[next_node]==0:
            stack.append(next_node)
            colors[next_node] = colors[node]
            
    for next_node in kisuu[node]:
        if colors[next_node]==0:
            stack.append(next_node)
            colors[next_node] = - colors[node]
            
            
#         else:
#             if nodes_color[next_node]==nodes_color[node]:
#                 nibu = False
#                 break
#     if not nibu:
#         break

colors_modify = [1 if x ==1 else 0 for x in colors[1:] ]

for c in colors_modify:
    print(c)

Measured memory_bytes: 82720
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,s,f) for(int i=s;i<f;i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define endl "\n"
#define fcout cout<<fixed<<setprecision(15)
typedef pair<int, int> P;
struct edge { int to, cost; };

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; }

bool prime(int n) {
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0)return false;
    }
    return n != 1;
}
int gcd(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
int lcm(int x, int y) {
return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
    if (p == 0) return 1;
    if (p % 2 == 0) {
        int t = mod_pow(n, p / 2, m);
        return (t * t) % m;
    }
    return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a % b, y, x);
    y -= a / b * x;
    return d;
}
int modinv(int a, int m) {
    int b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
int modinv2(int a, int mod) {
    return mod_pow(a, mod - 2, mod);
}
int digit(int x) {
    int cnt = 0;
    while (x > 0) {
        cnt += x % 10;
        x /= 10;
    }
    return cnt;
}
int read() {
    int tmp;
    cin >> tmp;
    return tmp;
}
int xor128() {
    static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    int t = (x xor (x << 11));
    x = y; y = z; z = w;
    return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}
map<int, int> factaring(int x) {
    map<int, int>ans;
    int now = 2;
    while (now * now <= x) {
        if (x % now == 0) {
            x /= now;
            ans[now]++;
        }
        else now++;
    }
    if (x != 1) ans[x]++;
    return ans;
}
int comb(int n, int k, int mod) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    k = min(k, n - k);
    int x = 1, y = 1;
    rep(i, k) {
        y *= i + 1;
        y %= mod;
    }
    for (int i = n - k + 1; i <= n; i++) {
        x *= i;
        x %= mod;
    }
    return x * modinv(y, mod) % mod;
}

signed main() {
    //srand((unsigned)time(NULL));

    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int x = (a + d - 1) / d;
    int y = (c + b - 1) / b;
    //cout << x << " " << y << endl;
    if (y <= x) {
       cout << "Yes" << endl;
    }
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3616
#include <iostream>

using namespace std;

int main()
{
    int a,b,c,d,e,k,s[10],i,flag=0;
    cin>>a>>b>>c>>d>>e>>k;
    s[0]=b-a;
    s[1]=c-a;
    s[2]=d-a;
    s[3]=e-a;
    s[4]=c-b;
    s[5]=d-b;
    s[6]=e-b;
    s[7]=d-c;
    s[8]=e-c;
    s[9]=e-d;
    for(i=0;i<10;i++)
    {
        if(s[i]<=k)
            flag=1;
        else
        {
            flag=0;break;
        }
    }
    if(flag==1)
        cout<<"Yay!"<<endl;
    else
        cout<<":("<<endl;
    return 0;
}


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

using namespace std;

int main(void) {
    int64_t H, W, N;
    cin >> H >> W >> N;
    map<pair<int,int>, int> mp;
    while(N--) {
        int a, b;
        cin >> a >> b;
        mp[make_pair(a-1, b-1)]++;
        mp[make_pair(a-1, b)]++;
        mp[make_pair(a-1, b+1)]++;
        mp[make_pair(a, b-1)]++;
        mp[make_pair(a, b)]++;
        mp[make_pair(a, b+1)]++;
        mp[make_pair(a+1, b-1)]++;
        mp[make_pair(a+1, b)]++;
        mp[make_pair(a+1, b+1)]++;
    }

    vector<int64_t> ans(10);
    for(auto e: mp) {
        if(e.first.first < 2 || e.first.first > H-1 || e.first.second < 2 || e.first.second > W-1) continue;
        ans[e.second]++;
    }
    ans[0] = (H-2)*(W-2) - accumulate(ans.begin(), ans.end(), 0L);

    for(auto e: ans) {
        cout << e << endl;
    }
    return 0;
}


Measured memory_bytes: 56448
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define endl "\n"

int main()
{
  i64 N;
  cin >> N;
  vector<i64> A(N);
  for (i64 i = 0; i < N; i++)
    cin >> A[i];
  i64 ans = 0, m = A[0];
  for (i64 i = 1; i < N; i++)
  {
    ans += max(0LL, m - A[i]);
    m = max(m, A[i]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4820
import numpy as np
 
stdin = open(0)
data = np.fromstring(stdin.read(), np.int32, sep=' ')
A,B,C = data

if A == B:
  if A != C:
    print('Yes')
    exit()
if A == C:
  if A != B:
    print('Yes')
    exit()
if B == C:
  if B != A:
    print('Yes')
    exit()
print('No')

Measured memory_bytes: 14276
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    input_raw = read_func().strip().split()
    L = []
    for i in range(N):
        L.append(long(input_raw[i]))

    L.sort()

    lmax = L.pop()

    if lmax < sum(L):
        print "Yes"
    else:
        print "No"


if __name__ == '__main__':
    main()


Measured memory_bytes: 3056
s = int(input())
if s <= 10**9:
    print('1', '0', '0', str(s), 0, 0)
else:
    if s % 10**9 == 0:
        print(s//10**9, 0, 0, 10**9, 0, 0)
    else:
        about = s // 10**9 + 1
        amari = s % 10**9
        print(10**9-amari, about, 10**9, 1, 0, 0)

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

int main(){
    int N;
    cin >> N;
    vector<long long> A(N);
    for(int i=0; i<N; i++) cin>>A[i];
    vector<long long> CS(N+1), CX(N+1);
    for(int i=0; i<N; i++){
        CS[i+1] = CS[i] + A[i];
        CX[i+1] = CX[i] ^ A[i];
    }
    long long l=1, r=1;
    long long res = 0;
    for(l=1; l<=N; l++){
        while(r<=N && (CS[r]-CS[l-1])==(CX[r]^CX[l-1])){
            r++;
        }
        res += r-l;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 4992
#include <cassert>
#include <iostream>
#include <map>
#include <vector>

template<typename T>
class LineSet {
private:
  std::map<T,T> L;// 傾き→切片
  T max_a, min_a;
public:
  LineSet(T ai) : L(), max_a(-ai), min_a(ai) {}
  void push(T a, T b){// push ax + b
    min_a = std::min(min_a,a);
    max_a = std::max(max_a,a);
    
    if(L.empty()){
      L[a] = b;
      return;
    }
    
    if(L.size() == 1){
      if(L.find(a) != L.end())
        L[a] = std::min(L[a],b);
      else
        L[a] = b;
      return;
    }

    if(a == min_a or a == max_a){
      if(L.find(a) != L.end())
        L[a] = std::min(L[a],b);
      else
        L[a] = b;
    }

    if(L.find(a) == L.end()){
      auto ll = L.lower_bound(a);
      auto lr = prev(ll);
      if((a-lr->first)*(b-ll->second) >= (ll->first-a)*(lr->second-b))
        return;
      L[a] = b;
    }else{
      L[a] = std::min(L[a],b);
    }

    if(L.find(a) == L.end() or L[a] != b){
      return;
    }
    
    while(1){
      auto ll = L.find(a);
      if(ll == L.begin()) break;
      auto lm = prev(ll);
      if(lm == L.begin()) break;
      auto lr = prev(lm);
      if((lm->first-lr->first)*(lm->second-ll->second) < (ll->first-lm->first)*(lr->second-lm->second))
        break;
      L.erase(lm);
    }
    while(1){
      auto lr = L.find(a);
      auto lm = next(lr);
      if(lm == L.end()) break;
      auto ll = next(lm);
      if(ll == L.end()) break;
      if((lm->first-lr->first)*(lm->second-ll->second) < (ll->first-lm->first)*(lr->second-lm->second))
        break;
      L.erase(lm);
    }
  }
  T get(T x){
    // T ans = 2e18;
    // for(auto [a, b] : L){
    //   ans = std::min(ans,a*x+b);
    // }
    // return ans;
    if(L.size() == 1){
      auto [a, b] = *L.begin();
      return a*x + b;
    }
    T la = min_a, ra = max_a;
    while(ra-la > 1){
      T m = (la+ra)/2;
      auto r = L.upper_bound(m);
      assert(r != L.begin());
      assert(r != L.end());
      auto l = prev(r);
      if(l->first*x+l->second < r->first*x+r->second){
        ra = l->first;
      }else{
        la = r->first;
      }
    }
    auto [a, b] = *L.lower_bound(la);
    T ret = a*x+b;
    auto itr = L.lower_bound(la);
    if(itr != L.end() and next(itr) != L.end()){
      auto nex = next(itr);
      ret = std::min(ret,nex->first*x + nex->second);
    }
    if(itr != L.begin()){
      auto pre = prev(itr);
      ret = std::min(ret,pre->first*x + pre->second);
    }
    return ret;
  }
};


#include <iostream>
#include <vector>
using namespace std;

int main(){
  long long N, C;
  cin >> N >> C;
  vector<long long> H(N);
  LineSet<long long> cht(1e9);
  for(int i = 0; i < N; ++i){
    cin >> H[i];
  }
  vector<long long> dp(N);
  cht.push(-2*H[0],H[0]*H[0]);
  for(int i = 1; i < N; ++i){
    dp[i] = cht.get(H[i]) + H[i]*H[i] + C;
    cht.push(-2*H[i],dp[i]+H[i]*H[i]);
  }
  cout << dp.back() << endl;
}


Measured memory_bytes: 18784
#include <iostream>
#include<algorithm>
using namespace std;

int fre[1000000+1];
int main()
{
    cin.tie(0);
    cin.sync_with_stdio(0);
    int n,x,a; cin>>n>>x;
    long long s=0;
    for(int i=0;i<x;i++){
            cin>>a;
            s+=a;
    }
    if(s>n) cout<<-1;
    else cout<<n-s;
}


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

using namespace std;

const int MAXN = 302;

int n;
double dp[MAXN][MAXN][MAXN];

double solve(int x, int y, int z) {
  if(dp[x][y][z])
    return dp[x][y][z];

  if(!x && !y && !z)
    return dp[x][y][z] = 0;

  int total = x + y + z;
  dp[x][y][z] = (double)(n - total)/total;

  if (x) dp[x][y][z] += x*((solve(x-1, y, z)+1)/total);
  if (y) dp[x][y][z] += y*((solve(x+1, y-1, z)+1)/total);
  if (z) dp[x][y][z] += z*((solve(x, y+1, z-1)+1)/total);
  return dp[x][y][z];
}

int main() {
  int a[4] = {0};
  cin >> n;
  for(int i=1; i<=n; ++i) {
    int x;
    cin >> x;
    ++a[x];
  }
  cout.precision(10);
  cout << solve(a[1],a[2],a[3]) << '\n';
  return 0;
}


Measured memory_bytes: 215296
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10


		
#階乗#
lim = 10**5   #必要そうな階乗の限界を入力
fact = [1] * (lim+1)
for n in range(1, lim+1):
	fact[n] = n * fact[n-1] % mod

#階乗の逆元#
fact_inv = [1]*(lim+1)
fact_inv[lim] = pow(fact[lim], mod-2, mod)
for n in range(lim, 0, -1):
	fact_inv[n-1] = n*fact_inv[n]%mod

def C(n, r):
	if n < r:
		return 0
	else:
		return (fact[n]*fact_inv[r]%mod)*fact_inv[n-r]%mod

N, K = MAP()
A = LIST()
A.sort()

A_cnt = Counter(A)

P = list(A_cnt.keys())
p = list(A_cnt.values())

#print("P={}".format(P))
#print("p={}".format(p))

p_acc = list(accumulate(p))
p_acc_rev = list(accumulate(p[::-1]))

#print("p_acc={}".format(p_acc))
#print("p_acc_rev={}".format(p_acc_rev))

n = len(p)
T = [[0]*4 for _ in range(n)]

for i in range(n):
	T[i][0] = p_acc[i]

for i in range(1, n):
	T[i][1] = p_acc[i-1]

for i in range(n):
	T[(-i-1)][3] = p_acc_rev[i]

for i in range(1, n):
	T[(-i-1)][2] = p_acc_rev[i-1]

#for i in range(n):
#	print(T[i])

t = [0]*n

for idx, x in enumerate(T):
	t[idx] = (C(x[0], K) - C(x[1], K) + C(x[2], K) - C(x[3], K))%mod

ans = 0
for i in range(n):
	ans = (ans + P[i]*t[i]%mod)%mod

print(ans)



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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

char prev(char c) {
  if (c == 'a') return 'Z';
  if (c == 'A') return 'z';
  return c - 1;
}

char mae(char c, int n) {
  rep (i, n) c = prev(c);
  return c;
}

int main() {

  for (int n; cin >> n, n; ) {
    vector<int> xs(n);
    rep (i, n) cin >> xs[i];
    string s; cin >> s;
    const int m = s.size();
    rep (i, m) {
      s[i] = mae(s[i], xs[i % n]);
    }
    cout << s << endl;
  }

  return 0;
}

Measured memory_bytes: 1208