akhauriyash/Code-Regression huggingface dataset:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def MAP1()  : return map(lambda x:int(x)-1,input().split())
def LIST()  : return list(MAP())
def LIST1() : return list(MAP1())

def solve():
    n, x, t = MAP()
    print((n+x-1)//x*t)

if __name__ == '__main__':
    solve()

Measured memory_bytes: 10280
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define rep(i, a, b) for(int i=a; i<b; i++)
#define per(i, a, b) for(int i=b-1; i>=a; i--)
#define ifor(n) for(int i=0;i<n;i++) 
#define jfor(n) for(int j=0;j<n;j++)
#define Ifor(n) for(int i=1;i<n;i++) 
#define Jfor(n) for(int j=1;j<n;j++)
const int inf=0x3f3f3f3f;
int a[104];
int main(){
   int n;
   cin>>n;
   int x=0;
   ifor(n)cin>>a[i],x+=a[i];
   x=x/n;
   int ans=0,ans1=0;
   ifor(n)ans+=(a[i]-x)*(a[i]-x),ans1+=(a[i]-x-1)*(a[i]-x-1);
   cout<<min(ans,ans1)<<endl;
} 

Measured memory_bytes: 256
n = int(input())
a = input().split()
b = input().split()
c = input().split()
sum = 0
for i in range(n):
    sum += int(b[i])
for i in range(n-1):
    if(int(a[i+1]) == int(a[i]) + 1):
        sum += int(c[int(a[i]) -1])
print(sum)

Measured memory_bytes: 3064
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		BigDecimal N = new BigDecimal(sc.next());
		BigDecimal A = new BigDecimal(sc.next());
		BigDecimal B = new BigDecimal(sc.next());
		BigDecimal AB = A.add(B);

		BigDecimal remainder = N.remainder(AB);
		if(remainder.compareTo(A) == 1) {
			remainder = A;
		}
		System.out.println(N.divide(AB, RoundingMode.DOWN).multiply(A).add(remainder).toString());

	}
}

Measured memory_bytes: 22864
m,d=map(int,input().split())
c=0
for j in range(1,m+1):
    for i in range(10,d+1):
        if i//10>=2 and i%10>=2 and (i//10)*(i%10)==j:
#            print(i//10,i%10,j)
            c+=1
print(c)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
 
using lint=long long;
using pint=pair<int,int>;
template<class T> using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

const lint INF=1e18;
using ppint=pair<int,pint>;

int main()
{
   int x,y,z; cin>>x>>y>>z;
   const int N=x+y+z;
   vector<int> a(N),b(N),c(N);
   for(int i=0;i<N;i++) cin>>a[i]>>b[i]>>c[i];

   lint ans=accumulate(a.begin(),a.end(),0LL);
   for(int i=0;i<N;i++){
      b[i]-=a[i]; c[i]-=a[i];
   }
   vector<ppint> vec(N);
   for(int i=0;i<N;i++){ vec[i]={c[i]-b[i],{b[i],c[i]}}; }
   sort(vec.begin(),vec.end(),greater<ppint>());
   for(int i=0;i<N;i++){ tie(b[i],c[i])=vec[i].second; }

   vector<lint> sumC(N+1,-INF);
   multiset<int> S;
   lint sum=0LL;
   for(int i=0;i<N;i++){
      if(S.size()<z){
         sum+=c[i];
         S.insert(c[i]);
      }else if(c[i]>*S.begin()){
         sum-=*S.begin();
         S.erase(S.begin());
         sum+=c[i];
         S.insert(c[i]);
      }
      if(S.size()>=z) sumC[i+1]=sum;
   }
   vector<lint> sumB(N+1,-INF);
   S.clear();
   sum=0LL;
   for(int i=N-1;i>=0;i--){
      if(S.size()<y){
         sum+=b[i];
         S.insert(b[i]);
      }else if(b[i]>*S.begin()){
         sum-=*S.begin();
         S.erase(S.begin());
         sum+=b[i];
         S.insert(b[i]);
      }
      if(S.size()>=y) sumB[i]=sum;
   }

   lint max_diff=-INF;
   for(int i=1;i<N-1;i++){
      max_diff=max(max_diff,sumC[i]+sumB[i]);
   }
   ans+=max_diff;
   cout<<ans<<endl;
   return 0;
}


Measured memory_bytes: 8576
#include <bits/stdc++.h>
        using namespace std;
     
        int main()
        {
        int x1,x2,x3,x4,y1,y2,y3,y4;
        cin>>x1>>y1>>x2>>y2;
        int dx=x2-x1,dy=y2-y1;
        x3=x2-dy;y3=y2+dx;
        x4=x3-dx;y4=y3-dy;
    printf("%d %d %d %d",x3,y3,x4,y4);
        return 0;
        }

Measured memory_bytes: 256
function Main(input) {
    var firstLine = input[0].split(/\s/);
    var N = parseInt(firstLine[0], 10);
    var K = parseInt(firstLine[1], 10);
    var dA = input.slice(1);
    var split;

    var sunuke = new Array;
    sunuke.fill(false);

    for (var i = 0; i < 2 * K; i++) {
        if (i % 2 !== 0) {
            split = dA[i].split(/\s/);
            for (var j = 0; j < split.length; j++) {
                sunuke[split[j] - 1] = true;
            }
        }
    }

    var result = 0;
    for (var i = 0; i < N; i++) {
        if (!sunuke[i]) {
            result++;
        }
    }

    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n/));

Measured memory_bytes: 30420
#include <bits/stdc++.h>
#define    ll long long
using namespace std;
const int maxn  = 200005;
int a[maxn];
int b[maxn];
int cnt[maxn];
int main()
{
   int n,m;
   cin>>n>>m;
   int cnt1=0,cnt2 = 0;
   for(int i=0;i<m;i++){
        int x;
        string s;
        cin>>x>>s;
        if(s=="WA"){
            if(!b[x]) cnt[x]++;
        }
        else {
            b[x]++;
            if(b[x]==1){
                cnt1++;
                cnt2+=cnt[x];
            }
        }
   }
   cout<<cnt1<<" "<<cnt2<<endl;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<iostream>
#include<cmath>
#include<string>
#include<set>
#include<queue>
#include<cstdlib>
#include<algorithm>
#include<vector>
using namespace std;
#define rep2(x,from,to) for(int x=from;x<to;x++)
#define rep(x,to) rep2(x,0,to)
#define INF 10000000
#define N 100000 //max of the number of vertex
typedef long long ll;
typedef pair<int ,int> P;
typedef pair<int, P > PP;

int h,w;
string s[1000];
int dp[1000][1000];
int main()
{
    cin>>h>>w;
    rep(i,h)
    {
        cin>>s[i];
        rep(j,w)
        {
            if(s[i][j]=='#')dp[i+1][j+1]=1;            
        }
    }
    rep2(i,1,h+1)
    {
        rep2(j,1,w+1)
        {
            if(dp[i][j]==1)
            {
                if(dp[i+1][j]==0&&dp[i-1][j]==0&&dp[i][j+1]==0&&dp[i][j-1]==0)
                {
                    cout<<"No"<<endl;
                    return 0;
                }
            }
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 512
N = int(input())
A = list(map(int,input().split()))
AA = sorted([ a - i - 1 for i,a in enumerate(A) ])
C = []
for i,a in enumerate(AA):
    if i == 0:
        C.append(a)
    else:
        C.append(C[-1] + a)
ans = ""
#print(C)
for i,b in enumerate(AA):
    sample = 0
    num = i-1
    if num == -1:
        sample = C[-1]  - b * (N - 2 * (num + 1))
    else:
        sample = C[-1] - 2 * C[num] - b * (N - 2 * (num + 1))
    if ans == "":
        ans = sample
    if ans > sample:
        ans = sample
if ans == "":
    ans = 0
print(ans)

Measured memory_bytes: 29716
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  vector<int> v(n);
  rep(i, 0, n) cin >> v[i];
  sort(v.begin(), v.end());

  int ans = 0;
  rep(i, 0, n) {
    rep(j, 0, i) {
      int ng = lower_bound(v.begin(), v.end(), v[i] + v[j]) - v.begin();
      int ok = i + 1;
      ans += ng - ok;
    }
  }

  cout << ans << endl;
}


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

using namespace std;

typedef pair<int, int> ii;
typedef long long ll;
const int oo = 1e9 + 7;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, v[20], c[20], ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i)
    cin >> v[i];
  for (int i = 0; i < n; ++i)
    cin >> c[i];
  for (int state = 0; state < (1 << n); ++state) {
    int x = 0, y = 0;
    for (int j = 0; j < n; ++j)
      if (state & (1 << j)) {
        x += v[j];
        y += c[j];
      }
    ans = max(ans, x - y);
  }
  cout << ans;
  return 0;
}


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

int n, k;

bool check(int mid, vector<int> &a){
    vector<bool> dp(k, false);
    dp[0] = true;
    for (int i = 0; i < n; i++){
        if (a[i] > k) break;
        if (i == mid) continue;
        vector<bool> dp2 = dp;
        for (int j = 0; j < k; j++){
            if (dp[j] && j + a[i] < k) dp2[j + a[i]] = true;
        }
        dp = dp2;
    }
    bool flag = false;
    for (int i = k - a[mid]; i < k; i++) if (dp[i]) flag = true;
    return flag;
}

int main(){
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    int border = n;
    for (int i = 0; i < n; i++){
        if (a[i] >= k){
            border = i;
            break;
        }
    }
    int ok = border;
    int ng = - 1;
    while (abs(ok - ng) > 1){
        int mid = (ok + ng) / 2;
        if (check(mid, a)) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
}

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

using namespace std;

vector<string> split(const string &s, char delim) {
  vector<string> elems;
  string item;
  for (char ch: s) {
    if (ch == delim) {
      if (!item.empty()) {
        elems.push_back(item);
      }
      item.clear();
    }
    else {
      item += ch;
    }
  }
  if (!item.empty()) {
    elems.push_back(item);
  }
  return elems;
}

string to_str_with_zero(int i, int w) {
  ostringstream sout;
  sout << std::setfill('0') << std::setw(w) << i;
  string s = sout.str();
  return s;
}

int letter_to_int(char c) {
  return tolower(c) - 'a';
}

bool array_equal(vector<int> a1, vector<int>a2) {
  if (a1.size() != a2.size()) {
    return false;
  }
  for (int i=0; i<a1.size(); i++) {
    if (a1.at(i) != a2.at(i)) {
      return false;
    }
  }
  return true;
}

int gcd(int a, int b) {
  if (a == b) {
    return a;
  }
  else if (a > b) {
    return gcd(a - b, b);
  }
  else {
    return gcd(a, b - a);
  }
}

char int_to_char(int a) {
  if (a == -1) {
    return 'z';
  }
  else {
    return 'a' + a;
  }
}

long nCr(int n, int r) {
    long ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}

int divide_count(int a, int divider) {
  int r = 0;
  while(a % divider == 0) {
    a /= divider;
    r++;
  }
  return r;
}

bool is_prime(int a) {
  int i = 2;
  while(i * i <= a) {
    if(a % i == 0) {
      return false;
    }
    i++;
  }
  return true;
}

int main() {
  std::cout << std::setprecision(9);
  int x;
  cin >> x;

  while(true) {
    if(is_prime(x)) {
      cout << x << endl;
      break;
    }
    x++;
  }
}

Measured memory_bytes: 3640
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;

int i;
ll n,a,b,c,ans;
vector<ll> vec;

int check(ll t){
  vector<ll> v1 = vec;
  for(i = 0;i < n;i++)v1[i] -= b*t;
  for(i = 0;i < n;i++){
    if(v1[i] > 0){
      ans = v1[i]/(a-b);
      if(v1[i] % (a-b) != 0)ans++;
      t -= ans;
    }
  }
  if(t >= 0)return 1;
  return 0;
}

int main(){
  cin >> n;
	cin >> a >> b;
  for(i = 0;i < n;i++){
    cin >> c;
    vec.push_back(c);
  }
  sort(vec.begin(),vec.end());
  ll max = vec[n-1];
  ll min = 0;
  while(min < max){
    ll mid = (min + max) / 2;
		//cout << "mid : " << mid << ", max : " << max <<", min : " << min << endl;
    if(check(mid) == 1)max = mid;
    else min = mid + 1;
  }
  cout << min << endl;
  return 0;
}

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

const int Max = 1000007;
int pathParent[Max];
int railParent[Max];
int railSize[Max];
int pathSize[Max];

void init(int n) {
	for (int i = 0; i <= n; ++i) {
		railParent[i] = i;
		pathParent[i] = i;
		pathSize[i] = 1;
		railSize[i] = 1;
	}				
}
int findSetPath(int u) {
	if (pathParent[u] == u) {
		return u;
	}
	return pathParent[u] = findSetPath(pathParent[u]); 
}
int findSetRail(int u) {
	if (railParent[u] == u) {
		return u;
	}
	return railParent[u] = findSetRail(railParent[u]);
}
void path_unite(int u, int v) {
	int a = findSetPath(u);
	int b = findSetPath(v);
// cout << a << " " << b << endl;
	if (a != b) {
		 if (pathSize[a] < pathSize[b]) {
		 	swap(a, b);
		 }
		 pathParent[b] = a;
		 pathSize[a] += pathSize[b];
	}
// cout << pathParent[a] << " " << pathParent[b] << endl;
}
void rail_unite(int u, int v) {
	int a = findSetRail(u);
	int b = findSetRail(v);

	if (a != b) {
		 if (railSize[a] < railSize[b]) {
		 	swap(a, b);
		 }
		 railParent[b] = a;
		 railSize[a] += railSize[b];
	}
}
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n, m, k;
	int u, v;
	cin >> n >> m >> k;

	init(n);

	for (int i = 1; i <= m; ++i) {
		// cout << "Input 1\n";
		cin >> u >> v;
		// cout << "Input \n";
		path_unite(u, v);
		// cout << "Asche" << endl;
	}

	for (int i = 0; i < k; ++i) {
		cin >> u >> v;
		rail_unite(u, v);
	}
	for (int i = 1; i <= n; ++i) {
		// cout << min(pathSize[pathParent[i]], railSize[railParent[i]]) << " ";
		// mp[{railParent[i], pathParent[i]}]++;
		pathParent[i] = findSetPath(i);
		railParent[i] = findSetRail(i);
	}
    map<pair<int, int>, int>mp;
	for (int i = 1; i <= n; ++i) {
		// cout << min(pathSize[pathParent[i]], railSize[railParent[i]]) << " ";
		mp[{railParent[i], pathParent[i]}]++;
	}
	for (int i = 1; i < n; ++i) {
		// cout << min(pathSize[pathParent[i]], railSize[railParent[i]]) << " ";
		cout << mp[{railParent[i], pathParent[i]}] << " ";
	}
	cout << mp[{railParent[n], pathParent[n]}] << "\n";
	// cout << min(pathSize[pathParent[n]], railSize[railParent[n]]) << "\n";
	// cout << pathParent[2] << endl;
	return 0;
}

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

#define DEBUG(x) 			   cout << '>' << #x << ':' << x << endl;
#define D(x)        		   cerr << __LINE__ << ": " << #x << " = " << (x) << '\n'
#define DD(x,y)     		   cerr << __LINE__ << ": " << #x << " = " << x << "   " << #y << " = " << y << '\n'
#define DDD(x,y,z)  		   cerr << __LINE__ << ": " << #x << " = " << x << "   " << #y << " = " << y << "   " << #z << " = " << z << '\n'
#define DBG         		   cerr << __LINE__ << ": Hi" << '\n'
#define fresh                  {ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}
#define read                   freopen("in.txt","rt",stdin)
#define write                  freopen("out.txt","wt",stdout)
#define PI                     3.1415926535897932384626433832795
#define mems(ds_name,val)      memset(ds_name,val,sizeof(ds_name))
#define ll					   long long

int main()
{
    fresh;
//    read;
	//write;

    int N,T;
    cin>>N>>T;
    int minm=INT_MAX;
    for(int i=0;i<N;i++){
        int c,t;
        cin>>c>>t;
        if(t<=T){
            minm=min(c,minm);
        }
    }
    if(minm==INT_MAX)cout<<"TLE\n";
    else cout<<minm<<endl;


}






Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
#include <iomanip>

using namespace std;
using ll = long long;

int main() {
    string S,T;
    cin >> S >> T;
    
    int cnt = 0;
    for(int i=0;i<3;i++){
        if(S[i]==T[i]){
            cnt++;
        }
    }
    
    cout << cnt << endl;
    return 0;
}




Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
using namespace std;
#define rep(i,n) for (int i=1;i<=n;i++)
#define repn(i,n1,n2) for (int i=n1;i<=n2;i++)
#define pb push_back
typedef vector<int> vi;
typedef long long ll;
int x,ans=1000000;
ll t,a[100000];
int main()
{
	cin>>x;
	int lim; 
	for (lim=1;t<=x;lim++){
		t=lim*(lim+1)/2;
		a[lim]=t;
	}
	for (int i=1;i<=x;i++){
		if (a[i]>=x){
			cout<<i;
			return 0;
		}
	}
}

Measured memory_bytes: 640
import java.util.Scanner;


public class Main{
	private int[] a;
	
	public Main(){
		Scanner scanner = new Scanner(System.in);
		int n;
		
		while((n = scanner.nextInt()) > 0){
			a = new int[n + 1];
			
			hoge(n, n, 0);
		}
	}
	private void hoge(int n, int k, int i){
		if(n == 0){
			System.out.print(a[0]);
			
			for(int j = 1; a[j] > 0; j ++)
				System.out.print(" " + a[j]);
			System.out.println();
			
			return;
		}
		for(int j = Math.min(n, k); j > 0; j --){
			a[i] = j;
			
			hoge(n - j, j, i + 1);
			
			a[i] = 0;
		}
	}
	public static void main(String[] args){
		Main main = new Main();
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <stdio.h>

#define REP(i, n) for(int i = 0; i != n; ++i)
#define REPR(i, n) for(int i = n - 1; i != -1; --i)
#define FOR(i, a, b) for(int i = a; i != b; ++i)
#define RBF(i, n) for(auto &i : n)
#define ABS(n) (n < 0 ? -n : n)
#define MIN(a, b) (a < b ? a : b)
#define MAX(a, b) (a > b ? a : b)
#define IN(n) (cin >> n)
#define OUT(n) (cout << n << "\n")
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()

using namespace std;
using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false); //cinの高速化

  int N;
  IN(N);
  OUT(pow(N,3));
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
using namespace std;
int main()
{
	int d,n,ans;
	cin >> d >> n;
	
	if(n==100){
		n=101;
	}
	if(d==0){
		cout << n << endl;
	}
	else if(d==1){
		cout << 100*n << endl;
	}
	else{
		cout << 10000*n << endl;
	}

}

Measured memory_bytes: 256
#include <iostream>
#define ll long long int

using namespace std;

ll d,t,s;

int main()
{
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin>> d >> t >> s;
    if(t*s>=d){ cout<< "Yes" << endl; }
    else{ cout<< "No" << endl; }

    return 0;
}


Measured memory_bytes: 3596
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Convert;
using static System.Console;
using static System.Math;
class MainClass
{
	static void Main(string[] args)
	{
		Answer(new ConsoleInput(Console.In, ' '));
	}
	public static void Answer(ConsoleInput cin)
	{
      int ans = 1;
      int MaxCnt = 0;
      int N = cin.ReadInt;
      for(int i = 1; i <= N; i++)
      {
        int cnt = 0;
        int val = i;
        while (val % 2 == 0)
        {
          val /= 2;
          cnt++;
        }
        if (MaxCnt < cnt)
        {
          MaxCnt = cnt;
          ans = i;
        }
      }
      WriteLine(ans);
	}
    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return 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: 13268
#include<stdio.h>

int main(){

	int i,j,data[100]={0},n,max,ans[100]={0};

	while(scanf("%d",&n)!=EOF) data[n-1]++;

	max=0;
	for(i=0;i<100;i++){
		if(data[i]>max) max=data[i];
	}
	j=0;
	for(i=0;i<100;i++){
		if(data[i]==max) ans[j++]=i+1;
	}
	for(i=0;i<j;i++) printf("%d\n",ans[i]);

	return 0;

}

Measured memory_bytes: 596
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
	char buf1[101];
	char buf2[101];
	int len;
	char tmp;
	bool found = false;

	scanf("%s%s", buf1, buf2);
	len = strlen(buf1);

	for (int i = 0; i < len; i++) {
		tmp = buf1[len - 1];
		for (int j = len - 2; j >= 0; j--) {
			buf1[j + 1] = buf1[j];
		}
		buf1[0] = tmp;
		if (strcmp(buf1, buf2) == 0) {
			cout << "Yes" << endl;
			found = true;
			break;
		}
	}
	
	if (!found) {
		cout << "No" << endl;
	}

	return 0;
}


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

typedef long long ll;
using vi = vector<int>;
using vll = vector<ll>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main() {
    int k, x;
    cin >> k >> x;

    if(500 * k >= x) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,k;
	cin>>a>>b>>c;
	cin>>k;
	while(k&&a>=b){
		b=b*2;
		k--;
	}
	while(k&&b>=c){
		c=c*2;
		k--;
	}
	if(a<b&&b<c)
	cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

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

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define INF2 (1e18)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int k;
    cin >> k;
    string ans;
    rep(i, k) ans += "ACL";
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3608
import java.util.Scanner;
public class Main {
	static Scanner scan=new Scanner(System.in);
	static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
	static long lcm (int a, int b) {return a*b/gcd(a,b);}
	static int max(int a,int b) {return a>b?a:b;}
	static int min(int a,int b) {return a<b?a:b;}
	static long factorial(int i) {return i==1?1:i*factorial(i-1);}
	static int lower_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<=key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static int upper_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2)if(n%i==0){return false;}
		return true;
	}
	static int upper_division(int a,int b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lupper_division(long a,long b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lmax(long a,long b) {return Math.max(a, b);}
	static long lmin(long a,long b) {return Math.min(a, b);}
	static int[] setArray(int a) {
		int b[]=new int[a];
		for(int i=0;i<a;i++) {
			b[i]=scan.nextInt();
		}
		return b;
	}
	public static void main(String[] args) {
		int z=scan.nextInt();
		long m=0,a=0,r=0,c=0,h=0;
		for(int i=0;i<z;i++) {
			String str=scan.next();
			char ch=str.charAt(0);
			switch(ch) {
			case 'M':m++;break;
			case 'A':a++;break;
			case 'R':r++;break;
			case 'C':c++;break;
			case 'H':h++;break;
			}
		}
		long ans=0;//mar,mac,mah,mrc,mrh,mch,arc,arh,ach,rch
		ans+=m*a*r;
		ans+=m*a*c;
		ans+=m*a*h;
		ans+=m*r*c;
		ans+=m*r*h;
		ans+=m*c*h;
		ans+=a*r*c;
		ans+=a*r*h;
		ans+=a*c*h;
		ans+=r*c*h;
		System.out.println(ans);
	}
}

Measured memory_bytes: 46072
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<set>
#include<functional>
#include<queue>
#include<cmath>
#include<algorithm>
#include<complex>
#include<cstdlib>
#include<cctype>
 
#define DBG cout << '!' << endl;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cout << v[i] << ' ';cout << endl << endl;}
#define SHOW2d(v,i,j) {for(int a = 0;a < i;a++){for(int b = 0;b < j;b++)cout << v[a][b] << ' ';cout << endl;}cout << endl;}
#define ALL(v) v.begin(),v.end()
 
using namespace std;
 
typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;
 
int main()
{
	int n,ans = 0;
	
	cin >> n;
	
	iv v;	
	REP(i,n)
	{
		int tmp;
		cin >> tmp;
		v.PB(tmp);
	}
	
	sort(ALL(v));
	
	int ren = 0;
	for(int i = 0;i < v.size();i++)
	{
		if(v[i] == v[i+1])
		{
			ren++;
		}
		else
		{
			if(ren % 2 == 0)ans++;
			ren = 0;
		}
	}
 
	
	cout << ans << endl;
	
	
	return 0;
}

Measured memory_bytes: 892
#include <cstdio>
#include <algorithm>
using namespace std;
long long t1,t2;
long long a1,a2;
long long b1,b2;

int main(){
    scanf("%lld%lld%lld%lld%lld%lld",&t1,&t2,&a1,&a2,&b1,&b2);
    
    if (t1*a1+t2*a2==t1*b1+t2*b2){
        printf("infinity\n");
        return 0;
    }
    
    if (t1*a1+t2*a2<t1*b1+t2*b2){
        swap(a1,b1);
        swap(a2,b2);
    }
    
    if (a1>b1){
        printf("0\n");
        return 0;
    }
    
    long long q1=t1*(b1-a1),q2=(t1*a1+t2*a2)-(t1*b1+t2*b2);
    //printf("%lld %lld\n",q1,q2);
    long long ans=q1/q2;
    ans*=2;
    if (q1%q2!=0) ans++;
    printf("%lld\n",ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main() {
    string T;
    cin >> T;
    REP(i, T.size()) {
        if (T[i] == '?') {
            if (i == 0) {
                if (T[i+1] == 'P' || T.size() == 1) {
                    T[i] = 'D';
                } else {
                    T[i] = 'P';
                }
            } else if (i == T.size()-1) {
                T[i] = 'D';
            } else {
                if (T[i-1] == 'P') {
                    T[i] = 'D';
                } else if (T[i+1] == 'P') {
                    T[i] = 'D';
                } else {
                    T[i] = 'P';
                }
            }
        }
    }
    cout << T << endl;
    return 0;
}


Measured memory_bytes: 3756
/*
https://t.me/unstoppabIesoIvemachinechannel
*/
#pragma ARCENIY_KIRILLOV_POVELITEL_KROKODILOV
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC push_options
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC pop_options
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for (int i = 0; i < n; i++)
#define per(i, n) for (int i = n - 1; i > -1; i--)
#define rer(i, x, n) for (int i = x; i < n; i++)
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;















signed main(){
    string s;
    int k;
    cin >> s >> k;
    int f = s.size();
    bool flag = 1;
    char ce = s[0];
    for (int i = 1; i < f; i++){
        if (s[i] != ce){
            flag = 0;
            break;
        }
    }
    if(flag){
        cout << (k * f)/ 2;
        return 0;
    }
    if (k == 1){
            int ans = 0;
            for (int j = 0; j < s.size() - 1; j++){
                if (s[j] == s[j + 1]){
                    ans++;
                    s[j + 1] = '0';
                }
            }
        cout << ans;
        return 0;
    }
    string t = s + s;
    int n = t.size();
    int ans = 0;
    for (int i = 0; i < n - 1; i++){
        if (t[i] == t[i + 1]){
            ans++;
            t[i + 1] = '0';
        }
    }
    int ansek = 0;
    for (int j = 0; j < s.size() - 1; j++){
        if (s[j] == s[j + 1]){
            ansek++;
            s[j + 1] = '0';
        }
    }
    bool fl = 1;
    int c = 0;
    for (int i = 0; i < f; i++){
            if( t[i + f] == '0') c++;
        if (s[i] != t[i + f]){
            fl = 0;
        }
    }
    if (fl){
        cout << ansek * k;
    }else{
        cout << ansek + c * (k - 1);
    }


}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(int i=0;i<n;++i)
#define REPR(i,n) for(int i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define MP make_pair

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  llong x, y;
  scanf("%lld %lld", &x, &y);

  llong ans = 1;
  while(x * 2 <= y){
    ans++;
    x = x * 2;
  }


  printf("%lld\n", ans);
  return 0;
}



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

using namespace std;

int main(){
    long long int a,b,c;
    cin>>a>>b>>c;
    if( c*c + b*b + a*a > 2*(a*b + b*c + c* a)){
        if( c > a && c > b){
            printf("Yes");
        }
        else{
            printf("No");
        }
    } 
    else{
        printf("No");
    }
    return 0;
}

Measured memory_bytes: 256
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
n,d=NM()
ans=0
for i in range(n):
    x,y=NM()
    if x*x+y*y<=d*d:
        ans+=1
print(ans)

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

using namespace std;

main(){
    long long n , k , x , y;

    scanf("%lld %lld %lld %lld" , &n , &k , &x , &y);

    printf("%lld\n" , min(n , k)*x + max(n-k , 0ll)*y);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)

using namespace std;

int i,j,k;

int main(){
    string s,ans;
    cin>>s;
    if(s=="AAA"||s=="BBB"){
        ans="No";
    }
    else{
        ans="Yes";
    }
    cout<<ans<<endl;
    return 0;
}


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

using namespace std;

int main(){
    string s,t;
    cin>>s>>t;
    size_t size=s.length();
    
    for(int i=0 ; i<size; i++){
        if(s[i] != t[i]){
            cout<<"No"<<endl;
            goto Exit;
        }
    }
    
    cout<<"Yes"<<endl;
    
    Exit:
        ;
}

Measured memory_bytes: 3604
#include <iostream>
using namespace std;
#define INF 1<<21
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define MAX 100

int v_num;
int adjM[MAX+1][MAX+1];

int PrimsAlgorithm() 
{
    int current_vertex;
    int color[v_num+1], min_edge[v_num+1], parent[v_num+1];

    // set init state
    for (int i = 0; i < v_num; ++i)
    {
        color[i] = WHITE;
        min_edge[i] = INF;
        parent[i] = -1;
    }

    min_edge[0] = 0;

    while (true) 
    {
        int min_cost = INF;
        // move to the minimum vertex which can be accessed 
        for (int i = 0; i < v_num; ++i) 
        {
            if (color[i] != BLACK && min_edge[i] < min_cost)
            {
                min_cost = min_edge[i];
                current_vertex = i;
            }
        }

        if (min_cost == INF) break;

        color[current_vertex] = BLACK;

        for (int i = 0; i < v_num; ++i) 
        {
            if (color[i] != BLACK && adjM[current_vertex][i] != -1)
            {
                if (adjM[current_vertex][i] < min_edge[i])
                {
                    min_edge[i] = adjM[current_vertex][i];
                    parent[i] = current_vertex;
                    color[i] = GRAY;
                }
            } 
        }
    }

    int sum = 0;
    for (int i = 0; i < v_num; ++i) 
    {
        if (parent[i] != -1) sum += adjM[i][parent[i]];
    }
    return sum;
}

int main() 
{
    int v;
    cin >> v_num;
    for (int i = 0; i < v_num; ++i) 
    {
        for (int j = 0; j < v_num; ++j)
        {
            cin >> v;
            adjM[i][j] = v != -1 ? v : INF;
        }
    }
    
    cout << PrimsAlgorithm() << endl;
}


Measured memory_bytes: 3132
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };


int main() {
	int N;
	int P[100];
	scanf("%d", &N);
	for (int i = 0; i < N; i++)scanf("%d", &P[i]);

	int count = 0;

	for (int i = 0; i < N ; i++) {
		if (P[i] != i+1)count++;
	}
	if (count == 2 || count == 0)printf("YES");
	else printf("NO");

}

/*         提出前の確認事項

・デバッグ用の関数は＜＜コメント化＞＞しているか？
・すべての＜＜入力例＞＞は試したか？
・＜＜限界値分析＞＞はしたか？
・＜＜出力の改行＞＞の有無は確認したか？
　　　　　　　　↓
	 ＜＜提出先＞＞に注意して提出！！
*/

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

using namespace std;

int main()
{
    int n, m;
    cin>>n>>m;
    vector<int> data(n, 0);
    int total =0;
    for(int i=0;i<n;i++)
    {
        cin>>data[i];
        total+=data[i];
    }
    sort(data.begin(), data.end());

    int jumlah = 0;
    float test = 1.0/(4.0*m)*total;
    for(int i=0;i<n;i++)
    {
        if(float(data[i])>=test)jumlah+=1;
        if(jumlah>=m)break;
    }
    if(jumlah>=m)cout<<"Yes";
    else cout<<"No";


    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>

using namespace std;

typedef long long ll;

int main() {
    //ループ内にあるのはx以上y以下
    ll n, x, y; cin >> n >> x >> y;

    vector<vector<ll> > G(n+1);
    for (int i = 1; i < n; i++) {
        if (i <= x) {
            for (ll j = i+1; j <= n; j++) {
                ll d1 = j-i, d2 = x-i+1+abs(y-j);
                G[i].push_back(min(d1, d2));
            }
            sort(G[i].begin(), G[i].end());
        }

        else if (x < i) {
            for (ll j = i+1; j <= n; j++) {
                ll d1 = j-i, d2 = i-x+1+abs(y-j);
                G[i].push_back(min(d1, d2));
            }
            sort(G[i].begin(), G[i].end());
        }
    }

    
    for (ll k = 1; k < n; k++) {
        ll ans  = 0;
        for (ll i = 1; i < n; i++) {
            ans += upper_bound(G[i].begin(), G[i].end(), k) -lower_bound(G[i].begin(), G[i].end(), k);
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 23428
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
cnt = 0
for _ in range(n):
    a = list(map(int, input().split()))
    sum = c
    for i, j in zip(b, a):
        sum += i * j
    if sum > 0:
        cnt += 1
print(cnt)

Measured memory_bytes: 3060
#include <stdio.h>

int main()
{
    int N;
    scanf("%d",&N);
    if(N<=1000)
        N=1000-N;
    else if(N<=2000)
        N=2000-N;
    else if(N<=3000)
        N=3000-N;
    else if(N<=4000)
        N=4000-N;
    else if(N<=5000)
        N=5000-N;
    else if(N<=6000)
        N=6000-N;
    else if(N<=7000)
        N=7000-N;
    else if(N<=8000)
        N=8000-N;
    else if(N<=9000)
        N=9000-N;
    else if(N<=10000)
        N=10000-N;
    printf("%d",N);
    return 0;
}


Measured memory_bytes: 1736
attrs = Array.new
while line = $stdin.gets
  attrs << line.chomp.split
end

N = attrs[0][0].to_i
K = attrs[0][1].to_i
row = 2
n = Array.new(N, 0)
K.times do |k|
  d = attrs[row * k + 1][0].to_i
  a = attrs[row * k + 2].map &:to_i
  a.each do |q|
    n[q-1] = 1
  end
end
puts (n.select {|q| q==0}).count

Measured memory_bytes: 14624
import sys
N, = map(int, input().split())
X = list(map(int, input().split()))
S = X[0]+X[1]
T = 0
for i in range(2, N):
    T ^= X[i]
if S<T or (S-T)%2:
    print(-1)
    sys.exit()

D = (S-T)//2
if D&T:
    print(-1)
    sys.exit()

Y = D
for i in range(T.bit_length()+1, -1, -1):
    if T&(1<<i)|Y <= X[0]:
        Y |= T&(1<<i)
if 0<Y<=X[0]:
    print(X[0]-Y)
else:
    print(-1)


Measured memory_bytes: 62140
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
  string s;
  cin >> s;
  int x=0,b=0,c=0,d=0,e=0;
  int n=s.length();
  for (int i=0; i<n; i++) {
    char a=s.at(i);
    if (a=='A' || a=='T'|| a=='C' || a=='G') {
      x++;
    } else {
      b=max(b,x);
      x=0;
    }
  }
  b=max(b,x);
  cout << b <<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f first
#define s second
#define mk make_pair

using namespace std;

const int N = 1e5 + 5;

int a[N], b[N], c[N], dp[N][4];

int32_t main()
{
    ios::sync_with_stdio(false);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for(int i = 0;i < n; ++i)
    {
        cin >> a[i] >> b[i] >> c[i];
    }
    dp[0][0] = a[0]; dp[0][1] = b[0]; dp[0][2] = c[0];
    for(int i = 1;i < n; ++i)
    {
        for(int j = 0;j < 3; ++j)
        {
            if(j == 0)
                dp[i][j] = max(dp[i-1][j+1], dp[i-1][j+2]) + a[i];

            else if(j == 1)
                dp[i][j] = max(dp[i-1][j-1], dp[i-1][j+1]) + b[i];

            else
                dp[i][j] = max(dp[i-1][j-1], dp[i-1][j-2]) + c[i];
        }
    }
    int ans = 0;
    for(int j = 0;j < 3; ++j)
        ans = max(ans, dp[n-1][j]);
    cout << ans;
}

Measured memory_bytes: 2944
# //a(n) = Sum_{k=1..n} k/2 * floor(n/k) * floor(1 + n/k).
n = int(input())
sum=0
for i in range(1, n+1):
	k = i/2
	k=k*(n//i)
	k = k*(1+ (n//i))
	sum+=k
print(int(sum))

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  ll A, B, K; cin >> A >> B >> K;
  
  if (A >= K){
    cout << A - K << " " << B << endl;
  }else if (A + B >= K){
    cout << 0 << " " << A + B - K << endl;
  }else{
    cout << 0 << " " << 0 << endl;
  }

  return 0;
}



Measured memory_bytes: 3596
#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>  
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 1e18
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
 
ll mpow(ll a, ll b){
	if(b >= (MOD-1)) b %= (MOD-1);
	if(b==0) return 1;
	ll t1 = mpow(a,b/2);
	t1 *= t1;
	t1 %= MOD;
	if(b%2) t1 *= a;
	t1 %= MOD;
	return t1;
}
 
ll mpow(ll a, ll b, ll p){
	if(b==0) return 1;
	ll t1 = mpow(a,b/2,p);
	t1 *= t1;
	t1 %= p;
	if(b%2) t1 *= a;
	t1 %= p;
	return t1;
}
 
ll modinverse(ll a, ll m){
	ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) return 0; 
    while (a > 1){
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    }
    if (x < 0) x += m0; 
    return x; 
}
 
ll range(ll l, ll r){
	return l + rand()%(r-l+1);
}

ll n;
string s;

bool check(ll val){
	forsn(i,val,n){
		ll val1 = s[i]-'0';
		ll val2 = '1'-s[i-val];
		if(val1 < val2) return false;
		else if(val1 > val2) return true;
	}
	return true;
}

void solve(){
	cin >> n >> s;
	ll a[n+1];
	forn(i,n+1) a[i]=0;
	forsn(i,1,n+1){
		if(n%i==0 && (n/i)%2){
			forn(j,i){
				a[i] = (a[i] << 1);
				if(s[j]=='1') a[i]++;
				if(a[i] >= MOD) a[i] %= MOD;
			}
			if(check(i)){
				a[i]++;
				if(a[i] == MOD) a[i] = 0;
			}
		}
	}
	// forn(i,n+1) cout << a[i] << " ";
	// cout << ln;
	ll ans = 0;
	forsn(i,1,n+1){
		if(a[i]==0) continue;
		for(ll j = 2*i;j<=n;j+=i){
			if(n%j==0 && (n/j)%2){
				a[j] += (MOD - a[i]); 
				a[j] %= MOD;
			}
		}
		ans += 2*a[i]*i;
		ans %= MOD;
	}
	// forn(i,n+1) cout << a[i] << " ";
	// cout << ln;
	cout << ans << ln;
}
 
int main()
{
	fast_cin();
    ll t=1;
    // cin>>t;
    forn(i,t) {
    	// cout << "Case #" << i+1 << ": ";
    	solve();
    }
    return 0;
}

Measured memory_bytes: 2196
#include <stdio.h>
#include <math.h>
int main()
{
    int a, b, c, t;
    scanf("%d %d %d", &a, &b, &c);
    if(a<b)
    {
        t=a;
        a=b;
        b=t;
    }
    if(a<c)
    {
        t=a;
        a=c;
        c=t;
    }
    if(c>b)
    {
        t=c;
        c=b;
        b=t;
    }
    printf("%d\n", a-c);

    return 0;

}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define F first
#define S second
#define OUT(x) cout << (x) << "\n"
using namespace std;
using point = pair< int,int >;
using ll = long long;

int main() {
    int d, l;
    cin >> d >> l;

    OUT(d / l + d % l);

    return 0;
}




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

#define f first 
#define s second 
#define pb push_back               
#define mp make_pair 

using namespace std;                    

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

const int M = (int)4e3, N = (int)1e5 + 123, mod = (int)1e9 + 7;
bool was[M];
vector< ll > p;
map< ll, ll> sr, sq, cnt, anti;
ll n, a[N], ans;
bool ok;
          
void add1(ll x){
	for(auto j : p){
		int cnt= 0;
		while(x % j == 0)
			x /= j, cnt++;
    }

    if(x != 1){
    	ll sx = sqrt(x);
    	while(sx * sx < x)
    		sx++;
    	while(sx * sx > x)
    		sx--;
    	if(sx * sx == x){
    		sr[x] = sx;
    		sq[sx] = x;
    	}
    } 
}

void add(ll x){
	ll y = 1, z = 1;
	for(auto j : p){
		int cnt= 0;
		while(x % j == 0)
			x /= j, cnt++;
 		
 		if(cnt % 3 == 2)
   			y *= j * j, z *= j;
	   	
	   	if(cnt % 3 == 1)
   			y *= j, z *= j * j;
    }

    if(x != 1){
    	if(sr.count(x) || sq.count(x)){
    		if(sr.count(x)){
    			y *= x;
    			z *= sr[x];
    		}else{
    			y *= x;
    			z *= sq[x];
    		}
    	}else{
    		ans++;
    		return;
    	}
    } 
    if(y == 1){
    	if(ok)
    		return;
    	ok = 1;
    	ans++;
    	return;
    }
    cnt[y]+=1;
    cnt[z]+=0;
    anti[y] = z;
    anti[z] = y;
}

int main(){    
	for(int i = 2; i < M; i++){
		if(!was[i]){
			p.pb(i);
			for(int j = i; j < M; j += i)
				was[j] = 1;
		}
	}
	/*
	ll x = p.back();
	cout << p.size() << endl;
	cout << x << endl;
	cout << x * x * x / 1e10 << endl;
	*/
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		add1(a[i]);
	}

	for(int i = 0; i < n; i++)
		add(a[i]);

	for(auto it : cnt){
		//cerr << it.f << " " << it.s << endl;
		ll x = it.f;
		ll y = anti[x];
		if(x < y)
			ans += max(cnt[x], cnt[y]);
	} 
	cout << ans;
	return 0;
}


Measured memory_bytes: 14720
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
#include<stack>
#include<list>
#include<unordered_map>
#include<unordered_set>
#include<cctype>
#include<iomanip>
#include<limits>

using namespace std;
typedef long long int ll; typedef pair<int, int> P;
const ll mod = 1000000007;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(a) (a).begin(),(a).end()
#define allg(a) (a).begin(),(a).end(),greater<>()
#define SUM(a) accumulate((a).begin(),(a).end(),0)
#define d10 std::setprecision(10)
#define d20 std::setprecision(20)
const double PI = 3.14159265359;
ll gcd(ll a, ll b) { ll t; while (b != 0) { t = a % b; a = b; b = t; }return a; }
int gcd(int a, int b) { int t; while (b != 0) { t = a % b; a = b; b = t; }return a; }
ll recfact(ll start, ll n) {
	ll i;
	if (n <= 16) {
		ll r = start;
		for (i = start + 1; i < start + n; i++) r = r * i % mod;
		return r % mod;
	}
	i = n / 2;
	return recfact(start, i) % mod * recfact(start + i, n - i) % mod;
}
ll fct(ll n) { return recfact(1, n); }
ll ncm(ll n, ll m) {
	if (n < m)return 0;
	ll x = (fct(n) % mod / (fct(m) * fct(n - m)) % mod) % mod;
	return x;
}
bool isincluded(char x, string str) {
	bool f = 0;
	for (size_t i = 0; i < str.size(); i++) {
		if (str.at(i) == x)f = 1;
	}
	return f;
}




int main(void){
	int a, b, c; cin >> a >> b >> c;
	if (a + b + c > 21)cout << "bust" << endl;
	else cout << "win" << endl;


	return 0;
}

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

int main()
{
	int req, disnum, result;
	cin >> req >> disnum;

	//insert all dislike num to a vector
	vector<int> dis = {};
	for (int i = 0; i < disnum; i++)
	{
		int a;
		cin >> a;
		dis.push_back(a);
	}
	
	for (int i = req; i < 1000000; i++)
	{
		bool check = true;
		int fake = i;
		while (fake > 0)
		{
			int a = fake % 10;
			for (int j = 0; j < dis.size(); j++)
				if (a == dis.at(j)) {check = false; break;}
			fake = fake / 10;
		}
		if (check) { result = i; break; }
	}
	
	cout << result << endl;
	return 0;
}

Measured memory_bytes: 256