akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
	long long n, e = 0;
	cin >> n;
	e += n / 11 * 2;
	if (n % 11 >= 1 && n % 11 <= 6) {
		e++;
	}
	else if (n % 11 >= 7) {
		e++; e++;
	}
	cout << e << endl;
	cin >> e;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n = int(input())
t,a = map(int,input().split())
h = list(map(int, input().split()))

ans = 0
tmp = 10 ** 10
for i in range(n):
    if abs(t - h[i] * 0.006 - a) < abs(tmp - a):
        tmp = t - h[i] * 0.006
        ans = i + 1

print(ans)


Measured memory_bytes: 3060
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi

MOD = 10 ** 9 + 7
INF = 10 ** 18

N, K = map(int, input().split())
A = list(map(int, input().split()))

if K <= 2 * 10 ** 5 + 2:
    ans = 1
    for i in range(K):
        ans = A[ans - 1]
    print(ans)
    exit()


cnt = [0] * (N + 1)
p = A[0]
c = 1

while 1:
    if cnt[p] == 0:
        cnt[p] = c
    else:
        c1 = cnt[p]
        c2 = c
        break
    p = A[p - 1]
    c += 1

#print(c2- c1)

B = [0, A[0]]
for _ in range(3 * 10 ** 5):
    B.append(A[B[-1] - 1])

BN = len(B)

for i in range(BN - 1, -1, -1):
    if i % (c2 - c1) == K % (c2 - c1):
        print(B[i])
        exit()


Measured memory_bytes: 105676
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) (r).begin(),(r).end()
#define rall(r) (r).rbegin(),(r).rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

vector<ll> dp(110, -1);

ll calc(int n) {
    if(dp[n] != -1) return dp[n];
    if(n == 0) return 2;
    if(n == 1) return 1;
    return dp[n] = calc(n-1)+calc(n-2);
}

int main(){
#ifdef LOCAL_TEST
    freopen("in", "r", stdin);
    freopen("out", "w", stdout);
#endif
    int n;
    cin >> n;
    cout << calc(n) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i) 
typedef long long ll;
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	/*
	/
	/
	/
	*/
	string s;
	cin >> s;
	bool anser = false;
	if (s[0] == '9')anser = true;
	if (s[1] == '9')anser = true;
	if (anser) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

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

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

    vector<uint64_t> A(N);
    for (uint64_t i = 0; i < N; i++)
    {
        cin >> A[i];
    }

    sort(A.rbegin(), A.rend());
    
    uint64_t ans;
    ans = 0;
    for (uint64_t i = 1; i <= N - 1; i++)
    {
        ans = ans + A[i / 2];
    }

    cout << ans << endl;
}

Measured memory_bytes: 4796
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;
using llng = long long;
template<typename T> using v = vector<T>;
template<typename T> using vv = v<v<T> >;

int main() {
    int N; cin >> N;
    v<int> c(3);
    for (int i=0; i<N; i++) {
        int a; cin >> a;
        if (a % 4 == 0) c[2]++;
        else if (a % 2 == 0) c[1]++;
        else c[0]++;
    }
    if (c[1] > 0 && c[2] >= c[0]) cout << "Yes" << endl;
    else if (c[1] == 0 && c[2] >= c[0]-1) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#define DINGER_GISBAR
#include <bits/stdc++.h>
using namespace std;
const long long MOD = static_cast<int>(1e9) + 7;
//{{{TEMPLATE_BEGIN
#include <unistd.h>
using namespace std::rel_ops;
#ifdef ZEROKUGI
#include <dumper.hpp>
#define dump(x) dumper::dumper(cerr, __LINE__, (#x), (x), 50, 1, 1)
#define tick(...) dumper::tick(__VA_ARGS__)
#pragma message "Compiling " __FILE__
#else
#define dump(x)
#define tick(...)
#endif
typedef long long lint;
typedef unsigned long long ulint;
typedef long double ldouble;
typedef vector<int> vint;
#define rep(i, n) \
    for (int i = 0, i##_len = static_cast<int>(n); i < i##_len; i++)
#define all(c) begin(c), end(c)
#define perm(c)   \
    sort(all(c)); \
    for (bool c##p = 1; c##p; c##p = next_permutation(all(c)))
#define uniquenize(v) (v).erase(unique(all(v)), end(v))
#define cauto const auto &
#define memset(x, y) memset(x, y, sizeof(x))
#define popcount __builtin_popcount
#define gcd __gcd
inline lint bit(int x) { return 1LL << x; }
template <class T>
inline int size(const T& a) {
    return (int)a.size();
}
template <class T>
inline bool chmin(T& a, const T& b) {
    return a > b ? a = b, 1 : 0;
}
template <class T>
inline int clamp(T v, T lo, T hi) {
    return (v > hi) - (v < lo);
}
template <class T>
inline bool chmax(T& a, const T& b) {
    return a < b ? a = b, 1 : 0;
}
template <class T>
inline pair<vector<T>, char> operator*(const vector<T>& v, const char& c) {
    return make_pair(v, c);
}
template <class T>
inline istream& operator>>(istream& is, vector<T>& v) {
#ifdef ZEROKUGI
    if (v.empty()) {
        cerr << "Error L" << __LINE__ << ": vector size is zero." << endl;
        exit(EXIT_FAILURE);
    }
#endif
    for (auto& x : v) is >> x;
    return is;
}
template <class T>
inline ostream& operator<<(ostream& os, const pair<vector<T>, char>& v) {
    bool t = 0;
    for (const T& x : v.first) {
        if (t) os << v.second;
        os << x;
        t = 1;
    }
    return os;
}
template <class T>
inline ostream& operator<<(ostream& os, vector<T>& v) {
    return os << v * ' ';
}
struct before_main {
    before_main() {
        cin.tie(0);
        ios::sync_with_stdio(0);
        cout << fixed << setprecision(20);
        tick(0, 0);
    };
} __before_main;
//}}}TEMPLATE_END

int main() {
    int n;
    cin >> n;
    vector<pair<int, int>> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i].first;
        a[i].second = i;
    }
    sort(all(a));

    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans += (a[i].second ^ i) % 2 != 0;
    }
    cout << ans/2 << endl;
}


Measured memory_bytes: 1024
import java.awt.Point;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());
        Comparator<Point> comp = (p1, p2) -> p1.x - p2.x;
        List<Point> red = new LinkedList<>();
        for(int i = 0; i < n; i++) {
            String[] in = br.readLine().split(" ");
            red.add(new Point(Integer.parseInt(in[0]), Integer.parseInt(in[1])));
        }
        Collections.sort(red, comp);
        PriorityQueue<Point> blue = new PriorityQueue<>(comp);
        for(int i = 0; i < n; i++) {
            String[] in = br.readLine().split(" ");
            blue.add(new Point(Integer.parseInt(in[0]), Integer.parseInt(in[1])));
        }

        int ans = 0;
        while(!blue.isEmpty()) {
            Point b = blue.poll();
            
            int index = -1;
            int maxy = -1;
            int i = 0;
            Point tmp;
            while(i < red.size() && (tmp = red.get(i)).x < b.x) {
                if(tmp.y < b.y && maxy < tmp.y) {
                    index = i;
                    maxy = tmp.y;
                }
                i++;
            }

            if(index != -1) {
                red.remove(index);
                ans++;
            }
        }

        System.out.println(ans);

        br.close();
    }
}

Measured memory_bytes: 29012
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <tuple>

using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX (1LL<<60);
const ll MOD (1000000007);

#define rep(i,s,e) for(ll i=(s); i<(e); i++) 

using namespace std;

using T = tuple<ll,ll>;
using Graph = vector<vector<T>>;

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

    ll w, s;
    cin >> s >> w;
    if (s <= w)
        cout << "unsafe" << endl;
    else
        cout << "safe" << endl;
    return 0;
}


Measured memory_bytes: 3652
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n, k = MAP()
l = LIST()
l.sort(reverse=True)
print(sum(l[:k]))

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

int main() {
  char b;
  cin >> b;
  
  char result;
  if (b == 'A') result = 'T';
  if (b == 'T') result = 'A';
  if (b == 'C') result = 'G';
  if (b == 'G') result = 'C';
  
  cout << result << endl;
  
  return 0;
}

Measured memory_bytes: 256
import sys
input=sys.stdin.readline
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

t=ii()
lol=[]
for i in range(t):
    a,b=ml()
    lol.append([a,b])
yo=0    
cnt=0
for i in list(permutations(lol)):
    for j in range(1,len(i)):
        x=i[j][0]-i[j-1][0]
        y=i[j][1]-i[j-1][1]
        yo+=math.sqrt(x*x+y*y)
    cnt+=1
print(yo/cnt)    

Measured memory_bytes: 80756
import java.util.Scanner;
class Main{
	Scanner sc=new Scanner(System.in);
	int w;
	int t;
	int a=4280;
	void a(){
		while(true){
		w=sc.nextInt();
		if(w==-1){
			break;
		}
		 if(w<=10){
		 	t=1150;
		 }else if(w<=20){
		 	t=1150+(w-10)*125;
		 }else if(w<=30){
		 	t=1150+10*125+(w-20)*140;
		 }else{
		 	t=1150+10*125+10*140+(w-30)*160; 
		 }
		 
		 t=4280-t;
		 System.out.println(t);
		}
	}
	public static void main(String[]agrs){
		new Main().a();
	}
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // std::ifstream in("input.txt");
    // std::cin.rdbuf(in.rdbuf());
    const ll mod = 1e9 + 7;
    ll n;
    cin >> n;
    vector<ll> t(n), a(n);
    rep(i, n) cin >> t[i];
    rep(i, n) cin >> a[i];
    vector<pair<ll, ll>> h(n, make_pair(-1, -1));
    rep(i, n) {
        if ((i == 0) || (t[i] != t[i - 1])) {
            h[i].first = t[i];
            h[i].second = t[i];
            continue;
        }
        h[i].first = 1;
        h[i].second = t[i];
    }
    rrep(i, n) {
        if ((i == (n - 1)) || (a[i] != a[i + 1])) {
            if ((a[i] < h[i].first) || (a[i] > h[i].second)) {
                cout << 0 << endl;
                return 0;
            }
            h[i].first = a[i];
            h[i].second = a[i];
            continue;
        }
        h[i].second = min(h[i].second, a[i]);
    }
    ll ans = 1;
    rep(i, n) {
        ans = (ans * (h[i].second - h[i].first + 1)) % mod;
    }
    // rep(i, n) printf("i=%lld, h=(%lld, %lld)\n", i, h[i].first, h[i].second);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3456
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace AtCoder124
{
    class Program
    {
        public static void Main(string[] args)
        {
            string S = Console.ReadLine();
            char bef = S[0];
            int res = 0;
            for (int i = 1; i < S.Length; i++)
            {
                if (S[i] == bef)
                {
                    res++;
                    if (bef == '0')
                    {
                        bef = '1';
                    }
                    else
                    {
                        bef = '0';
                    }
                }
                else
                {
                    bef = S[i];
                }
            }
            Console.WriteLine(res);
        }
    }
}

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

using namespace std;

bool hantei(int n,vector<string> &a, vector<string> &b) {
	bool hanteiflg = true;
	for (int i = 0; i < n-2; i++) {
		if (a[i][1] == a[i + 1][1]) {
			for (int j = 0; j < n - 1; j++) {
				if (a[i] == b[j]) {
					for (int k = 0; k <= j; k++) {
						if (a[i + 1] == b[k]) {
							hanteiflg = false;
							return 0;
						}
					}
				}
			}
		}
	}
	return 1;
}

int main() {

	int n;
	cin >> n;
	vector<string> a(n, "");
	vector<string> b(n, "");
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	b = a;

	for (int i = 0; i < n; i++) {
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j][1] < a[j - 1][1]) {
				swap(a[j], a[j - 1]);
			}
		}
	}

	for (int i = 0; i < n-1; i++) {
		cout << a[i] << " ";
	}
	cout << a[n - 1] << endl;

	if (hantei(n,a,b)==1) {
		cout << "Stable" << endl;
	}
	else {
		cout << "Not stable" << endl;
	}

	a = b;
	int minj;
	for (int i = 0; i < n; i++) {
		minj = i;
		for (int j = i; j < n; j++) {
			if (a[j][1] < a[minj][1]) {
				minj = j;
			}
		}
		swap(a[i], a[minj]);
	}
	for (int i = 0; i < n - 1; i++) {
		cout << a[i] << " ";
	}
	cout << a[n - 1] << endl;

	if (hantei(n, a, b)==1) {
		cout << "Stable" << endl;
	}
	else {
		cout << "Not stable" << endl;
	}

}


Measured memory_bytes: 3208
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(){
	int N,sum=0;
	cin >> N;
	vector<int> l(2*N);
	for(int i=0;i<2*N;i++)	cin >> l[i];
	sort(l.begin(),l.end());
	for(int i=0;i<2*N;i+=2)	sum+=l[i];
	cout << sum << endl;
}

Measured memory_bytes: 256
<?php

//input
fscanf(STDIN,"%d %d",$n,$want);
for($i=0;$i<$n;++$i){
    $height[] = trim(fgets(STDIN));
}

sort($height);

$n -= $want;
for($i=0;$i<=$n;$i++){
    $answer[] = $height[$i+$want-1]-$height[$i];
    
}

echo min($answer);

?>

Measured memory_bytes: 18932
/*
*          Name : chaitanya
*
*     Institute : ANITS,Visakhapatnam
*
*/
#include<cstdio>
#include<iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include<cstring>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>
#include<sstream>
#define infy  1000000000
#define all(x) begin(x),end(x)
#define ll long long int
#define ff first
#define ss second
#define pb push_back
const ll m = 1000000007;
#pragma GCC optimization ("O3")
const int N = 1000010;
using namespace std;

int main()
{
  //"Don't regret anything you do, because in the end it makes you who you are."
  ll a, b = 0;
  cin >> a;
  string s;
  cin >> s;
  for (auto e : s) {
    if (e != '.') {
      b += (e-'0');
      b *= 10;
    }
  }
  b /= 10;
 
  cout << a*b/100 << "\n";
  return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define X first
#define Y second
#define mp make_pair
using namespace std;
typedef pair<int,bool> PIB;
typedef vector<PIB> T;
const int N = 2010;
int gcd(int a,int b){
	if(b==0) return a;
	return gcd(b,a%b);
}
int a[N],n;
vector<int> v[N],g[N];
bool use[N],in[N],pd[N];
int d[N],q[N],head,tail,t;
void dfs(int x){
	//cout<<x<<endl;
	int t;
	use[x]=true;
	for(int i=0;i<g[x].size();i++) if(!use[t=g[x][i]]){
		v[x].push_back(t);
	}
	for(int i=0;i<g[x].size();i++) if(!use[t=g[x][i]]){
		dfs(t);
	}
}

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	sort(a+1,a+n+1); 
	for(int i =1;i<=n;i++) for(int j = 1;j<=n;j++)if(i!=j && gcd(a[i],a[j])!=1) g[i].push_back(j);
//	cout<<g[2].size()<<endl;
	for(int i =1;i<=n;i++) if(!use[i]) dfs(i);
	int cnt =0;
	memset(pd,false,sizeof(pd));
	for(int i = 1;i<=n;i++) for(int j =0;j<v[i].size();j++) d[v[i][j]]++;
	while(cnt<n){
		int last = 0;
		for(int i = 1;i<=n;i++) if(!pd[i] && d[i]==0 && a[i]>a[last]){
			last = i;
		} 
		pd[last] = true;
		for(int i =0;i<v[last].size();i++) d[v[last][i]]--;
		printf("%d ",a[last]);
		cnt++;
	}
	return 0;
}

Measured memory_bytes: 23168
#include <stdio.h>
int A[25];
int n, q = 0;

int solve(int i, int m) {
    if (m == 0) {
        return 1;
    }
    if (i == n) {
        return 0;
    }
    int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
}

int main() {
    int m = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &A[i]);
    }
    scanf("%d", &q);
    for (int i = 0; i < q; i++) {
        scanf("%d", &m);
        if (solve(0, m)) {
            printf("yes\n");
        }
        else {
            printf("no\n");
        }
    }
    return 0;
}


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

using namespace std;

#define int long long

const int MAXN = 107;

int n, k;
int a[MAXN];

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

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

    int sum = 0;
    for (int i = 0; i < n; ++i) {
        sum += a[i];
    }

    if (sum == k) {
        cout << n << '\n';
        exit(0);
    }

    sort(a, a + n);

    int ans = 0;
    int curr = 0;
    for (int i = 0; i < n - 1; ++i) {
        curr += a[i];
        if (curr <= k) ans = i + 1;    
    }

    cout << ans << '\n';
    return 0;
}   

Measured memory_bytes: 256
from heapq import heappush,heappop
H,W = map(int,input().split())
table=[[] for i in range(10)]
for i in range(10):
    c=[int(k) for k in input().split()]
    for j in range(10):
        if i==j:
            continue
        table[j].append([i,c[j]])#jからiに行くコスト
A=[[int(i) for i in input().split()] for i in range(H)]

#ダイクストラ
kei=[]
val=[10**9]*(10)
val[1]=0
heappush(kei,(0,1))
while kei:
    d,i = heappop(kei)
    if d > val[i]:
        continue
    for x,q in table[i]:
        if val[x]>val[i]+q:
            val[x]=val[i]+q
            heappush(kei,(val[x],x))
ans =0
for i in range(W):
    for j in range(H):
        if A[j][i]!=-1 and A[j][i]!=1:
            ans += val[A[j][i]]
print(ans)

Measured memory_bytes: 3444
import java.util.*;

public class Main {

    public static void main(String arg[]) {
        try {
            Scanner scan = new Scanner(System.in);
            int W = scan.nextInt();
            int H = scan.nextInt();
            int x = scan.nextInt();
            int y = scan.nextInt();
            int r = scan.nextInt();

            if (-101 < x && x < 101 && -101 < y && y < 101 && 0 < W && W < 101 && 0 < H && H < 101 && 0 < r && r < 101) {
                if (0 <= x - r && 0 <= y - r && x + r <= W && y + r <= H) {
                    System.out.println("Yes");
                } else {
                    System.out.println("No");
                }
            }
        } catch (InputMismatchException ex) {
            System.out.println("1??????100?????§????????¶??°?????\?????????????????????");
        }
    }
}

Measured memory_bytes: 26388
#include <iostream>
#include <string>
using namespace std;
int main(void) {
	int n;
	string s, t;
	cin >> n >> s >> t;
	int num = 0;
	for (int i = 0; i < n; ++i) {
		if (s.substr(n - 1 - i, i + 1)
			== t.substr(0, i + 1))
			num = i + 1;
	}
	cout << n * 2 - num << endl;
	return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	A, B, K := ReadInt(), ReadInt(), ReadInt()
	if A >= K {
		fmt.Println(A-K, B)
		return
	}
	if A+B >= K {
		fmt.Println(0, B-(K-A))
	} else {
		fmt.Println(0, 0)
	}
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) (a []int) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt())
	}
	return
}


Measured memory_bytes: 1840
# AOJ 0165 Lottery
# Python3 2018.6.23 bal4u

#define MAX  1000000
#define SQRT 1000     // sqrt(MAX)



MAX = 1000000
SQRT = 1000     # sqrt(MAX)
comp = [0]*(MAX+2)

def sieve():
	for i in range(3, SQRT, 2):
		if comp[i] == 0:
			for j in range(i*i, MAX, i): comp[j] = 1
sieve()
tbl = [0]*(MAX+2)
tbl[2] = k = 1
for i in range(3, MAX, 2):
	if comp[i] == 0: k += 1
	tbl[i+1] = tbl[i] = k

while 1:
	n = int(input())
	if n == 0: break
	ans = 0;
	for i in range(n):
		p, m = map(int, input().split())
		a, b = p-m, p+m
		if a < 2: a = 2
		if b > 1000000: b = 1000000
		ans += tbl[b]-tbl[a-1] - 1;
	if ans < 0: ans = 0
	print(ans)



Measured memory_bytes: 23708
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;

int a[100010];

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int n;scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	int l=1,r=n;
	while (l<=r)
	{
		int mid=(l+r)>>1;
		ll s=0;
		for (int i=1;i<=mid;i++) s+=a[i];
		bool ok=1;
		for (int i=mid+1;i<=n;i++)
		{
			if (s*2<a[i]) {ok=0;break;}
			s+=a[i];
		}
		if (ok) r=mid-1; else l=mid+1;
	}
	printf("%d\n",n-r);
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
    using namespace std;
    int n,m;
    const int N=200009;
    vector<int>vv[N];
    pair<int,int>a[N];
    long long laz[4*N*2];
    long long  tree[4*N*2];
    void up(int ind,int st,int end ,int l,int r,long long val)
    {
        if (laz[ind]!=0)
        {
            tree[ind]+=laz[ind];
            if (st!=end){laz[ind*2+1]+=laz[ind];
            laz[ind*2+2]+=laz[ind];}
            laz[ind]=0;
        }
        if (l<=st&&end<=r)
        {
            tree[ind]+=val;
            if (st!=end){laz[ind*2+1]+=val;
            laz[ind*2+2]+=val;}
            return ;
        }
        if (r<st||l>end)return ;
        int m=(st+end )/2;
        up(ind*2+1, st,m , l, r, val);
        up(ind*2+2, m+1,end , l, r, val);
        tree[ind]=max(tree[ind*2+1],tree[ind*2+2]);
    }

    long long query(int ind,int st,int end ,int l,int r)
    {
    //    cout<<st<<" "<<end<<endl;
        if (laz[ind]!=0)
        {
            tree[ind]+=laz[ind];
            if (st!=end){laz[ind*2+1]+=laz[ind];
            laz[ind*2+2]+=laz[ind];}
            laz[ind]=0;
        }
        if (l<=st&&end<=r)
        {return tree[ind];
        }
        if (r<st||l>end)return 0;
        int m=(st+end )/2;
        return max(query(ind*2+1, st,m , l, r),query(ind*2+2, m+1,end , l, r));
        }
    int main()
    {
        int x,y,z;
        cin>>n>>m;
        for(int i=1;i<m+1;i++)
        {
            cin>>x>>y>>z;
            a[i]=make_pair(x,z);
            //v[x].push_back(i);
            vv[y].push_back(i);
        }

        for(int i=1;i<n+1;i+=1)
        {
            long long x=query(0,0,n,0,i-1);
            up(0,0,n,i,i,x);
            for(auto it:vv[i])
            {
                up(0,0,n,a[it].first,i,a[it].second);
            }
        }
        cout<<query(0,0,n,0,n);
    }


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

using namespace std;

int const NMAX = 100;
char v[1 + NMAX][1 + NMAX];

int main() {

  int n, m;
  cin >> n >> m;
  cout << max(n * m, max(n - m, n + m));
  return 0;
}


Measured memory_bytes: 3632
n = int(input())
ans = 0
for i in range(1,n+1):
    tmp = 0
    for j in range(1,i+1):
        if i%2 == 0:
            continue
        if i%j == 0:
            tmp += 1
    if tmp == 8:
        ans += 1
        
print(ans)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr 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;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int A, B, C;
    int X;
    cin >> A >> B >> C;
    cin >> X;
    int cnt = 0;
    REP(i, A + 1) {
        REP(j, B + 1) {
            REP(k, C + 1) {
                if(500 * i + 100 * j + 50 * k == X) {
                    cnt++;
                }
            }
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i=0; i<N; i++) cin >> A[i];
  int ans = -1000;
  sort(A.begin(),A.end());
  for (int i=0; i<=N-1; i++) {
    for (int j=0; j<=N-1; j++) {
      ans = max(A[i]-A[j],ans);
    }
  }
  cout << ans << endl;
}

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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

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

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

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

int main(){
    bool flag=false;
    ll cho=0,aok=0;

    int n;
    cin >>n;
    vector<pii>a_b;
    vector<pii>ab;

    rep(i,n){
        int a,b;
        cin>>a>>b;
        ab.emplace_back(a,b);
        a_b.emplace_back(a+b,i);
    }

    sort(all(a_b),greater<pii>());

    int ch=0,ao=n-1;
    
    rep(i,n){
        if(i%2==0){
            cho += ab[a_b[i].se].fi;
        }else{
            aok += ab[a_b[i].se].se;
        }
    }
    ll ans = cho - aok;
    //cout <<fixed<<setprecision(16)<< << endl;
    cout<<ans<<endl;
    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


Measured memory_bytes: 2160
#include <string.h>
#include <stdio.h>
#define REP(i, a, b) for(long long int i = a; i < b; i++)

int main(void) {
    int a[26];
    REP(i, 0, 26) {
        a[i] = 0;
    }
    char s[200];
    scanf("%s", s);
    REP(i, 0, strlen(s)) {
        a[s[i] - 97]++;
    }
    REP(i, 0, 26) {
        if (a[i] % 2 != 0) {
            puts("No");
            goto end;
        }
    }
    puts("Yes");
end:
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FIR first
#define SEC second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

signed main(){
  string s;
  cin>>s;
  int g=0,p=0;
  REP(i,s.size()){
    if(s[i]=='g')g++;
    else p++;
  }
  if(s.size()%2==0){
    int tmp=s.size()/2;
    cout<<min(g,tmp)-min(p,tmp)<<endl;
    return 0;
  }else{
    cout<<s.size()/2-p<<endl;
  }
  return 0;
}


Measured memory_bytes: 512
import java.util.*;
//import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		char[] x = sc.next().toCharArray();
		char[] y = sc.next().toCharArray();
		sc.close();
		out.println(x[0]<y[0]?"<":x[0]>y[0]?">":"=");
	}
}


Measured memory_bytes: 21716
# include <cmath>
# include <iostream>
# include <queue>
# include <set>
# include <stack>
# include <string>
# include <vector>


using namespace std;


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

    int ans = 1;
    int cur = 1001001001;
    for (int i=1; i<n; i++) {
        cur = min(cur, p[i-1]);
        if (cur >= p[i]) ans++;
    }

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



Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
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; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

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

  return 0;
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
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
import math
from operator import itemgetter as ig
from collections import defaultdict as dd
# 定数
INF = float("inf")
MOD = int(1e9 + 7)
# データ構造：ヒープ
import heapq
class heapque:
    def __init__(self, *args):
        self.que = []
        for arg in args:
            self.push(arg)
    def push(self, v):
        heapq.heappush(self.que, v)
    def pop(self):
        return heapq.heappop(self.que)
# 最大公約数 / 最小公倍数
def gcd(v1, v2):
    if v2 == 0:
        return v1
    return gcd(v2, v1 % v2)
def lcm(v1, v2):
    return (v1 // gcd(v1, v2)) * v2
# 二分探索
def bsr(a, v, lo=0, hi=None):
    if hi == None:
        hi = len(a) - 1
    if hi < lo:
        return lo
    mi = (lo + hi) // 2
    if v < a[mi]:
        return bsr(a, v, lo, mi - 1)
    else:
        return bsr(a, v, mi + 1, hi)
# Union-Find木
class uft:
    def __init__(self, n):
        self.height = [1] * n
        self.group = [-1] * n
    def root(self, v):
        if self.group[v] < 0:
            return v
        self.group[v] = self.root(self.group[v])
        return self.group[v]
    def size(self, v):
        return - self.group[self.root(v)]
    def merge(self, v1, v2):
        v1, v2 = self.root(v1), self.root(v2)
        if v1 == v2:
            return
        if self.height[v1] < self.height[v2]:
            self.group[v2] += self.group[v1]
            self.group[v1] = v2
            self.height[v2] = max(self.height[v1] + 1, self.height[v2])
        else:
            self.group[v1] += self.group[v2]
            self.group[v2] = v1
            self.height[v1] = max(self.height[v1] , self.height[v2] + 1)

def main():
    L, R = map(int, input().split())
    if 2019 < (R - L + 1):
        print(0)
    else:
        min_mod = INF
        for l in range(L, R + 1):
            for r in range(l + 1, R + 1):
                min_mod = min(min_mod, l * r % 2019)
        print(min_mod)

main()


Measured memory_bytes: 3316
#include<iostream>
#include<vector>
#include<string>
#include<set>
using namespace std;

int main() {
	int N;
	cin >> N;
	set<int> A;
	for (int i = 0,a; i < N; i++) {
		cin >> a;
		A.insert(a);
	}
	cout << A.size();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_N = 200005;
int par[MAX_N],mysize[MAX_N];

void init()
{
	rep(i,MAX_N)
	{
		par[i] = i;
		mysize[i] = 1;
	}
}

int find(int x)
{
	if (par[x] == x)
	{
		return x;
	}
	else
	{
		return par[x] = find(par[x]);
	}
}

void unite(int x, int y)
{
	x = find(x);
	y = find(y);
	if (x == y) return;
	if (mysize[x] > mysize[y]) swap(x,y);
	par[x] = y;
	mysize[y] += mysize[x];
	return;
}

int get_size(int x)
{
	return mysize[find(x)];
}

int main()
{
	init();
	int N,M;
	cin >> N >> M;
	rep(i,M)
	{
		int a,b;
		a--; b--;
		cin >> a >> b;
		unite(a,b);
	}
	int ans = 1;
	rep(i,N)
	{
		ans = max(ans,get_size(i));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 5096
n = int(input())
a = [int(i) for i in input().split()]

while len(a) > 1:
  minimum_value = min(a)
  for i in range(len(a)):
    r = a[i] % minimum_value
    a[i] = r if r > 0 else minimum_value

  a = list(set(a))

print(a[0])


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


int main()  
{ 

    long long n;
    cin >> n;
    int arr[10000]; 
    int i=0; 
   
    while(n){ 
        arr[i]=n%26; 
        n=n/26; 
        i++; 
    } 
   
    for (int j=0; j<i-1; j++) { 
        if (arr[j]<=0) { 
            arr[j]+=26; 
            arr[j+1]=arr[j+1]-1; 
        } 
    } 
    for (int j=i; j>= 0; j--) { 
        if (arr[j]>0) 
        cout << char('a'+arr[j]-1) ; 
    } 
    cout << endl; 
    return 0;
} 

Measured memory_bytes: 3616
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;
#define pb push_back
#define fi first
#define se second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
void solve(){
    int n, m;
    cin >> n >> m;
    vi a(n);
    int sum = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        sum += a[i];
    }
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
        if ((sum - 1) / (4 * m) + 1 <= a[i]) cnt++;
    }
    if (cnt >= m) cout << "Yes";
    else cout << "No";

}
int main(){
    speed;
    int t = 1;
    //cin >> t;
    while(t--) solve();
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int k,x;scanf("%d%d",&k,&x);
	int l=max(x-k+1,-1000000),r=min(1000000,x+k-1);
	for(int i=l;i<=r;i++)printf("%d ",i);
	return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
   int N;

  cin >> N;
  string s[N];

  int i;
  while(i < N){
    cin >> s[i];
    i++;
  }
  int j = 0;
  for(int k; k < N; k++){
    if (s[k] == "Y") {
      j++;
    }
  }
  if (j != 0) {
    cout << "Four" << endl;
  }else{
    cout << "Three" << endl;
  }
 

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
  public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

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


void solve(long long X, long long Y){
    ll ans = 0;
    if(X == 1 && Y == 1){
        ans+=400000;
    }

    if(X<=3){
        ans+= 100000*(4-X); 
    }

    if(Y <= 3){
        ans += 100000*(4-Y);
    }

    cout << ans << endl;
}

int main(){
    long long X;
    scanf("%lld",&X);
    long long Y;
    scanf("%lld",&Y);
    solve(X, Y);
    return 0;
}


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

int S[200000];
int L[100001];
int R[100001];
long long c=0;

void merge(int A[], int left, int mid, int right)
{
    int n1 = mid - left;
    int n2 = right - mid;
    int i, j, k;
    for(i=0; i<n1; i++) L[i] = A[left + i];
    for(i=0; i<n2; i++) R[i] = A[mid + i];
    L[n1] = R[n2] = numeric_limits<int>::max();
    i=j=0;
    for(k=left; k<right; k++) {
        if(L[i]<=R[j]) {
            A[k] = L[i++];
            c+=j;
        } else A[k] = R[j++];
    }
}

void mergeSort(int A[], int left, int right)
{
    if(left+1<right) {
        int mid = (left+right)/2;
        mergeSort(A, left, mid);
        mergeSort(A, mid, right);
        merge(A, left, mid, right);
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=0; i<n; i++) cin>>S[i];
    mergeSort(S, 0, n);
    cout<<c<<'\n';
    return 0;
}

Measured memory_bytes: 2756
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;

long long mod = 998244353;
#define REP(i, n) for (long long i = 0; i < (n); i++)

long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return t * t % mod;
    } else {
        return modpow(m, n - 1) * m % mod;
    }
}

long long moddiv(long long a, long long b) { return (a * modpow(b, mod - 2)) % mod; }

long long nCkmod(long long n, long long k) {
    long long denomi = 1;
    REP(i, n) {
        denomi *= (i + 1);
        denomi %= mod;
    }
    long long numera = 1;
    for (int i = n - k; i > 0; i--) {
        numera *= i;
        numera %= mod;
    }
    REP(i, k) {
        numera *= (i + 1);
        numera %= mod;
    }
    return moddiv(denomi, numera);
}

void print_binary(long long a) {
    for (int i = 31; i >= 0; i--) {
        cout << (a >> i & 1);
    }
    cout << endl;
}

void yes() {
    cout << "Yes" << endl;
    exit(0);
}
void no() {
    cout << "No" << endl;
    exit(0);
}
array<int, 101> factoring(int x) {
    array<int, 101> ret{};
    for (int i = 2; x >= i * i; i++) {
        while (x % i == 0) {
            ret[i]++;
            x /= i;
        }
    }
    if (x > 1) ret[x]++;
    return ret;
}
signed main() {
    long long n;
    cin >> n;
    for (int i = floor(sqrt(n)); i > 0; i--) {
        if (n % i == 0) {
            string s = to_string(n / i);
            cout << s.size() << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
from bisect import bisect_right
s = input()
t = input()

char_dic = dict()
for i in range(len(s)):
    if not s[i] in char_dic:
        char_dic[s[i]] = []
    char_dic[s[i]].append(i)

m = len(s)
i = 0
last_idx = -1
counter = dict()
for c in t:
    if not c in char_dic:
        print(-1)
        quit()
    j = bisect_right(char_dic[c], last_idx)
    if j == len(char_dic[c]):
        i += 1
        last_idx = char_dic[c][0]
    else:
        last_idx = char_dic[c][j]
print(i * len(s) + last_idx + 1)

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

int main() {
	int N,M;
  	cin >> N >> M;
  
  	vector<int> vec(M);
  
  	for(int i = 0; i < N; i++) {
    	int K;
      	cin >> K;
      	
      	for(int j = 0; j < K; j++) {
        	int a;
          	cin >> a;
          	vec.at(a - 1)++;
        }
    }
  
  	int ans = 0;
  	for(int i = 0; i < M; i++) {
    	if(vec.at(i) == N) ans++;
    }
  
  	cout << ans << endl;
}

Measured memory_bytes: 256
class Dice:
    def __init__(self, labels):
        self.labels = labels
        
    def __str__(self):
        return str(self.labels[0])
    
    def roll_south(self):
        self.labels[0], self.labels[1], self.labels[5], self.labels[4] = self.labels[4], self.labels[0], self.labels[1], self.labels[5]
            
    def roll_east(self):
        self.labels[0], self.labels[2], self.labels[5], self.labels[3] = self.labels[3], self.labels[0], self.labels[2], self.labels[5]
    
    def roll_west(self):
        self.labels[0], self.labels[3], self.labels[5], self.labels[2] = self.labels[2], self.labels[0], self.labels[3], self.labels[5]
    
    def roll_north(self):
        self.labels[0], self.labels[4], self.labels[5], self.labels[1] = self.labels[1], self.labels[0], self.labels[4], self.labels[5]
        
    def get_faces(self):
        return self.labels
        
def main():
    labels0 = list(map(int, input().split()))
    labels = list(map(int, input().split()))
    d = Dice(labels)
    
    d0 = Dice(labels0)
    f = labels0[0]
    for i in labels0:
        if labels0.count(i) < labels0.count(f):
            f = i
    ind = labels0.count(f)
    if ind == 1:
        d0.roll_north()
    elif ind == 4:
        d0.roll_south()
    else:
        while d0.get_faces()[0] != f:
            d.roll_east()
    labels0 = d0.get_faces()
    

    ind0 = labels.index(labels0[0])
    ind1 = labels.index(labels0[1])
    if ind0 == 1:
        d.roll_north()
    elif ind0 == 4:
        d.roll_south()
    else:
        while d.get_faces()[0] != labels0[0]:
            d.roll_east()
    while d.get_faces()[1] != labels0[1]:
        d.roll_east()
        d.roll_south()
        d.roll_west()
    for i in range(2,6):
        if d.get_faces()[i] != labels0[i]:
            print('No')
            return
    print('Yes')
    return
            
main()


Measured memory_bytes: 5620
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		int N=s.nextInt(), D=s.nextInt(), c=0;
		for(int i=0;i<N;i++) {
			long X=s.nextInt(), Y=s.nextInt();
			if(D>=Math.sqrt(X*X+Y*Y))c++;
		}
		System.out.println(c);
	}
}


Measured memory_bytes: 59472
import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b
half = flip div 2
aliq = ((0==).).mod

main = do
 inputs <- readLnInt
 print $ solve inputs

solve [n,a,b] = min (n*a) b


Measured memory_bytes: 380
#include <assert.h>
#include <limits.h>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cout << i << "\n"

//const ll MOD = 998244353;
const ll MOD = 1e9+7;

ll dp[72][2][2]={0};
 
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  
  ll l,r;
  std::cin>>l>>r;

  ll n=0,m=0,temp=r;
  while(temp>0){
    n++;
    temp/=2;
  }
  temp=l;
  while(temp>0){
    m++;
    temp/=2;
  }

  if(n==m)dp[0][1][1]=1;
  else dp[0][1][0]=1;

  rep(i,1,n){
    dp[i][0][0]+=(3*dp[i-1][0][0]);
    bool rflag=(r>>(n-1-i))&1,lflag=(l>>(n-1-i))&1;
    if(rflag){
      dp[i][0][0]+=dp[i-1][1][0];
      dp[i][1][0]+=2*dp[i-1][1][0];
    }else{
      dp[i][1][0]+=dp[i-1][1][0];
    }

    if(!lflag){
      dp[i][0][0]+=dp[i-1][0][1];
      dp[i][0][1]+=2*dp[i-1][0][1];
    }else{
      dp[i][0][1]+=dp[i-1][0][1];
    }

    if(rflag&&(!lflag)){
      dp[i][0][1]+=dp[i-1][1][1];
      dp[i][1][0]+=dp[i-1][1][1];
      dp[i][1][1]+=dp[i-1][1][1];
    }else if(rflag||(!lflag)){
      dp[i][1][1]+=dp[i-1][1][1];
    }

    if(i<n-m)dp[i][0][0]+=1;
    else if(i==n-m)dp[i][0][1]+=1;

    dp[i][0][0]%=MOD;
    dp[i][0][1]%=MOD;
    dp[i][1][0]%=MOD;
    dp[i][1][1]%=MOD;
  }

  std::cout<<(dp[n-1][0][0]+dp[n-1][0][1]+dp[n-1][1][0]+dp[n-1][1][1])%MOD;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	string s;
	cin >> s;
	int mina=s.length(),maxz=0;
	for(int i=0;i<s.length();i++){
		if(s[i]=='A'&&i<mina) mina=i;
		if(s[i]=='Z'&&i>maxz) maxz=i;
	}
	cout << maxz-mina+1 << endl;
	return 0;
}


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

signed main(){
  int N;
  cin>>N;
  if(N>=30)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 3668
using System;

public class Hello
{
    public static void Main()
    {
        var btn = new string[] { ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz" };
        var n = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < n; i++)
        {
            var result = "";
            var s = Console.ReadLine().Trim();
            var number = -1;
            var count = 0;
            for (int j = 0; j < s.Length; j++)
            {
                if (s[j] != '0') { number = int.Parse(s[j].ToString()); count++; }
                else
                {
                    if (number != -1)
                    {
                        result += Kakutei(number, count, btn);
                        number = -1;
                        count = 0;
                    }
                }
            }
            Console.WriteLine(result);
        }
    }
    public static string Kakutei(int b, int i, string[] btn)
    {
        var bL = btn[b - 1].Length;
        return btn[b - 1][(i + bL - 1) % bL].ToString();
    }
}

Measured memory_bytes: 9084