akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
#define deb(x) cout << #x << " " << x << endl;
#define debtwo(x,y) cout << #x << " " << x << ", " << #y << " " << y << endl;
#define mod 1000000000000000000

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long n, x, t;
    cin >> n >> x >> t;

    int m = ceil(1.0 * n / x);
    cout << m*t << endl;
}

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

int main(){
	int t,sum=0,Min=10;
	for(int i=0;i<5;i++){
		cin>>t;
		if(t%10==0){
			sum+=t;
		}else{
			sum+=t+10-t%10;
			Min=min(Min,t%10);
		}
	}
	cout<<sum-10+Min;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep2(i,n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    char X, Y;
    cin >> X >> Y;
    if(X < Y) cout << '<' << endl;
    else if(X > Y) cout << '>' << endl;
    else cout << '=' << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

import static java.util.Comparator.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Solver solver = new Solver(System.in, out);
        solver.solve();
        out.close();
    }
}
class Solver {
	Scanner sc;
	PrintWriter out;
    public Solver(InputStream in, PrintWriter out) {
    	sc = new Scanner(in);
    	this.out = out;
    }
    // ==================================================================
    final long MOD = 1000000007;
	long[] two;
    public void solve() {
		int N = ni();
		long[] C = ndl(N);
		Arrays.sort(C);
		two = new long[N+1];
		two[0] = 1;
		for (int i = 0; i < N; i++) {
			two[i+1] = (two[i] *2) % MOD;
		}
		int l, r;
		long ans = 0, wk;
		for (int i = 0; i < N; i++) {
			l = i;
			r = N - i - 1;
			wk = two[r];
			if(r > 0)	wk = (wk + (two[r-1] * r) % MOD) % MOD;
			wk = (((wk * two[l]) % MOD) * C[i]) % MOD;
			ans = (ans + wk) % MOD;
		}
		ans = (ans * two[N]) % MOD;
		out.println(ans);
	}
    static class PP{
    	public int key, val;
    	public PP(int key, int val) {
    		this.key = key;
    		this.val = val;
    	}
		public int getKey() {
			return key;
		}
		public void setKey(int key) {
			this.key = key;
		}
		public int getVal() {
			return val;
		}
		public void setVal(int val) {
			this.val = val;
		}
    }

    // ------------------------------------------
    // 入力
    // ------------------------------------------
    public int ni() {
    	return sc.nextInt();
    }
    public long nl() {
    	return sc.nextLong();
    }
    public String ns() {
    	return sc.next();
    }
    public char[] nc() {
    	return sc.next().toCharArray();
    }
    public int[] ndi(int N) {
    	int[] ans = new int[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ni();
		}
    	return ans;
    }
    public long[] ndl(int N) {
    	long[] ans = new long[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = nl();
		}
    	return ans;
    }
    public String[] nds(int N) {
    	String[] ans = new String[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ns();
		}
    	return ans;
    }
    public char[][] ndc(int N) {
    	char[][] ans = new char[N][];
    	for (int i = 0; i < N; i++) {
			ans[i] = nc();
		}
    	return ans;
    }
    public int[][] nddi(int N, int S) {
    	int[][] ans = new int[N][S];
    	for (int i = 0; i < N; i++) {
			for (int j = 0; j < S; j++) {
				ans[i][j] = ni();
			}
		}
    	return ans;
    }
}


Measured memory_bytes: 91188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n, a, b;
    cin >> n >> a >> b;
    string s;
    cin >> s;
    ll in = 0, out = 0;
    rep(i, n) {
        if (s[i] == 'a') {
            if ((a + b) > (in + out)) {
                in++;
                cout << "Yes" << endl;
            }
            else {
                cout << "No" << endl;
            }
        }
        else if (s[i] == 'b') {
            if (((a + b) > (in + out)) && (b > out)) {
                out++;
                cout << "Yes" << endl;
            }
            else {
                cout << "No" << endl;
            }
        }
        else {
            cout << "No" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 848
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int k = sc.nextInt();
		
		// 計算
		int result = 0;
		int c = min(a, b);
		for(int i = c; i > 0; i--){
		    if(a%i == 0 && b%i == 0){
		        k--;
		        result = i;
		        if(k == 0) break;
		    }
		}

		// 出力
		System.out.println(result);
        
	}
}


Measured memory_bytes: 23764
#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
//djzofhf;eo //DJ ???????????§???
using namespace std;
int main(){
    double a[11]={0};
    double v[2];
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&a[10],&v[0],&v[1])!=EOF){
        double rui[11]={0};
        for(int i=1;i<=10;i++)rui[i]=rui[i-1]+a[i];
        double suredis=rui[10]*(v[0]/(v[0]+v[1]));
        for(int i=1;;i++){
            if(suredis-0.000001<rui[i]){
                cout<<i<<endl;
                break;
            }
        }

    }
    return 0;
}

Measured memory_bytes: 1228
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;
 
vector<ll>ans[111];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    ll k,temp=0;
    cin>>s>>k;
    for(ll i=0;i<(ll)s.length();i++){
        if(s[i]=='1' && i+1==k){
            cout<<1;
            return 0;
        }
        else if(s[i]!='1'){
            cout<<s[i];
            return 0;
        }
    }
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
  int n;
  cin >> n;
  int m = n;
  int s = 0;
  while (m != 0)
  {
    s += m % 10;
    m /= 10;
  }
  cout << (n % s == 0 ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=1e6;
int n,head[N],maxx,cur;
struct e{int to,next,c;}e[N];
void add(int u,int v)
{
	e[++cur].next=head[u];
	e[cur].to=v;
	head[u]=cur;
}
void dfs(int x,int fa,int color)
{
	int col=1;
	for(int i=head[x];i;i=e[i].next)
	{
		int p=e[i].to;
		if(p==fa)continue;
		if(col==color)col++;
		e[i].c=col++;
		//cout<<e[i].c<<" "<<e[i].to<<" "<<col<<endl;
		dfs(p,x,e[i].c);
	}
	maxx=max(maxx,col-1);
}
int main()
{
	cin>>n;
	for(int i=1;i<n;i++)
	{
		int u,v;
		cin>>u>>v;
		add(u,v);
		add(v,u);
	}
	dfs(1,0,0);
	cout<<maxx<<endl;
	for(int i=1;i<=2*(n-1);i+=2)cout<<e[i].c<<endl;
}

Measured memory_bytes: 7424
import math

a = input()
b = int(math.sqrt(a)) + 1
c = 1
mi = 100

for i in range(1, b):
	if a % i == 0:
		d = a / i
	if max(len(str(i)), len(str(d))) < mi:
		mi = max(len(str(i)), len(str(d)))

print mi

Measured memory_bytes: 5764
#include <bits/stdc++.h>
typedef long long int ll;
# define pi 3.14159265358979323846 
using namespace std;


int main() {
	// your code goes here
	float r;
	cin>>r;
	cout<<fixed<<setprecision(12)<<2*pi*r;
	
	return 0;
}


Measured memory_bytes: 3784
#include<bits/stdc++.h>
using namespace std;
int main()
{
   string s;
    string t;
    cin>>s>>t;

       int count=0;
       for(int i=0;i<3;i++)
       {
         if(s[i]==t[i])
          count++;
       }
      cout<<count;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int card = Integer.parseInt(br.readLine());    
        String[] str;
        int t=0;
        int h=0;
        for(int i=0; i<card; i++){
          
            str = br.readLine().split(" ");  
            String tarou = str[0];
            String hanako = str[1];

            int judge = tarou.compareTo(hanako);
             
            if(judge<0){        
                h += 3;   
            }else if(judge>0){  
                t += 3;   
            }else{              
                h += 1;   
                t += 1;
            }
        }
        System.out.println(t +" "+h);
    }
}

Measured memory_bytes: 25280
S = input()
cnt = 0
for i in range(len(S)):
    for j in range(len(S)):
        if i == j : pass
        elif S[i] == S[j]: cnt += 1
        else: pass
        if cnt != 0: break
    if cnt != 0 :break
if cnt == 0:
  print("yes")
else:
  print("no")


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

int A,B,C,K;
int main(){
	cin>>A>>B>>C>>K;
	int hasil;
	hasil=A+B+C;
	int big;
	if(A>B){
		if(C>A){
			hasil=hasil-C;
			big=C;
		}else{
			hasil=hasil-A;
			big=A;
		}
	}else{
		if(C>B){
			big=C;
			hasil=hasil-C;
		}else{
			big=B;
			hasil=hasil-B;
		}
	}
	for(int i=0; i<K; i++){
		big=big*2;
	}
	hasil=hasil+big;
	cout<<hasil;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#define long long ll ;
#define mod 1e+9;
#define rep for(int i=0;i<n;i++);
#define pb push_back;
#define popb pop_back;
using namespace std;
const int ma=1e6+9;
typedef long long ll;

int main()
{
//     #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
   ios_base::sync_with_stdio(0);
    cin.tie(0);
  int n;
  cin >> n;
    string s;
    cin >> s;
    //int n=s.size();
    int l=0,r=n-1;
    int ans=0;
    while(l<r)
    {
      while(l<n&&s[l]=='R')
        l++;
      while(r>=0&&s[r]=='W')
        r--;
        if(l<r) 
        {
          swap(s[l],s[r]);
          ans++;
        }
    }
      cout << ans <<endl;
  }


Measured memory_bytes: 3752
# https://atcoder.jp/contests/abc063/tasks/arc075_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    scores = []
    for _ in range(N):
        s = int(input())
        scores.append(s)

    ans = 0
    if sum(scores) % 10 != 0:
        ans = sum(scores)
    else:
        scores.sort()
        for c in scores:
            if c % 10 != 0:
                ans = sum(scores) - c
                break

    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
//gcc -std=gnu11 -O2 -o a.out Main.c -lm
//http://abc048.contest.atcoder.jp/tasks/abc048_b
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdint.h>
#include <math.h>
#include <string.h>

int main(void)
{
#define N_MAX 100  //

	int i,j;
	long long a,b,x;
	int ret;


	//-------------------------------------
	//Input process
	//-------------------------------------
	ret = scanf("%lld%lld%lld", &a, &b, &x);

	//-------------------------------------
	//Calc process
	//-------------------------------------


	//-------------------------------------
	//Output process
	//-------------------------------------
	printf("%lld\n", (b/x) - ((a + x -1)/x) +1);
	return(0);
}


Measured memory_bytes: 128
#include<queue>
#include<stack>
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
#include<functional>
#include<deque>
#include<ctime>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
unsigned int randxor()
{
    static unsigned int x=123456789,y=362436069,z=521288629,w=88675123;
    unsigned int t;
    t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) );
}
int d=365;
vector<int> ans(d);
vector<int> ans1(d);
vector<int> c(26);
vector<vector<int> > s(d);
int score=-1000000000;
int keisan(){
  int cost=0,i,j;
  vector<int> x(26,-1);
  for(i=0;i<d;i++){
    cost+=s[i][ans1[i]];
    x[ans1[i]]=i;
    for(j=0;j<26;j++){
      cost=cost-c[j]*(i-x[j]);
    }
  }
  return cost;
}
void solve(){
  int i;
  if(score<=keisan()){
    for(i=0;i<d;i++){
      ans[i]=ans1[i];
    }
    score=keisan();
    int v=randxor()%d;
    int w=randxor()%d;
    swap(ans1[v],ans1[w]);
  }
  else{
    for(i=0;i<d;i++){
      ans1[i]=ans[i];
    }
  }
}
int main(){
  int i,j;
  int ti=clock();
  cin >> d;
  for(i=0;i<26;i++){
    scanf("%d",&c[i]);
  }
  for(i=0;i<d;i++){
    for(j=0;j<26;j++){
      int a;
      scanf("%d",&a);
      s[i].push_back(a);
    }
  }
  for(i=0;i<d;i++){
    ans1[i]=i%26;
    ans[i]=ans1[i];
  }
  while(clock()-ti<197.9*CLOCKS_PER_SEC/100){
    solve();
  }
  for(i=0;i<d;i++){
    printf("%d\n",ans[i]+1);
  }
  return 0;
}

Measured memory_bytes: 3892
using System;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            int N;
            int[] Ketasuu = new int[3];

            N = int.Parse(Console.ReadLine());

            // 100の位を確認
            Ketasuu[0] = N / 100;
            Ketasuu[1] = (N - 100 * Ketasuu[0]) / 10;
            Ketasuu[2] = N - (100 * Ketasuu[0]) - (10 * Ketasuu[1]);

            int i=0;

            while (i < 3)
            {
                if (Ketasuu[i] == 7)
                {
                    Console.WriteLine("Yes");
                    break;
                }

                if (i == 2)
                {
                    Console.WriteLine("No");
                    break;
                }

                i++;
            }


            
        }
    }
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define F            first
#define S            second
#define pb(x)        push_back(x)
#define mp(a,b)      make_pair(a,b)
#define mt(a,b,c)    make_tuple(a,b,c)
#define sz           size()
#define all(A)       A.begin(), A.end()
#define mem(a, b)    memset(a, b, sizeof(a))   // all elements of A are b=0 or b=-1 else don't work
#define f0(i,b)      for(ll i=0;i<(b);i++)
#define f1(i,b)      for(ll i=1;i<=(b);i++)
#define f2(i,a,b)    for(ll i=(a);i<=(b);i++)
#define f3(i,b,a)    for(ll i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(ll i=(a);i!=(b);i+=(c))

#define mod          10000007
#define PI           acos(-1.0)
#define MAX3(a,b,c)  max(a,max(b,c))

#define whilee(i,t)  while(i!=t)
#define  sl(a)       scanf("%lld",&a)
#define  pl(a)       printf("%lld\n",a)

//x = 1e18 means 10^18
//for(auto it =A.begin(); it!=A.end(); it++)
//sort(A.begin(),A.end()); //sort(A, +n, greater<int>());
//binary_search(A.begin(),A.end(),x);
//reverse(A.begin(), A.end());
//cout << *max_element(A.begin(), A.end());
//cout << *min_element(A.begin(), A.end());
//count(A.begin(), A.end(), X); //counts the occurrences of X
//distance(A.begin(),A.end());  //distance between first to last element
//accumulate(A.begin(), A.end(), 0); //add
//next_permutation(A.begin(), A.end());
//prev_permutation(A.begin(), A.end());
//swap(S[0], T[0]);

//scanf("%lld",&x);
//printf("%lld\n",x);
//printf("%I64d\n", a);
//while (scanf("%lld %lld", &a, &b) == 2)
//printf("Case %lld: %lld\n", t++, a);

// int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1};  // 4 Direction
// int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1};  // 8 Direction
// int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1};  // Knight Direction
// int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1};  // Hexagonal Direction

//vector <ll> A;
//deque <ll> A;
//queue <ll> A;
//stack <ll> A;
//list <int> A;
//set <ll> A;
//map <ll,ll> A;
//unordered_map <ll, ll> A;
//pair <ll,ll> A ;
//tuple <ll, ll, ll> A;
//vector <pair <ll,ll>> A;
//bitset<32> bset1;
//bool ok = true;
//char ch;
//string S, T, U;

ll i=0, j=0, k=0, a, b, c, d, e, f, g, h, l, m, n, o, p, q, r, s, t=1, u, v, w, x, y, z, maxx=INT_MIN, minn=INT_MAX, ans=0, sum=0, flag=0, cnt=0;

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

    cin>>n>>k;
    ll A[n];
    f0(i,n)
    {
        cin>>A[i];
        sum+=A[i];
    }
    sort(A,A+n,greater<ll>());
    x = ((k>n)?n:k);
    f0(i,x)
    {
        sum-=A[i];
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 1792
#ifdef DBG_MACRO_NO_WARNING
#include <dbg.h>
#endif
#include <bits/stdc++.h>
#define all(c) c.begin(), c.end()
#define isz(c) (int)c.size()

using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;

int main(void)
{
    bool x;
    cin >> x;
    cout << not x << endl;
    return 0;
}


Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
const int N = 1024;
int a[N][N];
int b[N][N];
int ok[N][N];
int main(void)
{
    int n;
    cin>>n;
    for (int i = 1;i <= n;++i)
        for (int j = 1;j <= n;++j)
            cin>>a[i][j],b[i][j] = a[i][j];
    for (int k = 1;k <= n;++k)
        for (int i = 1;i <= n;++i)
            for (int j = 1;j <= n;++j)
                b[i][j] = min(b[i][j],b[i][k] + b[k][j]);
    for (int i = 1;i <= n;++i)
        for (int j = 1;j <= n;++j)
            if (a[i][j] != b[i][j])
                return puts("-1") * 0;
    ll sum = 0;
    for (int k = 1;k <= n;++k)
        for (int i = 1;i <= n;++i)
            for (int j = 1;j <= n;++j)
                if (i != k && k != j)
                    if (b[i][j] == b[i][k] + b[k][j])
                        ok[i][j] = 1;
    for (int i = 1;i <= n;++i)
        for (int j = 1;j <= n;++j)
            if (!ok[i][j])
                sum += b[i][j];
    sum /= 2;
    cout << sum << '\n';
    return 0;
}


Measured memory_bytes: 5504
input()
numbers = list(map(int, input().split()))

evens = list()
for number in numbers:
    if(number%2 == 0):
        evens.append(number)

illegal = 0
for even in evens:
    if(even % 3 != 0 and even % 5 != 0):
        illegal += 1

if(illegal == 0):
    print("APPROVED")
else:
    print("DENIED")

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

pt, px, py = 0,0,0
for i in range(N):
    t, x, y = map(int, input().split())
    limit = t - pt
    dist = abs(x - px) + abs(y - py)
    if dist % 2 != limit % 2:
        print("No")
        break

    if dist <= limit:
        # print("pass")
        pt, px, py = t, x, y
        continue

    print("No")
    break
else:
    print("Yes")

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    s[k-1] = s[k-1]+('a'-'A');
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
#![allow(non_snake_case,unused_imports,dead_code)]
use std::io::Read;
use std::cmp::max;
use std::cmp::min;
use std::str::FromStr;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::BinaryHeap;
use std::cmp::Ordering;

fn comp_f64(a: &f64, b: &f64) -> Ordering {
    if a < b {
        return Ordering::Less;
    } else if a > b {
        return Ordering::Greater;
    }
    Ordering::Equal
}

fn main() {

    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut buf_it = buf.split_whitespace();

    let N = buf_it.next().unwrap().parse::<usize>().unwrap();
    let S = buf_it.next().unwrap().chars().collect::<Vec<_>>();
    let Q = buf_it.next().unwrap().parse::<usize>().unwrap();

    let Query = (0..Q).map(|_|
        (buf_it.next().unwrap().parse::<usize>().unwrap(),
        buf_it.next().unwrap(),
        buf_it.next().unwrap())
    ).collect::<Vec<_>>();

    let mut T = HashMap::new();
    for c in "abcdefghijklmnopqrstuvwxyz".chars(){
        T.insert(c,SegmentTree::new(N,max,0));
    }

    for (i,&c) in S.iter().enumerate(){
        let t = T.get_mut(&c).unwrap();
        (*t).set(i,1);
    }

    for j in 0..Q{
        if Query[j].0 == 1{
            let i = Query[j].1.parse::<usize>().unwrap() -1;
            let c = Query[j].2.chars().collect::<Vec<_>>()[0];
            for k in "abcdefghijklmnopqrstuvwxyz".chars(){
                let t = T.get_mut(&k).unwrap();
                (*t).set(i,0);
            }
            let t = T.get_mut(&c).unwrap();
            (*t).set(i,1);
        } else {
            let l = Query[j].1.parse::<usize>().unwrap() -1;
            let r = Query[j].2.parse::<usize>().unwrap();
            let mut ans = 0;
            for k in "abcdefghijklmnopqrstuvwxyz".chars(){
                let t = T.get(&k).unwrap();
                ans += t.get(l,r);
            }
            println!("{}",ans);
        }
    }
}

struct SegmentTree<N,F>
where F:Fn(N,N) ->N{
    n: usize,
    T: Vec<N>,
    func: F,
    identity: N,
}

impl<N:Copy,F> SegmentTree<N,F>
where F:Fn(N,N) ->N {
    fn new(n:usize,func:F,identity:N) -> SegmentTree<N,F>{
        let mut T = SegmentTree { n:n,T:Vec::new(),func:func,identity:identity};
        T.init();
        T
    }
    fn init(&mut self){
        self.n = 1<<format!("{:b}",self.n-1).len();
        self.T = (0..(2*self.n-1)).map(|_| self.identity).collect();
    }
    fn set(&mut self,index:usize,value:N){
        let i = index + self.n - 1;
        self.T[i] = value;
        self._update_parent((i-1)/2);
    }
    fn _update_parent(&mut self,i:usize){
        self.T[i] = (self.func)(self.T[i*2+1],self.T[i*2+2]);
        if i>0 { self._update_parent((i-1)/2)}
    }
    fn get(&self,l:usize,r:usize) -> N{
    self._get(l,r,0,0,self.n)
    }
    fn _get(&self,l:usize,r:usize,i:usize,a:usize,b:usize) -> N{
        if l<=a && b<=r {
            self.T[i]
        } else if b<=l || r<=a {
            self.identity
        } else{
            (self.func)(self._get(l,r,2*i+1,a,(a+b)/2),
                        self._get(l,r,2*i+2,(a+b)/2,b))
        }
    }
}

Measured memory_bytes: 114940
#include <cmath>
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<set>
#include<tuple>
#include<bitset>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
int main() {
	int x;
	cin >> x;
	if (x >= 400 && x <= 599) {
		cout << "8" << endl;
	}
	else if (x >= 600 && x <= 799) {
		cout << "7" << endl;
	}
	else if (x >= 800 && x <= 999) {
		cout << "6" << endl;
	}
	else if (x >= 1000 && x <= 1199) {
		cout << "5" << endl;
	}
	else if (x >= 1200 && x <= 1399) {
		cout << "4" << endl;
	}
	else if (x >= 1400 && x <= 1599) {
		cout << "3" << endl;
	}
	else if (x >= 1600 && x <= 1799) {
		cout << "2" << endl;
	}
	else if (x >= 1800 && x <= 1999) {
		cout << "1" << endl;
	}
	return 0;
}

Measured memory_bytes: 3592
n=int(input())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
C=[0]+list(map(int,input().split()))

A.sort()
B.sort()
C.sort()

total = [0]*(n+1)
ans = [0]*(n+1)
for i in range(n+1):
    l1 = 0
    r1 = n+1
    while l1 != r1:
        mid1 = (l1 + r1)//2
        if B[i] > A[mid1]:
            l1 = mid1 + 1
            total[i]=max(total[i],mid1+total[i-1])
        else:
            r1 = mid1

for i in range(n+1):
    l2 = 0
    r2 = n+1
    while l2 != r2:
        mid2 = (l2 + r2)//2
        if C[i] > B[mid2]:
            l2 = mid2 + 1
            ans[i] = max(ans[i],total[mid2])
        else:
            r2 = mid2
print(sum(ans))


Measured memory_bytes: 106788
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()

    return n // 3


print(main())




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



int main(){
  int n;
  cin >>n;
  int a[n+1];
  rep(i,n)cin >>a[i];
  sort(a,a+n);
  a[n]=0;
  int ans=0;
  int p=1;
  rep(i,n){
    if(a[i]==a[i+1]){p++;}
    else{
      if(a[i]<p){ans+=p-a[i];}else
      if(a[i]>p){ans+=p;}
      p=1;
    }
  }

  cout  << ans << endl; 
}

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

int main(){
    int N;
    cin >> N;
    string S[500];
    for(int i=0; i<N; i++) cin >> S[i];
    
    bool impossible = true;
    for(int i=0; i<N; i++) for(int j=0; j<N; j++) if(S[i][j] == '#') impossible = false;
    if(impossible){
        cout << -1 << endl;
        return 0;
    }

    int ans = 1e9;
    for(int i=0; i<N; i++){
        bool nothing = true;
        for(int j=0; j<N; j++) if(S[j][i] == '#') nothing = false;
        int result = nothing;
        if(nothing || S[i][i] == '.') result++;
        for(int j=0; j<N; j++) if(i != j && S[i][j] == '.') result++;
        ans = min(ans, result);
    }

    for(int j=0; j<N; j++){
        bool lack = false;
        for(int i=0; i<N; i++) if(S[i][j] == '.') lack = true;
        ans += lack;
    }

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

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,b,a) for(int i=b;i>=a;i--)
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Forenska(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define lowbit(x) ((x)&(-x))
#define GREATER(x) x,vector<x>,greater<x>
#define randIn(L,R) (((LL)rand()*rand())%(R-L)+L)
#define __lcm(a,b) ((a)/__gcd(a,b)*(b))
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pLL;
typedef vector<int> vec;
typedef vector<LL> vecL;
typedef vector<pii> vecP;
typedef vector<pLL> vecPL;
typedef vector<string> vecS;
typedef vector<vec> mat;
typedef complex<double> point;
const long double PI=3.14159265358979323846264338327950288419716939937510582097;
const LL INFLL=0x3f3f3f3f3f3f3f3f;
const int INF=0x3f3f3f3f;
const long double EPS=1e-10;
int read()
{
    int x=0;
    char ch=' ';
    bool flag=false;
    while(ch<'0' || ch>'9')
    {
        if(ch=='-')flag=true;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
    {
        x=(x<<3)+(x<<1)+ch-'0';
        ch=getchar();
    }
    return flag?-x:x;
}
const int MAX_N=15;
int ans=INF;
int D,G;
int p[MAX_N],c[MAX_N];
map <pii,int> dp;
void dfs(int pos,int sum,int score)
{
	if(score>=G)
	{
		ans=min(ans,sum);
		return;
	}
	if(pos>D)return;
	if(sum>=ans)return;
	if(dp[mp(pos,score)] && dp[mp(pos,score)]<=sum)return;
	dp[mp(pos,score)]=sum;
	rep(i,0,p[pos])dfs(pos+1,sum+i,score+pos*100*i);
	dfs(pos+1,sum+p[pos],score+pos*100*p[pos]+c[pos]);
}
int main()
{
	cin>>D>>G;
	For(i,1,D)cin>>p[i]>>c[i];
	dfs(0,0,0);
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 6784
n, m, q = gets.split.map(&:to_i)
s = Array.new(n){|i| i}
a = gets.split.map(&:to_i)
q = gets.split.map(&:to_i)
cur = 0
a.each do |i|
  if i % 2 == 0
    s.delete_at(cur = (cur+i) % n)
  else 
    s.delete_at(cur = (cur-i+n) % n)
  end
  n -= 1
end
q.each do |i|
  if s.include?(i) then puts 1
  else puts 0
  end
end

Measured memory_bytes: 22340
N, A, B = map(int, input().split())
S = input()

countA = 0
countB = 0

for i in S:
  if i == 'a' and countA + countB < A + B:
      print("Yes")
      countA += 1
  
  elif i == 'b' and countA + countB < A + B and countB < B:
      print("Yes")
      countB += 1
    
  else:
    print("No")

Measured memory_bytes: 4016
a,b,x=gets.split.map &:to_f

if a*a*b/2>=x
	puts Math.atan2(b, x*2/b/a) * (180.0/Math::PI)
else
	puts Math.atan2((a*b-x/a)*2/a, a) * (180.0/Math::PI)
end


Measured memory_bytes: 3836
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1000000007;
ll n;
map<ll,ll>m;
inline ll f(ll x){
	if(m[x])
		return m[x];
	return m[x]=((f(x/2)+f((x-1)/2)+f((x-2)/2)))%mod;
}
int main(){
	m[0]=1,m[1]=2;
	scanf("%lld",&n);
	printf("%lld",f(n));
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <bitset>
#define INF	100000000
#define pb	push_back
#define fi first
#define sec second
#define SS stringstream
using namespace std;
typedef pair<int, int> P;
typedef long long int	ll;

double a;

int main(){
	while(cin >> a){
		double s = a;
		for(int i = 2; i <= 10; i++){
			if(i%2 == 0){
				a *= 2;
				s += a;
			}
			else{
				a = a/3;
				s += a;
			}
		}
		printf("%0.9f\n", s);
	}
}

Measured memory_bytes: 1236
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
    ll x;  // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

struct combination {
    vector<mint> fact, ifact;
    combination(int n) : fact(n + 1), ifact(n + 1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
};

class Main {
    int N;
    vector<ll> A;
    void input() {
        cin >> N;
        A.resize(N);
        REP(i, N) { cin >> A[i]; }
    }
    void output() {
        mint a = 0, b = 0;
        REP(i, N) {
            a += A[i];
            b += A[i] * A[i];
        }
        a *= a;
        a -= b;
        a /= 2;
        cout << a << endl;
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    return 0;
}


Measured memory_bytes: 4780
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll n, d;
    cin >> n >> d;
    ll cur = d, res = 1;
    REP(i, n){
        if(cur + d >= n - 1) break;
        cur += 2 * d + 1;
        res++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
def bellman_ford():#ﾌﾍｲﾛ検出
    n,m=map(int, input().split())
    g = [[] for _ in range(n)]
    for i in range(m):
        a,b,c=map(int, input().split())
        g[a-1].append([b-1,-1*c])
    dist = [float("inf")]*n
    inf = float("inf")
    dist[0] = 0
    for i in range(n):
        for v in range(n):
            for k in range(len(g[v])):
                edge = g[v][k]
                if(dist[v]!=inf and dist[v]+edge[1] < dist[edge[0]]):#dist[v]!=10000:未到達だったら無視するので
                    dist[edge[0]] = dist[v] + edge[1]

    ans = dist[n-1]
    neg = [0]*n

    for i in range(n):
        for edge in g[i]:
            if(dist[i]==inf):continue
            if(dist[i]+edge[1] < dist[edge[0]]):
                dist[edge[0]] = dist[i]+edge[1]
                neg[edge[0]]=1
            if(neg[i]):
                neg[edge[0]]=1



    if(not neg[n-1]):
        print(dist[n-1]*-1)
    else:
        print("inf")

    return False


def main():
    bellman_ford()
if __name__ == '__main__':
    main()


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

signed main(){
    int n,m;cin>>n>>m;
    cout<<n*m<<endl;
}


Measured memory_bytes: 3108
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define eb emplace_back
#define precision(n) cout << fixed << setprecision(n);
#define fast {ios_base::sync_with_stdio(false);cin.tie(NULL);}
int main()
{
    fast;
    int n;
    cin>>n;
    if(n%10==3)
    {
        cout<<"bon"<<endl;
    }
    else if(n%10==0||n%10==6||n%10==1||n%10==8)
    {
        cout<<"pon"<<endl;
    }
    else
        cout<<"hon"<<endl;

    return 0;

}



Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define fir first
#define sec second
using namespace std;
typedef pair<int, int> pii;
const int maxn = 2005;

int n, m, deg[maxn];

int head[maxn], tot;
struct edge{
	int nxt, to;
}e[maxn<<1];

void Addedge(int x, int y)
{
	e[++tot] = (edge){head[x], y};
	head[x] = tot;
}

int f[maxn], dep[maxn], s[maxn];

void dfs1(int x)
{
	int id;
	for(int i = head[x]; i; i = e[i].nxt)
	{
		id = e[i].to;
		if(id == f[x])	continue;
		f[id] = x;
		dep[id] = dep[x] + 1;
		dfs1(id);
	}
}

int lca(int x, int y)
{
	if(dep[x] < dep[y])	swap(x, y);
	while(dep[x] > dep[y])
		x = f[x];
	while(x != y)
	{
		x = f[x];
		y = f[y];
	}
	return x;
}

void dfs2(int x)
{
	int id;
	for(int i = head[x]; i; i = e[i].nxt)
	{
		id = e[i].to;
		if(id == f[x])	continue;
		dfs2(id);
		s[x] += s[id];
	}
}

pii a[maxn], b[maxn];
int col[maxn], mat[maxn];
bool vis[maxn];

int main()
{
	scanf("%d%d", &n, &m);
	int u, v, id1, id2, ans = 0;
	for(int i = 1; i < n; ++i)
	{
		scanf("%d%d", &u, &v);
		Addedge(u, v);
		Addedge(v, u);
		++ deg[u];
		++ deg[v];
	}
	dfs1(1);
	for(int i = 1; i <= m; ++i)
	{
		scanf("%d%d", &u, &v);
		a[i] = b[i] = make_pair(u, v);
		++ s[u];
		++ s[v];
		s[lca(u, v)] -= 2;
	}
	dfs2(1);
	for(int i = 1; i <= n; ++i)
		ans += min(s[i], 2);
	printf("%d\n", ans);
	for(int i = 1; i < n; ++i)
	{
		for(int j = 1; j <= n; ++j)
			if(deg[j] == 1 && !vis[j])
			{
				u = j;
				break;
			}
		vis[u] = 1;
		for(int j = head[u]; j; j = e[j].nxt)
		{
			v = e[j].to;
			if(!vis[v])	break;
		}
		-- deg[v];
		id1 = id2 = 0;
		for(int j = 1; j <= m; ++j)
			if((b[j].fir == u) ^ (b[j].sec == u))
			{
				if(!id1)
				{
					id1 = j;
				}
				else
				{
					id2 = j;
					break;
				}
			}
		if(!id1)	continue;
		if(!id2)
		{
			if(b[id1].fir == u)
				b[id1].fir = v;
			else
				b[id1].sec = v;
			continue;
		}
		if(b[id1].fir == u)
		{
			if(b[id2].fir == u)
			{
				b[id1].fir = b[id2].sec;
				col[id2] = 1;
			}
			else
				b[id1].fir = b[id2].fir;
		}
		else
		{
			if(b[id2].sec == u)
			{
				b[id1].sec = b[id2].fir;
				col[id2] = 1;
			}
			else
				b[id1].sec = b[id2].sec;
		}
		b[id2].fir = b[id2].sec;
		mat[id2] = id1;
		for(int j = 1; j <= m; ++j)
			if((b[j].fir == u) ^ (b[j].sec == u))
			{
				if(b[j].fir == u)
					b[j].fir = v;
				else
					b[j].sec = v;
			}
	}
	for(int i = 1; i <= m; ++i)
		if(mat[i])
		{
			col[i] ^= col[mat[i]];
		}
	for(int i = 1; i <= m; ++i)
		printf("%d %d\n", col[i]? a[i].sec: a[i].fir, col[i]? a[i].fir: a[i].sec);
	return 0;
}


Measured memory_bytes: 384
# -*- coding: utf-8 -*-
import math
K = int(input())

N = 50
As = [N-1 for _ in range(N)]
ind = 0

modk = K % 50
base = 49 + K//50 - modk

ans = []

if modk != 0:
    for i in range(N):
        if i >= N - modk:
            ans.append(base + N + 1)
        else:
            ans.append(base)
    # for i in range(0,modk,1):
    #     ans.append(base + N + 1)
    # for i in range(modk,N,1):
    #     ans.append(base)
else:
    for i in range(N):
        ans.append(49 + K//50)
# for k in range(K):
#     for i in range(N):
#         As[i] -= 1
#     As[ind] += N + 1
#     ind += 1
#     ind = ind % N
# print(N)
# print(*As)
print(N)
print(*ans)


Measured memory_bytes: 3064
import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();  
        int[] a = r.ii();
        String s = r.s();
        println(s.matches(String.format("[0-9]{%d}-[0-9]{%d}", a[0], a[1])) ? "Yes" : "No");
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static int Int(String s){
        return Integer.parseInt(s);
    }
    static long Long(String s){
        return Long.parseLong(s);
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
        long l() throws IOException{
            return Long(s());
        }
        long[] ll() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            long[] ll = new long[size];
            for(int j = 0; j < size; j++) ll[j] = Long(ss[j]);            
            return ll;
        }
    }
}

Measured memory_bytes: 21332
r,D,X2000 = map(int, input().split())

ans = []

A2001 = ((r * (X2000) ) - D)

ans.append(A2001)

for i in range(9):
    A = ( (r * (ans[i])) - D )
    ans.append(A) 
    
for i in ans:
    print(i)

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

int main(){
  int n;
  cin>>n;
  double a[n],b[n],A=0,B=0,C=0,D=0;
  r(i,n)cin>>a[i];
  r(i,n)cin>>b[i];
  r(i,n){
    A+=abs(a[i]-b[i]);
    B+=abs(a[i]-b[i])*abs(a[i]-b[i]);
    D+=abs(a[i]-b[i])*abs(a[i]-b[i])*abs(a[i]-b[i]);
    C=max(C,abs(a[i]-b[i]));
  }
  B=sqrt(B);
  D=pow(D,1.0/3);
  printf("%.11f\n",A);
  printf("%.11f\n",B);
  printf("%.11f\n",D);
  printf("%.11f\n",C);
}


Measured memory_bytes: 3396
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace C_test_For_Atcorder
{
    public static class Extensions
    {
        public static string Reverse(this string sourse){
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            ulong result = 0;
            var S = cin.Read;

            for (int i = 0; i < 1 << S.Length - 1; i++)
            {
                string curS = S;
                int seek = 0;
                for (int j = 0; j < S.Length - 1; j++)
                {
                    seek++;
                    if ((i & (1 << j)) != 0)
                    {
                        curS = curS.Substring(0, seek) + "+" + curS.Substring(seek);
                        seek++;
                    }
                }
                var list = curS.Split('+');
                for (int j = 0; j < list.Length; j++)
                {
                    result += UInt64.Parse(list[j]);
                }
            }
            Console.WriteLine(result);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue inputStream;

        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return (string)inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return (string)inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }

}

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

int main()
{
    int a, b;
    cin >> a;
    cin >> b;
    
    if(a == 1 && b == 2){
        cout << 3 << endl;
    }
    else if(a == 1 && b == 3){
        cout << 2 << endl;
    }
    else if(a == 2 && b == 3){
        cout << 1 << endl;
    }
    else if(a == 2 && b == 1){
        cout << 3 << endl;
    }
    else if(a == 3 && b == 1){
        cout << 2 << endl;
    }
    else if(a == 3 && b ==2){
        cout << 1 << endl;
    }
    
    return 0;
}


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

struct Quadruple {
    int a, b, c, d;
    void read() {
        scanf("%d%d%d%d", &a, &b, &c, &d);
    }
} a[50];
int n, m, q, ans, seq[15];

int count() {
    int sum = 0;
    for (int i = 1; i <= q; ++i) {
        if (seq[a[i].b] - seq[a[i].a] == a[i].c) {
            sum += a[i].d;
        }
    }
    return sum;
}

void dfs(int stp) {
    if (stp > n) {
        ans = max(ans, count());
        return;
    }
    for (int i = seq[stp - 1]; i <= m; ++i) {
        seq[stp] = i;
        dfs(stp + 1);
    }
}

int main() {
    scanf("%d%d%d", &n, &m, &q);
    for (int i = 1; i <= q; ++i) {
        a[i].read();
    }
    seq[0] = 1;
    dfs(1);
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 3844
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, lg = 19;
int mask[N], cnt[N][lg + 2], ans, n;
vector<int> gr[N];
void dfs(int v, int par = -1) {
	int rn = 0;
	for (auto u : gr[v]) {
		if (u != par) {
			dfs(u, v), mask[v] |= mask[u];
			for (int i = 0; i < lg; i++) {
				if ((mask[u] >> i) & 1)
					cnt[v][i]++;
				if (cnt[v][i] > 1)
					rn = max(rn, i + 1);
			}
		}
	}
	for (int i = rn; i < lg; i++) {
		if (!((mask[v] >> i) & 1)) {
			rn = i;
			break;
		}
	}
	ans = max(ans, rn);
	mask[v] = mask[v] & (((1 << lg) - 1) ^ ((1 << rn) - 1));
	mask[v] |= (1 << rn);
}	
int main() {
	cin >> n;
	for (int i = 0; i < n - 1; i++) {
		int x, y;
		cin >> x >> y;
		x--, y--;
		gr[x].push_back(y), gr[y].push_back(x);
	}
	dfs(0);
	cout << ans;
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N+1,0);
  for (int i=1; i<N+1; i++){
    cin >> A.at(i); 
  }
  int i = 1;
  int mi = 0;
  int ans = 0;
  while (i != 2){
    ans++;
    mi = i;
    i = A.at(i);
    A.at(mi) = 1;
    if (A.at(i) == 1 && i != 2){
      ans = -1;
      break;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3720
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#a, b, c = map(int, input().split())
a, b, c = input().split()
a = int(a)
c = int(c)

if b == "+":
  print(a + c)
elif b == "-":
  print(a - c)


Measured memory_bytes: 2940
#include <cstdio>
#define MOD 1000000007
using namespace std;

typedef long long LL;

LL pow(LL a, LL n)
{
	LL res = 1;
	while(n > 0)
	{
		if(n & 1)
			res = res * a % MOD;
		a = a * a % MOD;
		n >>= 1;
	}
	return res;
}

LL C(LL n, LL m)
{
	if(n < m) return 0;
	if(m > n - m) m = n - m;
	LL s1 = 1, s2 = 1;
	for(int i=0; i<m; i++)
	{
		s1 = s1 * (n - i) % MOD;
		s2 = s2 * (i + 1) % MOD;
	}
	return s1 * pow(s2, MOD - 2) % MOD;
}

int main(int argc, char** argv)
{
	LL x, y;
	scanf("%lld%lld", &x, &y);
	if((x + y) % 3 != 0)
	{
		puts("0");
		return 0;
	}
	LL sum = (x + y) / 3, diff = x - y;
	LL n = (sum - diff) / 2;
	LL m = n + diff;
	if(n < 0 || m < 0)
	{
		puts("0");
		return 0;
	}
	printf("%lld\n", C(sum, n));
	return 0; 
}

Measured memory_bytes: 1664