akhauriyash/Code-Regression huggingface dataset:
package main
  
import (
    "fmt"
)

const mod = 2019

func main() {
    var l, r int
    fmt.Scan(&l, &r)
    ml := l % mod
    mr := r % mod
    if r-l >= mod {
        fmt.Println(0)
    } else if ml > mr {
        fmt.Println(0)
    } else {
        var min = 2019 * 2019
        for i := ml; i < mr; i++ {
            for j := i + 1; j <= mr; j++ {
                m := (i * j) % mod
                if m < min {
                    min = m
                }
            }
        }
        fmt.Println(min)
    }
}


Measured memory_bytes: 512
class Array
  def sum
    return self.inject(0){|acc,x| acc+x}
  end

  def ave
    return self.sum.to_f / self.length
  end

end
fh=STDIN
v=[]
while fh.gets do
  f=$_.chomp.split(/,/).map{|x|x.to_i}
  v.push(f)
end
puts v.map{|x|x[0]*x[1]}.sum
puts v.map{|x|x[1]}.ave.round

Measured memory_bytes: 8768
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> P; 
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

vector<int> v,u;
int a[2222];

int main(void){
	int n,i,j,k,m,q,ans=INF;
	cin >> n >> m >> q;
	for(i=0; i<n; ++i){
		cin >> a[i];
	}
	for(i=0; i<=n; ++i){
		for(j=0; j<=n; ++j){
			if(a[j]>a[i]){
				v.push_back(a[j]);
				continue;
			}
			sort(v.begin(),v.end(),greater<int>());
			for(k=m-1; k<v.l_ength(); ++k){
				u.push_back(v[k]);
			}
			v.clear();
		}
		sort(u.begin(),u.end());
		if(u.l_ength()>=q){
			ans = min(ans,u[q-1]-u[0]);
		}
		u.clear();
	}
	cout << ans << endl;
	return 0;
}


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

public class Main {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer stok;

    String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    char nextChar() throws IOException {
        return (char) (br.read());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    final double EPS = 1e-10;

    class Pair implements Comparable<Pair>{
        int x, y;

        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o) {
            return o.x - this.x;
        }
    }
    void solve() throws IOException {
        int n = nextInt();
        int k = nextInt();
        long ans = 0;
        Pair[] pairs = new Pair[n];
        for (int i = 0; i < n; i++) {
            pairs[i] = new Pair(nextInt(), nextInt());
            if ((pairs[i].x | k) == k) {
                ans += pairs[i].y;
            }
        }
        for (int i = 0; i <= 30; i++) {
            if ((k & (1 << i)) > 0) {
                int t = ((k >> (i + 1))  << (i + 1)) | ((1 << i) - 1);
                long cur = 0;
                for (int j = 0; j < n; j++) {
                    if ((pairs[j].x | t) == t) {
                        cur += pairs[j].y;
                    }
                }
                ans = Math.max(ans, cur);
            }
        }
        out.println(ans);

    }

    void run() throws IOException {
        // br = new BufferedReader(new FileReader("dragons.in"));
        //out = new PrintWriter("dragons.out");
        // br = new BufferedReader(new FileReader("input.txt"));
        // out = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        br.close();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        // Locale.setDefault(Locale.US);
        new Main().run();
    }
}

Measured memory_bytes: 45260
# -*- coding: utf-8 -*-
"""
http://abc066.contest.atcoder.jp/tasks/arc077_a

"""
import sys
from sys import stdin
input = stdin.readline



def main(args):
    n = int(input())
    a = [int(x) for x in input().split()]

    #b = []
    #for i in range(1, n+1):
    #    b.append(a[i-1])
    #    b.reverse()
    #print(*b)

    l = len(a)
    b = [0] * l
    pos = l // 2
    if l % 2 == 1:
        direction = 1
    else:
        direction = -1

    step = 1
    for c in a:
        # print('pos: {}, step: {}, direction: {}'.format(pos, step, direction))
        b[pos] = c
        pos = pos + (step * direction)
        step += 1
        direction *= -1
        # print(*b)
    print(*b)



if __name__ == '__main__':
    main(sys.argv[1:])

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

#define INF 1 << 29
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)

using namespace std;

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

void gen_sosuu(int sosuu[]){
  REP(i,100010){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(100000)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<=100000;j++){
      //printf("%d %d %d\n",i*j,i,j);
      sosuu[i*j] =false;
    }
  }
}

int a,b,c;

int main(){
  cin >> a>>b>>c;
  if(a+b>=c){
    cout << "Yes\n";
  }else{
    cout << "No\n";
  }
}


Measured memory_bytes: 256
import queue
k = int(input())
q = [1,2,3,4,5,6,7,8,9]
qq = queue.Queue()
for i in range(1,10):
	qq.put(i)

for i in range(k):
	x = qq.get()
	if x%10 != 0:
		qq.put(10*x + (x%10) -1)
	qq.put(10*x + (x%10))
	if x%10 != 9:
		qq.put(10*x + (x%10) +1)
		
print(x)
		

Measured memory_bytes: 12452
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;

struct res{
	string a;
	ll score;
	ll index;
	bool operator <(const res& rhs) const{
		if (rhs.a == a){
			return score > rhs.score;
		}
		return a < rhs.a;
	}
};

int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll n;
    cin >> n;
    vector <res> arr(n);
    for (int z=0;z<n;z++){
    	cin >> arr[z].a >> arr[z].score;
    	arr[z].index = z+1;
    }
    sort(arr.begin(),arr.end());
    for (res i : arr){
    	cout << i.index << endl;
    }
    cin >> n;
}

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

//#define Fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
typedef vector<int>Vl;
typedef pair<int,int>PII;
typedef vector<PII>Vll;
typedef vector<pair<int,pair<int,int> > >Vlll;
typedef priority_queue<int>PQL;
typedef map<int,int>MP;
#define S second
#define F first
#define mp make_pair
#define ms(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define sl(n) scanf("%lld",&n)
#define pl(n) printf("%lld",n)
const int mod=1e9+7;
const int sze=1e5+2;
map<int,int>possible;
bool valid(int num2){
  string num=to_string(num2);
  int len=num.length();
  bool check=true;
  for(int i=0;i<len;i++){
	  int numi=(int)(num[i]-'0');
	  if(possible[numi]==0){
		  check=false;
		  break;
	  }      
  }	
	return check;
	
}

signed main(){
  int N,K,num1;
  sl(N);sl(K);
  bool hai[10];
  ms(hai,false);
  for(int i=0;i<K;i++){
	  sl(num1);
	  hai[num1]=true;
  }
  possible.clear();
  for(int i=0;i<=9;i++){
	  if(hai[i]==false)possible[i]++;
  }
  for(int i=N;;i++){
	  if(valid(i)){
		  cout<<i<<endl;
		  break;
	  }
	  
  }
  
  return 0;
}


Measured memory_bytes: 256
from functools import reduce

n = int(input())

numeros = list(map(int,input().split()))

sim = False
if 0 in numeros:
    print(0)

else:

    multiplicacao = 1

    for i in numeros:
        multiplicacao *= i
        if multiplicacao > 1e18:
            print(-1)
            sim = True
            break
    if sim == False:
        print(multiplicacao)


Measured memory_bytes: 82016
from collections import deque
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split())) + [-1]
ans = 0

q = deque([])
for i in range(n + 1):
    ind = i
    while True:
        if not q:
            q.append((a[i], ind))
            break
        if q[-1][0] <= a[i]:
            q.append((a[i], ind))
            break
        else:
            height, l = q.pop()
            ans = max(height * (i - l), ans)
            ind = l
print(ans)


Measured memory_bytes: 20148
#include <iostream>
#include<algorithm>//ソート用知識
using namespace std;

int main() {
	int N;
	int a[100];
	cin>>N;
	for(int i=0;i<N;i++)cin>>a[i];
	
	sort(a,a+N,greater<int>());
	int A=0,B=0;
	for(int i=0;i<N;i++){
		if(i%2==0){
			A+=a[i];
		}else{
			B+=a[i];
		}
	}
	
	cout<<A-B<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
using namespace std;

class Dice
{
private:
    //頂点
    int top;
    //底
    int bot;
    //左
    int left;
    //右
    int righ;
    //上
    int up;
    //下
    int down;

public:
    //コンストラクタ。目の代入
    Dice(int c1, int c2, int c3, int c4, int c5, int c6)
    {
        top = c1;
        down = c2;
        righ = c3;
        left = c4;
        up = c5;
        bot = c6;
    }

    //topを返す
    int Get_top()
    {
        return top;
    }

    //回転
    void roll(char D)
    {
        //数字一時保存用
        int num;

        if (D == 'N')
        {
            num = top;
            top = down;
            down = bot;
            bot = up;
            up = num;
            return;
        }

        if (D == 'S')
        {
            num = top;
            top = up;
            up = bot;
            bot = down;
            down = num;
        }

        if (D == 'E')
        {
            num = top;
            top = left;
            left = bot;
            bot = righ;
            righ = num;
        }

        if (D == 'W')
        {
            num = top;
            top = righ;
            righ = bot;
            bot = left;
            left = num;
        }
    }

    void rotate_right()
    {
        int num;

        num = down;
        down = left;
        left = up;
        up = righ;
        righ = num;
    }

    int guess_right(int topnum, int downnum)
    {

        if (topnum == top)
        {
        }
        else if (topnum == righ)
        {
            roll('W');
        }
        else if (topnum == left)
        {
            roll('E');
        }
        else if (topnum == up)
        {
            roll('S');
        }
        else if (topnum == down)
        {
            roll('N');
        }
        else if (topnum == bot)
        {
            roll('N');
            roll('N');
        }

        while (downnum != down)
        {
            rotate_right();
        }

        int result = righ;

        return result;
    }
};

int main(void)
{
    char inp[1000];
    char *dicch;
    int diceinp[6];
    int q;
    int result;
    int topnum;
    int downum;

    //一行目の読み込み
    fgets(inp, sizeof(inp), stdin);
    dicch = strtok(inp, " ");
    sscanf(dicch, "%d\n", &diceinp[0]);

    for (int i = 1; i < 6; i++)
    {
        dicch = strtok(NULL, " ");
        sscanf(dicch, "%d\n", &diceinp[i]);
    }

    //サイコロの作成
    Dice dice(diceinp[0], diceinp[1], diceinp[2], diceinp[3], diceinp[4], diceinp[5]);

    //2行目の読み込み
    fgets(inp, sizeof(inp), stdin);
    sscanf(inp, "%d\n", &q);

    //３行目以降の読み込みと処理
    for (int i = 0; i < q ; i++)
    {
        fgets(inp, sizeof(inp), stdin);
        sscanf(inp, "%d %d\n", &topnum, &downum);

        result = dice.guess_right(topnum, downum);
        printf("%d\n", result);
    }

    return 0;
}


Measured memory_bytes: 2748
#include <bits/stdc++.h>
#define rep(i,n); for(int i = 0;i < (n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
long double pi = acos(-1);
const int INF = 1001001001;


// 最小公倍数を求める
int euqlid (int a, int b){
  int temp;
  temp = a % b;
  if(temp == 0)return b;
  return euqlid(b,temp);
}
ll conbination(ll a,ll b){
  ll u = 1;
  ll d = 1;
  while(b != 0){
    u *= a;
    d *= b;
    a--;
    b--;
  }
  return u / d;
}
int strtoint(char s){
  return (int(s-'0'));
}
int fact(int n){
  if(n == 1)return 1;
  return n * fact(n-1);
  }


int main(){
  string n;
  cin >> n;
  if(n[0] == n[2])cout << "Yes" << endl;
  else cout << "No" << endl;

}


Measured memory_bytes: 256
n, m = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]

memo = dict()

def calc(A, i):
    if A[i] != -1:
        return 0
    point = 0
    for j in range(i - 1, -1, -1):
        if A[j] == -1:
            break
        point += A[j]

    return point     
        

def dfs(a, b, skip, turn, a_stack, b_stack):
    key = (a, b, skip, turn, a_stack, b_stack)
    if key in memo:
        return memo[key]

    if skip == 3:
        return 0

    if turn % 2 == 0:
        memo[key] = dfs(a, b, skip + 1, (turn + 1) % 2, 0, 0) + a_stack - b_stack
        if len(A) == a:
            return memo[key]
        if A[a] == -1:
            b_stack = 0
        else:
            a_stack += A[a]
        memo[key] = max(memo[key], dfs(a + 1, b, 0, (turn + 1) % 2, a_stack, b_stack))
    
    else:
        memo[key] = dfs(a, b, skip + 1, (turn + 1) % 2, 0, 0) - b_stack + a_stack
        if len(B) == b:
            return memo[key]
        if B[b] == -1:
            a_stack = 0
        else:
            b_stack += B[b]
        memo[key] = min(memo[key], dfs(a, b + 1, 0, (turn + 1) % 2, a_stack, b_stack))

    return memo[key]

print(dfs(0, 0, 0, 0, 0, 0))


Measured memory_bytes: 47708
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
 
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  bool ok = false;
  for (char c : s) if (c == '7') ok = true;
  cout << (ok ? "Yes\n" : "No\n");
  return 0;
}

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

#define ll long long
#define ld long double
#define ull unsigned long long
#define pw(x) (1LL << (x))

#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")\n"

using namespace std;

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

    int n, a, b;
    cin >> n >> a >> b;

    vector<int> x(n);

    for (int &k : x)
        cin >> k;

    ll fatigue = 0;
    for (int i = 0; i < n - 1; ++i)
        fatigue += min((ll)(x[i + 1] - x[i]) * a, (ll)b);

    cout << fatigue << '\n';

    return 0;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'

const int N = 110;
int a[N];

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

	int n; cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		int cur = i + 1;
		bool ok1 = cur & 1;
		bool ok2 = a[i] & 1;
		cnt += ok1 && ok2;
	}    
	cout << cnt << endl;
}

Measured memory_bytes: 3644
/*Lucky_Glass*/
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAXN int(3*1e5)
int len,tot[2],res[2],ans;
char s[MAXN+5];
int main()
{
	scanf("%d%s",&len,s);
	for(int i=0;i<len;i++)
		tot[s[i]=='E']++;
	ans=1e9;
	for(int i=0;i<len;i++)
	{
		int F=0;
		F+=res[0];
		F+=tot[1]-res[1]-int(s[i]=='E');
		res[s[i]=='E']++;
		ans=min(ans,F);
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define st first
#define nd second                   
#define fori(i, a, b, c) 	for (int i = (int)(a); i <= (int)(b); i += (int)(c))
#define ford(i, a, b, c) 	for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define MOD 998244353

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lol;
typedef vector<lol> vlol;

ifstream in ("input");

const int NR = 2e5 + 5;

long double n1;
lol n;
int main()	{
	ios::sync_with_stdio(false);
	int i;
	cin >> n1;
                  return cout << fixed << setprecision(10) << (n1/3)*(n1/3)*(n1/3) << '\n', 0;
}












Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<map>
using namespace std;
pair<int,int> p[25];
int main(){
	int n;
	int i;
	int a,b;
	while(1){
		scanf("%d",&n);
		if(n==0)return 0;
		for(i=0;i<n;i++){
			scanf("%d %d",&a,&b);
			p[i].first=b;
			p[i].second=a;
		}
		sort(p,p+n);
		int res=0;
		for(i=0;i<n;i++){
			res+=p[i].second;
			if(p[i].first<res)break;
		}
		if(i==n)printf("Yes\n");
		else printf("No\n");
	}
}

Measured memory_bytes: 1008
#include<stdio.h>

int main(){
	int N, Y;
	scanf("%d %d", &N, &Y);
	
	for (int A = N; A >= 0; A--) {
		for (int B = N - A; B >= 0; B--) {
			int C = N - A - B;
			int X = A * 10000 + B * 5000 + C * 1000;
			if (X == Y) {
				printf("%d %d %d\n", A, B, C);
				return 0;
			}
		}
	}
	printf("-1 -1 -1\n");
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int N;
  long long K;
  scanf("%d%lld", &N, &K);

  pair<int,int> ab[N];
  rep(i, N) scanf("%d%d", &ab[i].first, &ab[i].second);

  long long count = 0;
  sort(ab, ab+N);
  rep(i, N) {
    count += ab[i].second;
    if (count >= K) {
      printf("%d\n", ab[i].first);
      return 0;
    }
  }

  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;

int main() {
    int x, a, b;
    cin >> x >> a >> b;
    if ( a-b >= 0 ){
        cout << "delicious" << endl;
    } else if ( abs(a-b) <= x ){
        cout << "safe" << endl;
    } else {
        cout << "dangerous" << endl;
    }
    return 0;
}


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

class Vector2{
public:
	Vector2() : x( 0.0 ), y( 0.0 ){}
	Vector2( double aX, double aY ) : x( aX ), y( aY ){}

	double cross( Vector2& v ){
		return ( x * v.y ) - ( y * v.x );
	}

	void operator-=( Vector2& v ){
		x -= v.x;
		y -= v.y;
	}

	double x, y;
};

int main(){
	int n;

	cin >> n;
	Vector2* a = new Vector2[ n ];
	Vector2* b = new Vector2[ n ];
	Vector2* c = new Vector2[ n ];
	Vector2* d = new Vector2[ n ];

	for ( int i = 0; i < n; ++i ){
		cin >> a[ i ].x >> a[ i ].y >> b[ i ].x >> b[ i ].y >> c[ i ].x >> c[ i ].y >> d[ i ].x >> d[ i ].y;
	}

	for ( int i = 0; i < n; ++i ){
		a[ i ] -= b[ i ];
		c[ i ] -= d[ i ];
		cout << ( !a[ i ].cross( c[ i ] ) ? "YES" : "NO" ) << endl;
	}

	delete[] a;
	delete[] b;
	delete[] c;
	delete[] d;

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll N=3e5+5;
ll n,ans,a[N];
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin>>n;
    for(ll i=0;i<3*n;i++)cin>>a[i];
    sort(a,a+3*n,greater<ll>());
    for(ll i=1;i<2*n;i+=2)ans+=a[i];
    cout<<ans;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

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

    string s;
    cin>>s;
    bool ans=false;
    for(int i=0;i<s.size()-1;i++){
        if(s[i]=='A' && s[i+1]=='C')ans=true;
    }
    if(ans)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
def main():
    while True:
        a, op, b = input().split()
        a = int(a)
        b = int(b)
        if op == "?":
            break
        if op == "+":
            print(a + b)
        elif op == "-":
            print(a - b)
        elif op == "*":
            print(a * b)
        else:
            print(int(a / b))
    return 0


if __name__ == "__main__":
    main()


Measured memory_bytes: 5600
#include<iostream>
#include<vector>
using namespace std;
vector<int>vec;
int n, a;
int main() {
	cin >> n;
	for (int i = 0; i < (1 << n); i++) { cin >> a; vec.push_back(a); }
	while (vec.size() >= 2) {
		vector<int>vec2;
		for (int i = 0; i < vec.size(); i += 2) {
			if (vec[i] == vec[i + 1])vec2.push_back(vec[i]);
			if (vec[i] > vec[i + 1])vec2.push_back(vec[i] - vec[i + 1]);
			if (vec[i] < vec[i + 1])vec2.push_back(vec[i + 1] - vec[i]);
		}
		vec = vec2;
	}
	cout << vec[0] << endl;
	return 0;
}

Measured memory_bytes: 2292
import static java.lang.Math.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static long LINF = 1L << 55;
	static int MOD = 1000000007;
	static int[] mh4 = { 0, -1, 1, 0 };
	static int[] mw4 = { -1, 0, 0, 1 };
	static int[] mh8 = { -1, -1, -1, 0, 0, 1, 1, 1 };
	static int[] mw8 = { -1, 0, 1, -1, 1, -1, 0, 1 };

	static class TaskX {

		public void solve(int testNumber, InputReader in, PrintWriter out) {

			String s = in.nextString();
			int n = s.length();

			out.println("YAKI".equals(s.substring(0, min(4, n))) ? "Yes" : "No");

		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public int[] nextIntArrayDec(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt() - 1;
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public long[] nextLongArrayDec(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong() - 1;
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}
	}

}


Measured memory_bytes: 21460
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a;i<(int)b;++i)
int main(){
  double a,b;cin>>a>>b;
  if(a>b)cout<<"GREATER"<<endl;
  else if(a<b)cout<<"LESS"<<endl;
  else cout<<"EQUAL"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

#define INF LLONG_MAX/5
#define MOD 1000000007
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define enld endl

signed main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << max(max(a * c, a * d), max(b * c, b * d)) << endl;
}

Measured memory_bytes: 3540
#include<stdio.h>
int MAX(int a,int b){return a<b?b:a;}
int MIN(int a,int b){return a<b?a:b;}
void ifMAX(int *a,int b){*a=MAX(*a,b);}
int main(){
  int h,n,k,m,p,d,i,j,l,a[110],b[110],c[110],e[110],dp[110][110]={};
  int s[11010]={};
  int t[110][11010]={1};
  scanf("%d %d %d %d %d %d",&h,&n,&k,&m,&p,&d);
  for(i=0;i<n;i++)scanf("%d %d",&e[i],&c[i]);
  for(i=0;i<m;i++)scanf("%d %d",&b[i],&a[i]);
  for(i=0;i<10010;i++){
    for(j=0;j<m;j++)ifMAX(&s[i+a[j]],s[i]+b[j]);
  }
  //for(i=0;i<20;i++)printf("%2d %2d\n",i,s[i]);printf("\n");
  for(l=0;l<n;l++){
    for(i=k-1;i>-1;i--){
      for(j=h-1;j>-1;j--){
	if(t[i][j])ifMAX(&t[i+1][j+e[l]],t[i][j]+c[l]);
      }
    }
  }
  //for(i=0;i<40;i++)printf("%2d %2d %2d\n",i,t[k][i]-1,s[t[k][i]-1]);
  for(i=0;i<=d;i++){
    for(j=h;j;j--){
      ifMAX(&dp[i][j-1],dp[i][j]);
      if(dp[i][j]==0&&i)continue;
      for(l=0;l<=j;l++){
	if(t[k][l])ifMAX(&dp[i+1][MIN(h,j-l+p)],dp[i][j]+s[t[k][l]-1]);
      }
    }
  }
  for(i=j=0;i<=h;i++)ifMAX(&j,dp[d][i]);
  /*for(i=0;i<=d;i++){
    for(j=0;j<h;j++)printf("%3d ",dp[i][j]);printf("\n");
    }//*/
  printf("%d\n",j?j:-1);
  return 0;
}

Measured memory_bytes: 5428
N,Q=map(int,input().split())
S=input()
k = [0] * (N+1)

for i in range(1,N):
  v = 1 if S[i-1]+S[i] == 'AC' else 0
  k[i] = k[i-1] + v
k[-1]=k[-2]
for _ in range(Q):
  f,l = map(int,input().split())
  print(k[l-1] - k[f-1])

Measured memory_bytes: 7668
n = int(input())
Point_ti = []
Sa = 0
Sb = 0
for _ in range(n):
    a, b = map(int, input().split())
    Sa += a
    Sb += b
    Point_ti.append(a+b)

Point_ti.sort(reverse=True)
ans = 0
for i in range(n):
    if i%2 == 0:
        ans += Point_ti[i]
print(ans-Sb)


Measured memory_bytes: 7436
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<map>
#include<cmath>
#include<vector>
#include<queue>
#include<cstdio>
#include<math.h>
#include<bitset>
#include<algorithm>
#include<iomanip>
#include<list>
#include<set>
#include<utility>
#include<cstdio>
using namespace std;

//repetition
//------------------------------------------

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
//#define INF (1 << 30)
#define pii pair<int, int>

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

static const int INF = 1000000010;
int N;
string s;
ll m,a,r,c,h;
ll D[5];
int P[10]={0,0,0,0,0,0,1,1,1,2};
int Q[10]={1,1,1,2,2,3,2,2,3,3};
int R[10]={2,3,4,3,4,4,3,4,4,4};

int main() {
  scanf("%d",&N);
  rep(i,N){
    cin >> s;
    if(s[0]=='M')m++;
    if(s[0]=='A')a++;
    if(s[0]=='R')r++;
    if(s[0]=='C')c++;
    if(s[0]=='H')h++;
  }
  D[0]=m, D[1]=a, D[2]=r, D[3]=c, D[4]=h;
  ll res=0;
  rep(d,10){
    res += D[P[d]]*D[Q[d]]*D[R[d]];
  }
  printf("%lld\n", res);
}


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

typedef long long int ll;

vector<ll> ab[200030];
vector<pair<ll,ll>> px;

void dfs(vector<ll> &c, ll v, ll p = -1)
{
    for(ll u : ab[v]){
        if(u == p){
            continue;
        }
        c[u] += c[v];
        dfs(c, u, v);
    }
}

int main()
{
    ll n, q;
    cin >> n >> q;
    for(ll i = 0;i < n - 1;i++){
        ll a, b;
        cin >> a >> b;
        ab[a - 1].push_back(b - 1);
        ab[b - 1].push_back(a - 1);
    }
    px.resize(q);
    for(ll i = 0;i < q;i++){
        cin >> px[i].first >> px[i].second;
    }

    vector<ll> c(n);
    for(ll i = 0;i < q;i++){
        c[px[i].first - 1] += px[i].second;
    }

    dfs(c ,0);

    for(ll i = 0;i < n;i++){
        cout << c[i] << " ";
    }

    return 0;
}

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

int main(){
  int k;
  cin >> k;
  int a,b;
  cin >> a >> b;
  for(int i=a;i<=b;++i){
    if(i%k==0){
      cout << "OK" << endl;
      return 0;
    }
  }
  cout << "NG" << endl;
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	double b=0;
	rep(i,n){
		double d;
		cin>>d;
		b+=(1/d);
	}
	fcout(7)<<1/b<<endl;
}


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

struct TrieNode {
    TrieNode *children[26];
    bool end_of_word;
    TrieNode() {
        fill(children, children + 26, (TrieNode *)NULL);
        end_of_word = false;
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    TrieNode *root = new TrieNode();
    vector<string> S(N);
    for (int i = 0; i < N; ++i) {
        cin >> S[i];
        // insert reverse of S[i]
        TrieNode *cur = root;
        for (int j = S[i].length() - 1; j >= 0; --j) {
            int index = S[i][j] - 'a';
            if (cur->children[index] == NULL) {
                cur->children[index] = new TrieNode();
            }
            cur = cur->children[index];
        }
        cur->end_of_word = true;
    }
    int ans = 0;
    for (int i = 0; i < N; ++i) {
        int L = S[i].length();
        vector<int> count(26, 0);
        for (int j = 0; j < L; ++j) {
            ++count[S[i][j] - 'a'];
        }
        TrieNode *cur = root;
        for (int j = L - 1; j >= 0 && cur != NULL; --j) {
            for (int k = 0; k < 26; ++k) {
                if (count[k] != 0 && cur->children[k] != NULL && cur->children[k]->end_of_word) {
                    ++ans;
                }
            }
            cur = cur->children[S[i][j] - 'a'];
            --count[S[i][j] - 'a'];
        }
    }
    cout << ans - N << '\n';
    return 0;
}

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

#define ll long long

ll n, cache[int(1e5)][3];
vector <ll> a, b, c;


ll dp(ll i, ll p)
{
	if (i == n)
		return 0;
	if (p != -1){
		if (cache[i][p] != -1)	return cache[i][p];
	}
	ll ret = -2e9;
	if (p == -1) ret = max({b[i] + dp(i + 1, 1), c[i] + dp(i + 1, 2), ret, a[i] + dp(i + 1, 0)});	
	if (p == 0)	ret = max({b[i] + dp(i + 1, 1), c[i] + dp(i + 1, 2), ret});
	if (p == 1)	ret = max({a[i] + dp(i + 1, 0), c[i] + dp(i + 1, 2), ret});
	if (p == 2)	ret = max({b[i] + dp(i + 1, 1), a[i] + dp(i + 1, 0), ret});		
	return cache[i][p] = ret;
}

int main()
{	
	ll nn;	cin >> nn;
	vector <ll> aa(nn), bb(nn), cc(nn);	
	for (ll i = 0; i < nn; i ++){
		cin >> aa[i] >> bb[i] >> cc[i];
	}	
	memset(cache, -1, sizeof cache);
	n = nn;	a = aa; b = bb; c = cc;
	cout << dp(0, -1) << "\n";
}

Measured memory_bytes: 15104
#include<stdio.h>
int main(void)
{ 
	int r,g,b,a,c,d,e,f;
	scanf("%d",&r);
	scanf("%d",&g);
	scanf("%d",&b);
	a=r*100;
	c=g*10;
	d=b;
	e=a+c+d;
	if(e%4==0){
	printf("YES\n");
	}
	else {
	printf("NO\n");
	}
	return 0;
}

Measured memory_bytes: 128
n,m = map(int,input().split(" "))

rank = [1]*n
dad = [i for i in range(n)]

def find(a):
    if a == dad[a]:
        return a
    else:
        dad[a] = find(dad[a])
        return dad[a]

for _ in range(m):
    a,b = map(int,input().split(" "))

    #find parents
    aP = find(a)
    bP = find(b)
    if aP == bP:
        continue

    aR = rank[aP]
    bR = rank[bP]

    if aR >= bR:
        dad[bP] = aP
        if rank[aP] == rank[bP]:
            rank[aP] += 1
            rank[bP] = rank[aP]
    else:
        dad[aP] = bP
        if rank[aP] == rank[bP]:
            rank[bP] += 1
            rank[aP] = rank[bP]

qN = int(input())
for _ in range(qN):
    a,b = map(int,input().split(" "))
    if find(a) == find(b):
        print("yes")
    else:
        print("no")



Measured memory_bytes: 10456
from collections import Counter

N, M = map(int, input().split())
X = list(map(int, input().split()))

pair = [[] for _ in range(M)]
for x in X:
    mod = x % M
    pair[mod].append(x)

ans = 0

# 余りが0の組
ans += len(pair[0]) // 2
if M % 2 == 0:
    ans += len(pair[M // 2]) // 2

for i in range(1, M):
    j = M - i
    if i >= j:
        break
    S = pair[i]
    T = pair[j]
    if len(S) < len(T):
        S = pair[j]
        T = pair[i]

    c = Counter(S)
    p = 0
    r = 0
    for v in c.values():
        div, mod = divmod(v, 2)
        r += mod
        p += div * 2

    add = len(T)
    ans += add
    add -= min(add, r)
    ans += (p - add) // 2

print(ans)


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

using namespace std;
struct I{
    I(){
        ios::sync_with_stdio(false);cin.tie(0);
        //cout<<fixed<<setprecision(10);
    }
}init;

typedef long long LL;
const LL MOD=1e9+7;

#define SPACE " "
template<typename T>
ostream& operator<<(ostream &os,vector<T> v){
    for(int i =0,sz=v.size();i<sz;i++)os<<(!i)+SPACE<<v[i];
    return os;
}
template<typename T>
istream& operator>>(istream &is,vector<T>& v){
    for(int i =0,sz=v.size();i<sz;i++)is>>v[i];
    return is;
}

int main(){
    LL A,B,C;
    cin>>A>>B>>C;
    if(A%2==0||B%2==0||C%2==0)cout<<0<<endl;
    else cout<<min({A*B,B*C,C*A})<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
using namespace std;

const int INF = 1000000000;
typedef pair<int, int> P;

char field[50][50];
int d[50][50];
int h, w;

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

int bfs() {
    queue<P> q;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            d[i][j] = INF;
        }
    }
    q.push(P(0, 0));
    d[0][0] = 0;

    while (q.size()) {
        P p = q.front(); q.pop();
        if (p.first == h - 1 && p.second == w - 1)
            break;
        for (int i = 0; i < 4; i++) {
            int nx = p.first + dx[i], ny = p.second + dy[i];
            if (nx >= 0 && nx < h && ny >= 0 && ny < w && field[nx][ny] == '.' && d[nx][ny] == INF) {
                q.push(P(nx, ny));
                d[nx][ny] = d[p.first][p.second] + 1;
            }
        }
    }
    return d[h - 1][w - 1];
}

int main() {
    cin >> h >> w;
    int white = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> field[i][j];
            if (field[i][j] == '.')
                white++;
        }
    }
    if (bfs() == INF) 
        cout << "-1" << endl;
    else
        cout << white - bfs() - 1 << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*; 

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner cin=new Scanner(System.in);
		
		int n=cin.nextInt();
		int i=1;
		while(i<=n){
			int x=i;
			
			if(x%3==0){
				System.out.print(" "+i);
			}
			else include3(x,i);
			i++;
		}
		System.out.println();

	}
	
	static void include3(int x,int i){
		if(x%10==3){
			System.out.print(" "+i);
			return;
		}
		x/=10;
		if(x>=1)include3(x,i);
	}

}



Measured memory_bytes: 31180
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};

int main(void){
    int H,W;
    cin >> H >> W;
    char S[H][W];
    lint ans[H][W]={};
    rep(i,H) cin >> S[i];
    ans[0][0]=1;
    rep(i,H) rep(j,W){
        if(i!=H-1) if(S[i+1][j]!='#') ans[i+1][j]=(ans[i+1][j]+ans[i][j])%MOD;
        if(j!=W-1) if(S[i][j+1]!='#') ans[i][j+1]=(ans[i][j+1]+ans[i][j])%MOD;
    }
    cout << ans[H-1][W-1] << endl;
}

Measured memory_bytes: 9088
A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

for i in range(K):
	if i % 2 == 0:
		A //= 2
		B += A 
	else:
		B //= 2
		A += B 
print(str(A) + " " + str(B))


Measured memory_bytes: 2940
N,A,B,C,D=map(int,input().split())

if N%A==0:
    x=N//A
else:
    x=N//A+1
s1=x*B

if N%C==0:
    y=N//C
else:
    y=N//C+1
s2=y*D

if s1<=s2:
    print(s1)
else:
    print(s2)
    


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

int main()
{
    string s;
    cin >> s;
    bool flag = true;
    ll count = 0;

    while(flag)
    {
        if(s.size() == 0)break;
        flag = false;
        for(int i = 0; i < s.size()-1; i++)
        {
            if(s[i] != s[i+1])
            {
                s.erase(i,2);
                count += 2;
                flag = true;
                break;
            }
        }
        
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#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> S;

    rep(i, n){
        int a;
        cin >> a;
        S.push_back(a);
    }

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

    int ans = 0;

    rep(i, k){
        ans += S[i];
    }

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

Measured memory_bytes: 3628
#include <stdio.h>

const int K = 1e5+5;
const int mod = 1e9+7;

long long fastexp(int b,int e){
    if(e==0) return 1;
    long long ans = fastexp(b,e/2);
    ans = (ans*ans)%mod;
    if(e%2==1) ans=(ans*b)%mod;
    return ans;
}

long long pot[K];

int main(){
    int n,k;
    long long ans=0;
    scanf("%d %d", &n,&k);
    for(int i = k;i>0;i--){
        pot[i] = fastexp(k/i,n);
        for(int j = 2;i*j<=k;j++){
            pot[i]-=pot[i*j];
        }
        while(pot[i]<0) pot[i]+=mod;
        ans = (ans+(i*pot[i])%mod)%mod;
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 2504
#include <stdio.h>
#include <math.h>

#define SQ(x) ((x) * (x))

int main(void)
{
    int s;
    int i;
    double x1, x2, x3;
    double y1, y2, y3;
    double a, b, c, d, e, f;
    double l, m, n;
    
    scanf("%d", &s);
    for (i = 0; i < s; i++){
        scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3);
        
        a = (x1 - x2);
        b = (y1 - y2);
        c = -1 * (SQ(x1) - SQ(x2) + SQ(y1) - SQ(y2));
        d = (x1 - x3);
        e = (y1 - y3);
        f = -1 * (SQ(x1) - SQ(x3) + SQ(y1) - SQ(y3));
        
        l = (c * e - b * f) / (e * a - b * d);
        m = (d * c - a * f) / (d * b - e * a);
        
        n = -1 * (SQ(x1) + SQ(y1) + l * x1 + m * y1);
        
        printf("%.3f %.3f %.3f\n", l / -2.0, m / -2.0, sqrt(SQ(l) + SQ(m) - 4 * n) / 2.0);
    }
    
    return (0);
}

Measured memory_bytes: 1076
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string s;
    cin>>s;
    long long q,i,x,y,a=0,j;
    char z;
    cin>>q;
    for(i=1;i<=q;i++)
    {
        cin>>x;
        if(x==1)
        {
           a++;
        }        
        else if(x==2)
        {
           cin>>y;
           cin>>z;
           if(y==1)
           {
              if(a%2!=0)
              {
                 s.push_back(z);
              }
              else
              {
                 s=z+s;
              }
           }
           else if(y==2)
           {
              if(a%2!=0)
              {
                 s=z+s;
              }
              else
              {
                 s.push_back(z);
              }
           }
        }
    }
    if(a%2==0)
    {
        cout<<s<<endl;
    }
    else
    {
       for(j=s.size()-1;j>=0;j--)
       {
           cout<<s[j];
       }
       cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 4672
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a = ri()//200
print(10-a)



















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

int main() {
  long N;
  cin >> N;
  long ans = 0;
  long cnt = 0;
  for (long i = 1; i <= N; i++) {
    if (i % 3 == 0) continue;
    if (i % 5 == 0) continue;
    ans += i;
  }
  cout << ans << "\n";
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n; cin>>n;
	vector<int> e(1e5+1,0),o(1e5+1,0);
	for(int i=0;i<n;i++){
		int foo; cin>>foo;
		if(i%2==1) o[foo]++;
		else e[foo]++; 
	}
	//I love complement 
	int max_even=max_element(e.begin(),e.end())-e.begin();
	int max_odd=max_element(o.begin(),o.end())-o.begin();
	if(max_even!=max_odd) cout<<n-e[max_even]-o[max_odd];
	else{
		sort(e.rbegin(),e.rend());
		sort(o.rbegin(),o.rend());
		cout<<min(n-e[0]-o[1],n-e[1]-o[0])<<endl;
	}
	return 0;
}

Measured memory_bytes: 4052
#include <stdio.h>

int main(void) {
	int sum=0, m, n, nsum=0, i=1;
	double ave;

	
	while(scanf("%d, %d", &m, &n)!=EOF){
		sum+=m*n;
		nsum+=n;
		ave=0.5+(double)nsum/i++;
	}
	
	printf("%d\n%d\n", sum, (int)ave);
	return 0;
}

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

namespace atcoder
{
	class Program
	{
		static int In => int.Parse(Console.ReadLine());
		static int[] Ins => Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

		static void Main(string[] args)
		{
			var N = In;
			var Ns = Ins;
			var M = In;
			var Ms = Ins;
			var list = new List<int>(Ns);
			bool ret = true;
			list.Sort();
			for (int i = 0;i < Ms.Length;i++)
			{
				var index = list.BinarySearch(Ms[i]);
				if (index < 0)
				{
					ret = false;
					break;
				}
				else list.RemoveAt(index);
			}
			Console.WriteLine(ret ? "YES" : "NO");
			//Console.ReadLine();
		}
	}
}

Measured memory_bytes: 38332
#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
	cin>>n;
	for(int i=1;i<=9;i++)
		for(int j=1;j<=9;j++)
			if(i*j==n)
			{
				cout<<"Yes"<<endl;
				return 0;
			}
	cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>
#include <ctime>

using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF = 1 << 27;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
const int CLK = CLOCKS_PER_SEC;

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

int main(){
	int a, b;
	while(cin >> a >> b &&  (a || b)){
		int best = a + b;
		int id = 0;
		rep2(i, 1, 5){
			cin >> a >> b;
			if(best < a + b){
				best = a + b;
				id = i;
			}
		}
		cout << (char)('A'+id) << " " << best << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<functional>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
LL N,M;

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

    cout<<abs(N-M)<<endl;
    return 0;
}


Measured memory_bytes: 3088
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
//sum
using namespace std;

int main() {
    int c1 = 0;
    int c2 = 0;
    int ans;
    int i;
    string s1;
    cin >> s1;
    for (i=0;s1.size()>i;i++) {
        if (i % 2 == 0) {
            if (s1[i] == '0') {
                c1++;
            }
        } else {
            if (s1[i] == '1') {
                c1++;
            }
        }
        if (i % 2 == 0) {
            if (s1[i] == '1') {
                c2++;
            }
        } else {
            if (s1[i] == '0') {
                c2++;
            }
        }
    }

    cout << min(c1, c2) << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

void Input(int*,int*);
int Calc(int*,int*);
void Output(int*,int*,int*);

int main(int argc,char* argv[]){
  int n,count=0;
  int arr[100];

  Input(&n,arr);
  count=Calc(&n,arr);

  Output(&n,&count,arr);

  return 0;
}

void Input(int* pn,int *arr){
  
  cin>>*pn;
  for(int i=0;i<*pn;i++){
    cin>>*arr++;
  }
}

int Calc(int* pn,int* arr){
  int count=0;
  
  for(int i=0;i<*pn;i++){
    for(int j=*pn-1;j>i;j--){
      if(arr[j]<arr[j-1]){
	swap(arr[j],arr[j-1]);
	count++;
      }	
    }
  }
  return count;
}

void Output(int* pn,int* pcount,int* arr){

  printf("%d",*arr++);
  for(int i=1;i<*pn;i++)
    printf(" %d",*arr++);
  puts("");

  printf("%d\n",*pcount);
}

Measured memory_bytes: 1148
# coding: utf-8
# Your code here!

def insert_sort(arr):
    for index in range(1, len(arr)):
        insert(index, arr)

def insert(index, arr):
    tmp = arr[index]
    for i in range(index-1, -1, -1):
        if arr[i] > tmp:
            arr[i + 1] = arr[i]
            arr[i] = tmp
        else:
            arr[i + 1] = tmp
            break
    print(" ".join(map(str, arr)))

n = input()
# w = '5 2 4 6 1 3'
l = list(map(int, input().split()))
print(" ".join(map(str, l)))
insert_sort(l)






Measured memory_bytes: 5604