akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define outa(a, n) rep(_, n) cout << a[_] << " "; cout << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)

int main() {
    int n;
    cin >> n;
    map<char, int> mp;
    rep(i, n) {string str; cin >> str; mp[str[0]]++; }
    int a[5] = {0};
    a[0] = mp['M']; a[1] = mp['A']; a[2] = mp['R']; a[3] = mp['C']; a[4] = mp['H'];
    ll ans = 0;
    rep(i, (1 << 5)) {
        int c = 0;
        ll tmp = 1;
        rep(j, 5) {
            if (i & (1 << j)) {
                c++;
                tmp *= a[j];
            }
        }
        if (c == 3) ans += tmp;
    }
    out(ans);
}


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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;cin>>a>>b;
    int t=max(a+b,a-b);
    t=max(t,a*b);
    cout<<t<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		
		a = a - a % 1000;
		if (a == 0) {
			System.out.println("ABC");
		} else {
			System.out.println("ABD");
		}
	}
}


Measured memory_bytes: 20948
n=int(input())
info=[]
import sys
for i in range(n):
  x,y,h=map(int,input().split())
  info.append([x,y,h])
for x in range(0,101):
  for y in range(0,101):
    for A in info:
      if A[2]!=0:
        h=A[2]+abs(x-A[0])+abs(y-A[1])
        break
    failflag=0
    for A in info:
      if A[2]!=max(0,h-abs(x-A[0])-abs(y-A[1])):
        failflag=1
        break
    if failflag==0:
      print(x)
      print(y)
      print(h)
      sys.exit()

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

int main() {
int N,c;
  cin >> N;
  int count = 0;
  for(int i = 0; i < N; i++){
  	cin >> c;
    if(c%2 == 0){
    	if(c%3 != 0 && c%5 != 0){
        	count++;
        }
    }
  }
  if(count == 0){
  	cout << "APPROVED" << endl;
  }
  else cout << "DENIED" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
       int a,h,m,s;
	scanf("%d",&a);
	s=a%60;
	m=a/60;
	h=m/60;
	if(h)
	m = m -h*60;
        
	printf("%d:%d:%d\n",h,m,s);
	return 0;	
}

Measured memory_bytes: 592
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stack>
#include <vector>
#define ls (node << 1)
#define rs ((node << 1) | 1)
typedef long long ll;
using namespace std;
char S[1024], T[1024];
int main()
{
    cin >> S >> T;
    int anss = 0x3f3f3f3f;
    for (int i = 0; S[i];i++)
    {
        int ans = 0;
        int flag = 0;
        int pos = i;
        for (int j = 0; T[j];j++)
        {
            if (!S[pos+j])
            {
                flag = 1;
                break;
            }
            if (S[pos + j] != T[j])
                ans++;
        }
        if (!flag)
            anss = min(anss, ans);
    }
    cout << anss << endl;
}

Measured memory_bytes: 3632
def int_to_list(bit, n):
    l = []
    for i in range(n):
     if bit & (1 << i):
         l.append(i)
    return l

def solve():
    N = int(input())
    
    l = [[] for _ in range(N)]
    for i in range(N):
        for _ in range(int(input())):
            p, q = map(int, input().split())
            l[i].append((p-1, q))

    ans = 0
    for i in range(1 << N):
        partial = int_to_list(i, N)

        f = True
        for j in range(N):
            if j not in partial: continue
            for p, q in l[j]:
                if q == 0 and p in partial:
                    f = False
                if q == 1 and not p in partial:
                    f = False
        if f:
            ans = max(ans, len(partial))
            
    return ans

print(solve())

Measured memory_bytes: 3064
from collections import deque


def BFS():
    color=["white" for _ in range(h)]
    D=[-1 for _ in range(h)]
    M=[[] for _ in range(h)]

    for i in range(h-1):
        M[i].append(i+1)
        M[i+1].append(i)

    queue=deque([])
    for i in line:
        queue.append(i)
        D[i]=i
        color[i]="gray"

    while len(queue)>0:
        u=queue.popleft()
        for i in M[u]:
            if D[i]==-1 and color[i]=="white":
                D[i]=D[u]
                color[i]="gray"
                queue.append(i)

    return D


h,w,k=map(int,input().split())
S=[list(input()) for _ in range(h)]
M=[[0 for _ in range(w)] for _ in range(h)]

num,line=0,[]
for i in range(h):
    if S[i].count("#")!=0:
        p=num
        for j in range(w):
            if S[i][j]=="#":
                num +=1
            elif num==p:
                M[i][j]=num+1
                continue
            M[i][j]=num
        line.append(i)

D=BFS()
for i in range(h):
    M[i]=M[D[i]]

for i in range(h):
    print(*M[i])

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

int main() {

  int N ;
  cin >> N ;

  int A=0 , B=0;

  vector<int> a(N);

  for(int i=0;i<N;i++){
    cin >> a[i];
  }

  sort(a.begin() , a.end());
  reverse(a.begin() , a.end());

  if(N%2==0){
    for(int i=0 ; i<N/2 ; i++){
      A += a[0];
      reverse(a.begin() , a.end());
      a.pop_back();
      reverse(a.begin() , a.end());
      B += a[0];
      reverse(a.begin() , a.end());
      a.pop_back();
      reverse(a.begin() , a.end());
    }
  }

  else{
    for(int i=0 ; i<(N-1)/2 ; i++){
      A += a[0];
      reverse(a.begin() , a.end());
      a.pop_back();
      reverse(a.begin() , a.end());
      B += a[0];
      reverse(a.begin() , a.end());
      a.pop_back();
      reverse(a.begin() , a.end());
    }

    A += a[0];
  }

  cout << A-B << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <map>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

typedef pair<double, double> squareCorner;
typedef pair<squareCorner, squareCorner> squareCorners;

double totalLength (vector<squareCorners> squares, double x) {
    // Ignore squares not crossing the ray line
    for(vector<squareCorners>::iterator it = squares.begin(); it!=squares.end(); it++) {
        double x0 = it->first.first;
        double x1 = it->second.first;
        if (x < x0 || x >= x1) {
            squares.erase(it);
            it--;
        }
    }

    // Add y[01] to a list
    vector<pair<double, bool> > ys;
    for(unsigned i=0; i<squares.size(); i++) {
        squareCorners p = squares[i];
        double y0 = p.first.second;
        double y1 = p.second.second;
        ys.push_back(make_pair(y0, true));
        ys.push_back(make_pair(y1, false));
    }

    // Sort list
    sort(ys.begin(), ys.end());

    // Compute sum distance
    int beginning = 0;
    double l = 0;
    double startSegment = 0.;
    for(unsigned i=0; i<ys.size(); i++) {
        pair<double, bool> p = ys[i];
        bool isBeginning = p.second;
        double y = p.first;

        if (beginning == 0)
            startSegment = y;
        beginning += isBeginning ? 1 : -1;
        if (beginning == 0)
            l += y - startSegment;
    }

    return l;
}

int main () {
    int N;
    cin >> N;
    int cpt = 0;

    // Read info for one Problem
    while (N != 0) {
        cpt++;
        vector<squareCorners> squares;
        set<double> xs;

        // Read info about each antenna
        for (int i=0; i<N; i++) {
            double cx, cy, r;
            cin >> cx >> cy >> r;
            double x0 = cx - r,
                   x1 = cx + r,
                   y0 = cy - r,
                   y1 = cy + r;
            xs.insert(x0);
            xs.insert(x1);
            squares.push_back(make_pair(make_pair(x0, y0), make_pair(x1, y1)));
        }

        double area = 0.;
        set<double>::iterator it=xs.begin();
        double prevY = *it;
        double prevWidth = totalLength(squares, prevY);
        it++;
        while (it != xs.end()) {
            area += prevWidth * (*it - prevY);
            prevY = *it;
            prevWidth = totalLength(squares, *it);
            it++;
        }

        area = round(area*100)/100;

        printf("%d %.2f\n", cpt, area);
        cin >> N;
    }
}



Measured memory_bytes: 3364
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

/* mint、表示は変数名.x */
struct mint {
  ll x;
  mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
  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 {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  /* 変数名.pow(n) */
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // 以降はMODが素数のみ
  mint inv() const {
    return pow(MOD - 2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};

int main() {
  int N;
  cin >> N;
  mint ans = 1;
  repp(i, 1, N) {
    mint j = i;
    ans *= j;
  }
  cout << ans.x << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long int LLI;

int main()
{
	int seat, person, gap, store;
	cin >> seat >> person >> gap;
	store = person + gap;
	store = seat / store;
	if( store * ( person + gap ) + gap <= seat )
		cout << store;
	else cout << store - 1;
}

Measured memory_bytes: 3576
#include<bits/stdc++.h>
#include<vector>
#include<math.h>
using namespace std;
#define MOD 998244353
#define MAX 3001
#define MAX_DISTANCE 501
#define PRECISION 0.00000000001
#define INF 4000000000000000000
int main()
{
    double cir;
    scanf("%lf",&cir);
    cir=cir*2*acos(-1);
    printf("%.8f",cir);
    return 0;
}


Measured memory_bytes: 3780
#include <bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) 
#define ll long long 
#define int long long 
#define vll vector<long long>
#define pii pair<long long ,long long > 
#define vvi vector< vector<long long > > 
#define vpii vector<pair<int,int>> 
#define pll  pair<long long ,long long > 
#define pb  push_back
#define ff  first 
#define sec second  
#define SORT(a) sort(a.begin(),a.end())
#define SORTR(a) sort(a.rbegin(),a.rend()) 
#define m_p make_pair
#define all(x) (x.begin(),x.end()) 
#define sz(v) ((int)(v.size()))
#define endl '\n'
typedef vector< long long > vi ;
const int MOD=1e9 +7 ;
int size=10000000; 
 void addself(int &a, int b){
 	a+=b; 
 	if(a>=MOD) a-=MOD; 
 }

 void subself( int &a , int b){
 	a-=b; 
 	if(a<0) a+=MOD; 
 }


int32_t main(){
  fast; 
/*  #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
  #endif */
	
  int T=1; //cin>>T; 
  while(T--){

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

  		vi dp(k+1,0); 
  		dp[0]=1; 

  		for(int i=0;i<n;i++){
  			vi fake(k+1,0); 
  			for(int used=k;used>=0;--used){
  				 int L=used+1; 
  				 int R=used+min(a[i],k-used);
  				 int temp=dp[used]; 
  				 if(L<=R){
  				 	addself(fake[L],temp); 
  				 	if(R+1<=k) subself(fake[R+1],temp); 
  				 } 
  			}	
  			int prev=0; 
  			for(int j=0;j<=k;j++){ 
  				addself(prev,fake[j]); 
  				addself(dp[j],prev); 
  			}

  		}

  		cout<<dp[k]<<endl; 
  }
    


  return 0; 
} 


Measured memory_bytes: 1792
package main

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

var sc = bufio.NewScanner(os.Stdin)

const MAX_N = 1e5 + 10

func nextInt() int {
    sc.Scan()
    i, e := strconv.Atoi(sc.Text())
    if e != nil {
        panic(e)
    }
    return i
}

func max(x, y int) int {
	if x > y {
		return x
	} else {
		return y
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	var n int
	var h [MAX_N]int

	n = nextInt()
	for i := int(0); i < n; i++ {
		h[i] = nextInt()
	}

	var max_len int = 0
	var current_len int = 0

	for i := int(0); i < n-1; i++ {
		if h[i] >= h[i+1] {
			current_len++
			max_len = max(max_len, current_len)
		} else {
			max_len = max(max_len, current_len)
			current_len = 0
		}
	}

	fmt.Println(max_len)
}

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

const int M = 1e7;
const int N = 2e2 + 10;
struct E {int v, nt;} e[N*N];
int n, c, cnt, tot, h[N], x[N], p[M+10], mask[N], used[N];

inline void add(int u, int v) {
	e[++tot] = (E){v, h[u]}, h[u] = tot;
	e[++tot] = (E){u, h[v]}, h[v] = tot;
}

template <class T> inline void in(T &x) {
	x = 0; int f = 1; char ch = getchar();
	for (; ch<'0' || ch>'9';) {if (ch=='-') f=-1; ch = getchar();}
	for (; ch>='0' && ch<='9';) x = x*10 + ch-'0', ch = getchar();
	x *= f;
}

inline void init() {
	for (int i = 3; i <= M; i += 2) p[i] = 1;
	for (int i = 3; i * i <= M; i += 2) {
		if (!p[i]) continue;
		for (int j = i * i; j <= M; j += i) p[j] = 0;
	}
}

inline int dfs(int x) {
	int v; used[x] = 1;
	for (int v, i = h[x]; i; i = e[i].nt)
		if (!mask[v = e[i].v] || (!used[mask[v]] && dfs(mask[v]))) {
			mask[v] = x, mask[x] = v; return 1;
		}
	return 0;
}

inline int match() {
	int res = 0;
	fill(mask + 1, mask + c + 1, 0);
	for (int i = 1; i <= c; ++i)
		if (!mask[i]) {
			fill(used + 1, used + c + 1, 0);
			if (dfs(i)) ++res;
		}
	return res;
}

inline void work() {
	int val; in(n);
	for (int i = 1; i <= n; ++i) {
		in(val);
		if (!c || val != x[c]) x[++c] = val;
		else --c;
		x[++c] = val + 1;
	}
	for (int i = 1; i <= c; ++i) if (x[i] % 2 == 0) ++cnt;
	for (int i = 1; i <= c; ++i)
		for (int j = i + 1; j <= c; ++j)
			if (p[x[j] - x[i]]) add(i, j);
	int ret = match();
	printf("%d\n", c / 2 + (c / 2 - ret) + (cnt - ret) % 2);
}

int main() {init(), work(); return 0;}

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

using namespace std;

int main(){

	int n, cnt=0, flag;
	vector<int> v;

	cin>> n;

	v.resize(n);
	for(int i=0;i<n;i++){
		cin>> v[i];
		flag=0;
		for(int j=0;j<i;j++){
			if(v[i]<v[j]){
				flag=1;
				break;
			}
		}
		if(flag==0) cnt++;
	}

	cout<< cnt << endl;


}

Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char const *argv[]) {

    int x,y,tmp;

    while(1) {
        scanf("%d%d",&x,&y);

        if(x == 0 && y == 0)break;

        if (x > y) {
            tmp = x;
            x = y;
            y = tmp;
        }
        printf("%d %d\n",x,y);
    }
    return 0;
}



Measured memory_bytes: 1916
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <istream>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define REP(a,b) for (int i = a; i <= (b); ++i) //aからbまで繰り替えす
#define vec vector<int>a(n)
#define soot(a) sort(a.begin(),a.end())
/*int n;
cin >> n;
vector<int>a(n);
rep0(i, n - 1)cin >> a[i];*/
using namespace std;
int main() {
	string s,b,c;
	cin >> b>>s>>c;
	cout << "A" << s[0] << "C" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                              \
  ifstream in("atcoder-problems/abc141_d.txt"); \
  cin.rdbuf(in.rdbuf());
#else
#define INPUT_FILE
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
const int INF = 100100100;
const ll LINF = 1e18 + 100;
const int MOD = 1e9 + 7;

int loga(int x, int a) {
  if (x == 0 || x == 1) return 0;
  int cnt = 0;
  while (x % a == 0) {
    x /= a;
    cnt++;
  }
  return cnt;
}

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N, M;
  cin >> N >> M;

  priority_queue<ll> a;
  rep(i, N) {
    ll _a;
    cin >> _a;
    a.push(_a);
  }

  while (M > 0) {
    ll current = a.top();
    a.pop();
    ll next = 1;
    if (!a.empty()) next = a.top();
    if (next == 0) next = 1;

    ll num = loga(current / next, 2);
    if (num == 0) num++;
    if (num > M) num = M;

    current /= pow(2, num);
    M -= num;
    a.push(current);
  }

  ll ans = 0;
  while (!a.empty()) {
    ans += a.top();
    a.pop();
  }
  cout << ans << endl;
}

Measured memory_bytes: 1400
def d_handstand(N, K, S):
    index_switched = [0]
    for i in range(1, N):
        if S[i] != S[i - 1]:
            index_switched.append(i)
    max_index = max(index_switched)

    ans_candidate = []
    for k in range(len(index_switched)):
        if S[index_switched[k]] == '0':
            ans_candidate.append((index_switched[k + 2 * K] if k + 2 * K
                                  < len(index_switched) else N) - index_switched[k])
        elif S[index_switched[k]] == '1':
            ans_candidate.append((index_switched[k + 2 * K + 1] if k + 2 * K
                                  + 1 < len(index_switched) else N) - index_switched[k])
    return max(ans_candidate)

N, K = [int(i) for i in input().split()]
S = input()
print(d_handstand(N, K, S))

Measured memory_bytes: 11116
#include<iostream>
using namespace std;
int main()
{
  string s;
  cin >> s;
  if(s == "Sunny"){
    cout << "Cloudy" <<endl;
  } else if(s == "Cloudy"){
    cout << "Rainy" << endl;
  } else if(s == "Rainy"){
    cout << "Sunny" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define eb          emplace_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mp(x,y)     make_pair(x,y) 
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,a,n)   for(ll i=a;i<n;i++)
#define frr(i,a,n)  for(ll i=n-1;i>=a;i--)


const ll N   =  500005;
const ll mod = 1e9 + 7;
using namespace std;

std::vector<pii> adj[N];
std::vector<bool> dis(N), vis(N);

void solve()
{
// string s;
  ll n,m,k,x=0,y=0,c=0,q,ans=0;
  cin>>n;
  for (ll i = 0; i < n-1; ++i)
  {
  cin>>x>>y>>m;
  adj[x].pb({y,m});
  adj[y].pb({x,m});
  }
 queue<ll> nodes;
  nodes.push(1);
  vis[1] = 1;
  dis[1] = 1;
  while(!nodes.empty())
  { 
    x=  nodes.front();
    //c(x);
    nodes.pop();
    for(auto i : adj[x])
    {
      if(!vis[i.F])
      {
        nodes.push(i.F);
        vis[i.F] = 1;
        //cout<<i.F<<" ";
        if(i.S%2==0)
        {
          dis[i.F] = dis[x];
        }
        else dis[i.F] = 1 - dis[x];
      }
    }

  }
  for (int i = 1; i <= n; ++i)
  {
    cout<<dis[i]<<"\n";
  }
}

signed main(){
   
      ios_base::sync_with_stdio(false);   
      cin.tie(NULL);
      ll T=1;
      //cin>>T;
      while(T--)
      {
      solve();
      }
      return 0;
    }


Measured memory_bytes: 17408
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cmath>
#include <map>
#include <set>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define ll long long
#define ull unsigned long long
#define push(a) push_back(a)
#define pop(a) pop_back(a)
#define debug(x) cout<<#x<<": "<<x<<endl
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int main(){
  int a,b,c,d=0;
  bool f=false;
  cin>>a>>b>>c;
  if(a==b+c){
    f=true;
  }else if(b==a+c){
    f=true;
  }else if(c==a+b){
    f=true; 
  }
  
  if(f){
    cout<<"Yes"<<endl;
  }else{
     cout<<"No"<<endl;
  } 
}


Measured memory_bytes: 256
inputA,inputB =map(int, input().split(' '))

#inputA = 1
#inputB = 100

if inputA == 1:
    print(inputB)
else:
    for count in reversed(range(0,inputA,1)):
        print(inputB-count)
    for count in range(1,inputA,1):
        print(inputB+count)

Measured memory_bytes: 3060
import java.util.*

fun main(args: Array<String>) {
    val (n, q) = readLine()!!.split(' ').map(String::toInt)
    val ansArray = Array(n + 1) { 0L }
    val tree = Array(n + 1) { mutableListOf<Int>() }
    val cost = Array(n + 1) { 0L }

    (1 until n).forEach {
        val (a, b) = readLine()!!.split(' ').map(String::toInt)
        tree[a].add(b)
    }
    (1..q).forEach {
        val (p, x) = readLine()!!.split(' ').map(String::toInt)
        cost[p] = cost[p] + x
    }

    val queue = ArrayDeque<Int>()
    queue.add(1)
    while (queue.isNotEmpty()) {
        val index = queue.pollLast()!!
        ansArray[index] = cost[index]
        val to = tree[index]
        to.let {
            for (t in to) {
                queue.add(t)
                cost[t] = cost[index] + cost[t]
            }
        }
    }

    (1..n).forEach {
        print("${ansArray[it]} ")
    }
}


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

int main()
{
    int n,su=0; cin>>n;
    char temp,c='0';
    for(int i=1;i<=n;i++)
    {
        cin>>temp;
        if(temp!=c) su++;
        c=temp;
    }
    cout<<su; return 0;
}


Measured memory_bytes: 256
n,m = map(int, input().split())
input_sheet = [[0]*m]*n
add_migi = [0]*n
add_shita = [0]*(m+1)
output_sheet = [[0 for i in range(m+1)] for j in range(n+1)]
for i in range(n):
  input_sheet[i] = list(map(int, input().split()))
  output_sheet[i][m] = sum(input_sheet[i])
  for j in range(m):
    output_sheet[i][j] = input_sheet[i][j]
for j in range(m):
  for i in range(n):
    output_sheet[n][j] += input_sheet[i][j]
output_sheet[n][m] = sum(map(sum, input_sheet))

for i in range(n+1):
  for j in range(m):
    print(output_sheet[i][j],end=' ')
  print(output_sheet[i][m],sep='')


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

#define slld(longvalue) scanf("%lld", &longvalue)
#define plld(longvalue) printf("%lld\n", longvalue)

#define slf(longvalue) scanf("%lf", &longvalue)
#define plf(longvalue) printf("%lf\n", longvalue)
#define sc(letter) scanf("%c", &letter)
#define pc(letter) printf("%c", letter)

#define ss(name) scanf("%s", name)
#define ps(name) printf("%s", name)

#define pnew printf("\n")

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >
#define pii pair < int, int >

#define printcase(indexing,ans) printf("Case %lld: %lld\n", indexing, ans)

#define pb(x) push_back(x)

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

#define mod 1000000009


using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

    slld(n);

    ll x = n / 500;

    n %= 500;

    ll y = n / 5;

    cout << (x * 1000) + (y * 5) << endl;


}





Measured memory_bytes: 256
n, k = map(int, input().split())

ans = 0
if k == 0:
    ans = n ** 2
else:
    for b in range(k+1, n+1):
        q = n // b
        r = n % b
        ans += q * (b-k) + max(0, r-k+1)
    
print(ans)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    ll n;cin>>n;
    vector<vector<ll>> t(n);
    rep(i,n-1){
        ll a,b;cin>>a>>b;a--;b--;
        t[a].push_back(b);
        t[b].push_back(a);
    }
    priority_queue<ll> que1;
    ll res=0;
    vector<ll> c(n);
    rep(i,n){
        cin>>c[i];
        que1.push(c[i]);
    }
    sort(c.begin(),c.end());
    rep(i,n-1)res+=c[i];
    cout<<res<<endl;
    queue<ll> que2;que2.push(0);
    vector<ll> d(n,-1);
    while(que2.size()){
        ll x=que2.front();que2.pop();
        ll y=que1.top();que1.pop();
        d[x]=y;
        rep(i,t[x].size()){
            ll z=t[x][i];
            if(d[z]!=-1)continue;
            que2.push(z);
        }
    }
    rep(i,n)cout<<d[i]<<" ";
    cout<<endl;
}

Measured memory_bytes: 4348
#include<bits/stdc++.h>
#include<string>
#define ll long long int
using namespace std;
int main(){
    string s1,s2;
    cin>>s1>>s2;
    s1="*"+s1;
    s2="*"+s2;
    ll sl1=s1.length();
    ll sl2=s2.length();
    ll dp[sl1][sl2];
    for(ll i=0;i<sl1;i++)
    {
        for(ll j=0;j<sl2;j++)
        {

            if((i==0) || (j==0))   dp[i][j]=0;
            else if( s1[i]==s2[j]) dp[i][j]=1+dp[i-1][j-1];
            else                   dp[i][j]=max(dp[i][j-1],dp[i-1][j]);
        }
    }
    /*
    for(ll i=0;i<sl1;i++)
    {
        for(ll j=0;j<sl2;j++)
        {
                cout<<dp[i][j]<<" ";
        }
        cout<<endl;
    }
    */

    string ans="";

    for(ll i=sl1-1,j=sl2-1 ;  ;)
	{
		if(s1[i]==s2[j])
		{
		    char y=s1[i];
			ans = y+ans;
			i--;j--;
		}
		else if(dp[i][j]==dp[i-1][j])  i--;

		else                           j--;


		if(i<=0 || j<=0)   break ;
	}
    cout<<ans<<endl;
}


Measured memory_bytes: 70656
N = int(input())
A = list(map(int, input().split()))

length = sum(A)
center = length / 2

now = 0
for i in range(N):
    now += A[i]
    if now == center:
        print(0)
        break
    if now > center:
        print(int(min(now-center, center-now+A[i]) * 2))
        break

Measured memory_bytes: 26056
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int ctoi(const char c) {
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
void output(vector<int> vec) {
    for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    return;
}
vector<vector<int>> input(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void output(vector<vector<int>> table) {
    for (int i = 0; i < table.size(); i++) {
        for (int j = 0; j < table.at(0).size(); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long homo(int n, int r) {
    return comb(n + r - 1, n - 1);
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b)
{
    if (a % b == 0)
    {
        return(b);
    }
    else
    {
        return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int main() {
  int n;
  cin >> n;
  vector<int> a=input(n);
  sort(a.begin(),a.end());
  cout << a[n-1]-a[0] << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <math.h>
#include <bitset>
#include <queue>

using namespace std;

void solve() {
    int64_t n, k;
    cin >> n >> k;
    vector<int64_t> enemy(n);
    for(int i = 0; i < n; i++) {
        cin >> enemy[i];
    }
    sort(enemy.begin(), enemy.end());
    int64_t num = 0;
    for(int64_t i = 0; i < n-k; i++){
        num += enemy[i];
    }
    cout << num;
}

int main() {
    solve();
    return 0;
}

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

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
const int N = 2e5+5;

ld pi = acos(-1);

int main()
{
    ld a,b,ang,tmp;
    ld n,m;
    cin >> a >> b >> n >> m;
    n *= 5;
    tmp = m/(ld)60;
    n += tmp*5;

    ang = abs(n-m)*6;


    ang *= (pi/(ld)180);

    ld ans = a*a + b*b - 2*a*b*cos(ang);
    ans = sqrt(ans);

    cout << fixed << setprecision(12) << ans << '\n';

    return 0;
}

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

int main(){
  int n;
  cin>>n;
  vector<int> a(n),b;
  rep(i,n) cin>>a[i];
  b=a;

  sort(a.begin(),a.end(),greater<int>());
  deque<int> d;
  d.push_back(a[a.size()-1]);
  a.pop_back();
  bool s=1;
  while(!a.empty()){
    if(s){
      d.push_back(a[0]); a.erase(a.begin());
      if(a.empty()) break;
      d.push_front(a[0]); a.erase(a.begin());
      s=0;
    }else{
      d.push_back(a[a.size()-1]); a.pop_back();
      if(a.empty()) break;
      d.push_front(a[a.size()-1]); a.pop_back();
      s=1;
    }
  }
  ll ans=0;
  for(int i=0; i<n-1; i++){
    ans+=abs(d[i+1]-d[i]);
  }

  sort(b.begin(),b.end());
  deque<int> p;
  p.push_back(b[b.size()-1]);
  b.pop_back();
  bool t=1;
  while(!b.empty()){
    if(t){
      p.push_back(b[0]); b.erase(b.begin());
      if(b.empty()) break;
      p.push_front(b[0]); b.erase(b.begin());
      t=0;
    }else{
      p.push_back(b[b.size()-1]); b.pop_back();
      if(b.empty()) break;
      p.push_front(b[b.size()-1]); b.pop_back();
      t=1;
    }
  }
  ll ans1=0;
  for(int i=0; i<n-1; i++){
    ans1+=abs(p[i+1]-p[i]);
  }
  cout<<max(ans,ans1)<<endl;
}



Measured memory_bytes: 4832
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC push_options
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
#include <xmmintrin.h>
#include <immintrin.h>
using namespace::std;
__attribute__((constructor))void init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// typedef mp::number<mp::cpp_dec_float<0>> cdouble;
// typedef mp::cpp_int cint;
template<typename T>using pbds=__gnu_pbds::tree<T,__gnu_pbds::null_type,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T>using pbds_map=__gnu_pbds::tree<T,T,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T,typename E>using hash_map=__gnu_pbds::gp_hash_table<T,E>;
template<typename T>using pqueue =__gnu_pbds::priority_queue<T, greater<T>,__gnu_pbds::rc_binomial_heap_tag>;
typedef long long lint;
#define INF (1LL<<60)
#define IINF (1<<30)
#define LINF (9223372036854775807LL)
#define EPS (1e-10)
#define endl ('\n')
#define MOD 1000000007LL
//#define MOD 998244353LL
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
template<typename T>inline void numout(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i<INF/2?i:"INF";f=1;}cout<<endl;}
template<typename T>inline void numout2(T t){for(auto i:t)numout(i);}
template<typename T>inline void output(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}
template<typename T>inline void output2(T t){for(auto i:t)output(i);}
template<typename T>inline void _output(T t){bool f=0;for(lint i=0;i<t.size();i++){cout<<f?"":" "<<t[i];f=1;}cout<<endl;}
template<typename T>inline void _output2(T t){for(lint i=0;i<t.size();i++)output(t[i]);}
#define rep(i,n) for(lint i=0;i<lint(n);++i)
#define repi(i,a,b) for(lint i=lint(a);i<(lint)(b);++i)
#define rrep(i,n) for(lint i=lint(n)-1;i>=0;--i)
#define rrepi(i,a,b) for(lint i=lint(b)-1;i>=lint(a);--i)
#define irep(i) for(lint i=0;;++i)
#define all(n) begin(n),end(n)
#define dist(a,b,c,d) sqrt(pow(a-c,2)+pow(b-d,2))
inline lint gcd(lint A,lint B){return B?gcd(B,A%B):A;}
inline lint lcm(lint A,lint B){return A/gcd(A,B)*B;}
// inline cint cgcd(cint A,cint B){return B?cgcd(B,A%B):A;}
// inline cint clcm(cint A,cint B){return A/cgcd(A,B)*B;}
bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
const vector<lint> dx={1,0,-1,0,1,1,-1,-1};
const vector<lint> dy={0,1,0,-1,1,-1,1,-1};
#define SUM(v) accumulate(all(v),0LL)
auto call=[](auto f,auto... args){return f(f,args...);};

int main(){
    string s;
    cin>>s;
    rep(i,s.size())if(s[i]=='?')s[i]='D';
    cout<<s<<endl;
}

Measured memory_bytes: 3788
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}


int lower_bound(int *a, int n, int key){
    int left, mid, right;
    left = 0, right = n;
    mid = (left + right)/2;
    while ((left+1 != mid || mid+1 != right) && mid != left){
        if (key > a[mid]){
            left = mid;
        }else{
            right = mid+1;
        }
        mid = (left + right)/2;
    }
    if (a[left] >= key)return left;
    if (a[mid] >= key)return mid;
    if (a[right] >= key)return right;
    return n;
}

//greatest common divisor
unsigned long  gcd(unsigned long x, unsigned long y){
    if (y == 0){ 
        return x;
    }else if (x > y){
        return gcd(y, x % y);
    }else{
        return gcd(x, y % x);
    }
}



long long factorial(int x){
    long long rtn = 1;
    int i;
    for (i = x; i > 1; i--){
        rtn = (rtn*i);
    }
    return rtn;
}
long long a[100005] = {0};

int main(void){
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    if (b-a == c-b){
        printf("YES\n");
    }else{
        printf("NO\n");
    }

    return 0;

}


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

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

using namespace std;
using lint=long long;

int main(){
	lint n,k; scanf("%lld%lld",&n,&k);
	vector<lint> a(n),b(n);
	rep(i,n) scanf("%lld",&a[i]);
	rep(i,n) scanf("%lld",&b[i]);

	sort(a.begin(),a.end());
	sort(b.rbegin(),b.rend());

	lint lo=-1,hi=1e14;
	while(hi-lo>1){
		lint mi=(lo+hi)/2;
		lint cost=0;
		rep(i,n){
			cost+=max(a[i]-mi/b[i],0LL);
		}
		if(cost<=k) hi=mi;
		else        lo=mi;
	}
	cout<<hi<<endl;

	return 0;
}


Measured memory_bytes: 3328
from sys import stdin 
from bisect import bisect_left
n = int(stdin.readline().rstrip())
l = [int(x) for x in stdin.readline().rstrip().split()]
l.sort()
answer = 0
for i in range(len(l)):
    for j in range(i):
        if i != j:
            k = bisect_left(l, l[i]+ l[j])
            answer += k - i - 1
print(answer)

Measured memory_bytes: 42460
#include <stdio.h>

int m[101][101];
int p[101];

#define INF 100000

void matrixChainOrder(int);
int min(int,int);
int main(){

  int n,i;

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

  matrixChainOrder(n);

  printf("%d\n",m[1][n]);

  return 0;
}

void matrixChainOrder(int n){

  int i,j,l,k,q;

  for(i=1;i<=n;i++){
    m[i][i]=0;
  }
  
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      m[i][j]=INF;
      for(k=i;k<j;k++){
	q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
	m[i][j]=min(m[i][j],q);
      }
    }
  }
}

int min(int x,int y){
  if(x>y) return y;
  else return x;
}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n){
        cin >> a[i];
    }
/*
    cout << n << endl;
    rep(i,n){
        cout << a[i] << " ";
    }
    cout << endl;
*/
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    int Alice = 0;
    int Bob = 0;
    for(int i=0; i<n; i++){
        if(i%2 == 0)  Alice += a[i];
        else  Bob += a[i];
    }
  cout<< Alice-Bob <<endl;
}

Measured memory_bytes: 256
using System;
class Program
{
    static void Main(string[] args)
    {
        // スペース区切りの整数の入力
        string[] input = Console.ReadLine().Split(' ');
        int a = int.Parse(input[0]);
        int b = int.Parse(input[1]);
        int c = int.Parse(input[2]);
        while (true)
        {
            if (a + b + c >= 22) { Console.WriteLine("bust"); break; }

            else { Console.WriteLine("win"); break; }


        }
    }
}

Measured memory_bytes: 11092
#include<stdio.h>
int main() {
  int t, h, m, s;
  scanf("%d", &t);
  h = t / 3600;
  m = (t - h * 3600) / 60;
  s = t - h * 3600 - m * 60;
  printf("%d:%d:%d\n", h, m, s);
  return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll MOD = 1e9+7;
ll LLINF = 1LL << 60;
int INF = INT_MAX;

int main(){
    int n; cin>>n;
    vector<ll> a(n);
    vector<ll> ref(n);
    rep(i,0,n){
        cin>>a[i];
        ref[i]=a[i]+i+1;
    }
    sort(all(ref));

    ll ans=0;
    rep(i,0,n){
        ll dist=distance(lower_bound(all(ref),i-a[i]+1),upper_bound(all(ref),i-a[i]+1));
        ans+=dist;
    }
    cout<<ans<<endl;

}

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  int n,m;
  cin >> n >> m;
  LL a,b,ta=0,tb=0;
  for(int i=0;i<n;i++){
    cin >> a;
    ta+=a;
  }
  for(int i=0;i<m;i++){
    cin >> b;
    tb+=b;
  }
  cout << ta*tb << endl;
  return 0;
}



Measured memory_bytes: 3104
n,k=map(int,input().split())
list=[0]*(10**5+1)
for i in range(n):
    a,b=map(int,input().split())
    list[a]+=b
sum=0
for l in range(1,len(list)):
    sum+=list[l]
    if sum>=k:
        print(l)
        exit()


Measured memory_bytes: 5748
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	unsigned long n, k;
	unsigned long henkan, seki;
	unsigned long tmp;
	int ans = 1;

	cin >> n >> k;

	henkan = 0;
	seki = 1;
	for (tmp = n; tmp >= k; tmp /= k) {
		henkan += (tmp%k)*seki;
		seki *= 10;
		ans++;
		//cout << henkan << endl;
	}
	henkan += (tmp%k)*seki;


	cout << ans << endl;
	/*
	if (henkan%k == 0) {
		cout << (long)(log10(henkan))+1 << endl;
	}
	else {
		cout << (long)(log10(henkan)) + 1 << endl;
	}
	return 0;
	*/
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int INF = 1000000009;
int main()
{
    int n,m;
    cin >> n >> m;
    double tmp = 1900*m;
    tmp += 100*(n-m);
    double k = 1;
    rep(i,m){
        k /= 2;
    }
    double ans=0, x=k,y=1;
    double cnt = 1;
    while (cnt <= 1000000)
    {
        ans += cnt * tmp * x;
        x = y - x;
        y = x;
        x *= k;
        cnt++;
    }
    cout << round(ans) << endl;
}

Measured memory_bytes: 512
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(N)]
AB.sort()
ans=0
for i in range(N):
    if M>AB[i][1]:
        M-=AB[i][1]
        ans+=AB[i][0]*AB[i][1]
    else:
        ans+=AB[i][0]*M
        M=0
print(ans)


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

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;
typedef pair<ld, ld> pdd;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

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

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

int n;
void solve(){
  int m, x, mod;
  cin >> m >> x >> mod;
  int ans = m - 1;
  int cnt;
  ll sum = (x%mod);
  ll cur;
  for(int i = 0 ; i < n; i ++ ){
    cnt = ((m-1)/n) + (((m-1)%n)>i);
    if(a[i] % mod == 0){
      ans -= ((m-1)/n) + (((m-1)%n)>i);
    }
    sum += cnt*1ll*(a[i]%mod);
  }
  ans -= sum/mod;
  cout << ans << "\n";
}

int main(){
  fastIO;
  int q;
  cin >> n >> q;
  for(int i = 0 ; i < n; i ++ ){
    cin >> a[i];
  }
  for(int t = 0 ;t < q; t ++ ) solve();
  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
ll Max(ll(a), ll(b), ll(c)) {
	return max(max(a, b), c);
}
ll Min(ll(a), ll(b), ll(c)) {
	return min(min(a, b), c);
}
vector<ll> fact, factinv, inv;
ll mod = 1e9 + 7;
void prenCkModp(ll n) {
	fact.resize(n + 5);
	factinv.resize(n + 5);
	inv.resize(n + 5);
	fact.at(0) = fact.at(1) = 1;
	factinv.at(0) = factinv.at(1) = 1;
	inv.at(1) = 1;
	for (ll i = 2; i < n + 5; i++) {
		fact.at(i) = (fact.at(i - 1) * i) % mod;
		inv.at(i) = mod - (inv.at(mod % i) * (mod / i)) % mod;
		factinv.at(i) = (factinv.at(i - 1) * inv.at(i)) % mod;
	}

}
ll nCk(ll n, ll k) {
	return fact.at(n) * (factinv.at(k) * factinv.at(n - k) % mod) % mod;
}

bool p[100003];
ll c[100003];

int main() {
	rep(i, 100003)p[i] = true;
	p[0] = false;
	p[1] = false;
	for (ll i = 2; i * i <= 100002; i++) {
		if (p[i]) {
			for (ll j = 2*i; j <= 100002; j += i) {
				p[j] = false;
			}
		}
	}
	c[0] = 0;
	c[1] = 0;
	c[2] = 0;
	for (ll i = 3; i < 100003; i++) {
		if (i % 2 == 0) {
			c[i] = c[i - 1];
			continue;
		}
		if (p[i] && p[(i + 1) / 2]) {
			c[i] = c[i - 1] + 1;
		}
		else {
			c[i] = c[i - 1];
		}
	}
	ll Q;
	cin >> Q;
	vector<ll> L(Q);
	vector<ll> R(Q);
	rep(i, Q) {
		cin >> L[i] >> R[i];
	}
	rep(i, Q) {
		cout << c[R[i]] - c[L[i] - 1] << endl;
	}

}


Measured memory_bytes: 5600
#include <bits/stdc++.h>
using namespace std;
int n,a[100005];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)	cin>>a[i];
	int sum=a[1];
	for(int i=2;i<=n;i++)	sum=sum^a[i];
	if(sum==0)		puts("Yes");
	else			puts("No");
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll long long
#define r(i,n) for(ll i=0;i<n;i++)
#define rp(i,a,b) for(ll i=a;i<b;i++)
#define rt return
#define db double
#define vd void
#define p(x) cout<<(x)<<endl;
#define ce continue;
#define bl bool
#define r0 rt 0;
#define r1 rt 1;
#define elif else if
#define bk break;
#define A p("A")
#define B p("B")
#define C p("C")
#define D p("D")
#define E p("E")
#define F p("F")
#define G p("G")
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define cl cout<<endl;
#define pb(x) push_back(x);
#define str string
using namespace std;
void Cond(int g){if(g)p("YES")else p("NO")rt;}
void cond(int g){if(g)p("Yes")else p("No")rt;}
ll power(ll k){ll t=1;r(i,k+1)t*=2;rt t;}
ll comb(ll i,ll j){ll up=1;for(ll n=i;n>i-j;n--){up*=n;}ll down=1;for(ll r=j;r>=1;r--)down*=r;rt up/(down);}//nCr.
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)rt b;gcd(b,a%b);}
ll Digits(ll k){ll t=0;while(k){t+=k%10;k/=10;}rt t;}
char m1[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char m2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char m3[10]={'0','1','2','3','4','5','6','7','8','9'};
str su="0123456789";
const ll INF=(ll)1e18;
const ll MAX=(ll)3e5;
const ll NIL=-1;
struct Node{ll p,l,r;};
typedef struct edge{ll to,cost;}EDGE;
typedef pair<ll,ll> P;
#define ldb long double
ll ans=0,ct=0,ct1=0,ct2=0,cnt=0,tmp=0,g=0,n=0,m=0;
ll tmp1=0,tmp2=0,tmp3=0,tmp4=0,sum=0,pos=0,k=0;
ll len=0,len1=0,len2=0,len3=0,len4=0,len5=0;
ll mx=-INF,mn=INF,mask=0,ans1=0,ans2=0;
map<ll,ll>mp,mp1,mp2,mp3;
set<ll>st,st1,st2;
const ll MOD=(ll)1e9+7;
const ll M=MOD;
vector<ll>fac(3e5+3),ifac(3e5+3);
vector<ll>v,v1,v2,v3;
ll powmod(ll a,ll b,ll x){
	if(!b)r1
	if(!(b%2)){//B
		ll t=powmod(a,b/2,x);
		rt t*t%x;
	}
	rt ((a)*powmod(a,b-1,x))%x;
}
ll cmb(ll a,ll b){
	if(a<b||a<0||b<0)r0
	if(!a&&!b)r1
	tmp=ifac[a-b]*ifac[b]%MOD;
	rt (tmp*fac[a])%MOD;
}
//vd ncr(){fac[0]=ifac[0]=1;
//r(i,MAX){fac[i+1]=fac[i]*(i+1)%M;
//ifac[i+1]=ifac[i]*(powmod(i+1,M-2,M))%M;}}
ll f(ll k){
	ll x=k;ll num=0;
	for(int i=2;(i*i)<=x;i++){
		while(!(k%i)){
		if(i==2){
			num++;k/=i;
		}else {rt num;}
		}
	}
	if(k!=1)num++;
	rt num;
}
ll f5(char k){
	r(i,26)if(k==m1[i]){rt i;};
}
int main(){//p(pow(2,(ldb)50))
str s,t;
cin>>s;
len=s.length();
r(i,len){
mp[f5(s[i])]++;
}
tmp=(len*(len-1))/2;
r(i,26){
	tmp-=(mp[i]*(mp[i]-1))/2;
}
p(tmp+1)

}//main


Measured memory_bytes: 5252