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

#define ff              first
#define ss              second
#define int             long long
#define endl            '\n'
#define pb              push_back
#define mp              make_pair
#define pr              pair<int,int>
#define vc              vector<int>
#define ma              map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(t)            int t; cin>>t; while(t--)




void fast_bhati()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

}

int sumOfDigits(int n){
    int s = 0;
    while(n!=0){
        s=s+n%10;
        n=n/10;
    }
    return s;
}
void solve(){



}
int32_t main()
{
    fast_bhati();
    int n;
    cin>>n;
    int a,b,c,d;
    int maxA=INT_MAX;//min(x+y)
    int maxB=INT_MIN;//max(x-y)
    int maxC=INT_MIN;//max(y-x)
    int maxD=INT_MIN;//max(x+y)

    for(int i=0;i<n;i++){
        cin>>a>>b;
        maxA=min(maxA,a+b);
        maxB=max(maxB,a-b);
        maxC=max(maxC,b-a);
        maxD=max(maxD,a+b);

    }
    int ans =  max(maxD-maxA,maxB+maxC);
    cout<<ans;



    return 0;
}




Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <string.h>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
#include <cmath>
#include <map>
#include <set>
#include <assert.h>
#include <sstream>
#include <bitset>
#define REP(i,n) for(ll i=0;i<(n);i++)
#define MOD 1000000007
#define int long long
#ifdef int
const long long INF = LLONG_MAX / 10;
#else
const int INF = 1010101010;
#endif
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> mat;
typedef pair<int, int> P;
//typedef pair<double, double> P;

int N, K;
int x[55], y[55];
set<int> xs, ys;

signed main()
{
    cin >> N >> K;
    REP(i,N) {
        cin >> x[i] >> y[i];
        xs.insert(x[i]);
        ys.insert(y[i]);
    }

    int ans = LLONG_MAX;
    for (auto x1=xs.begin(); x1!=xs.end(); x1++) {
        for (auto x2=x1; x2!=xs.end(); x2++) {
            for (auto y1=ys.begin(); y1!=ys.end(); y1++) {
                for (auto y2=y1; y2!=ys.end(); y2++) {
                    if ((*x2 - *x1) * (*y2 - *y1) > ans) continue;
                    int cnt = 0;
                    REP(i,N) if (*x1<=x[i] && x[i]<=*x2 && *y1<=y[i] && y[i]<=*y2) cnt++;
                    if (cnt >= K) ans = (*x2 - *x1) * (*y2 - *y1);
                }
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

ll mpow(ll x, ll n) { ll y = 1; for (; n > 0; n /= 2) { y = n % 2 ? y * x % MOD : y; x = x * x % MOD; } return y; }
struct Combination {
    vector<ll> fact, ifact;
    Combination(int n) : fact(n + 1), ifact(n + 1) {
        fact[0] = 1; for (int i = 0; i < n; ++i) fact[i + 1] = fact[i] * (i + 1) % MOD;
        ifact[n] = mpow(fact[n], MOD - 2); for (int i = n; i > 0; --i) ifact[i - 1] = ifact[i] * i % MOD;
    }
    ll operator ()(int n, int k) { return k < 0 || k > n ? 0 : fact[n] * ifact[n - k] % MOD * ifact[k] % MOD; }
};

int main() {
    int N;
    cin >> N;
    vector<ll> C(N);
    rep(i, N) cin >> C[i];

    if (N == 1) {
        write(2 * C[0] % MOD);
        return 0;
    }

    sort(all(C));
    reverse(all(C));

    ll t = 1 * 1;
    ll ans = t * C[0] * 2 * mpow(2, 2 * (N - 1)) % MOD;
    rep(i, 1, N) {
        t = (2 * t + mpow(2, i - 1)) % MOD;
        ans = (ans + t * C[i] % MOD * mpow(2, i + 1) % MOD * mpow(2, 2 * (N - i - 1))) % MOD;
    }

    write(ans);
}

Measured memory_bytes: 1792
import math
import fractions
gcd = math.gcd if hasattr(math, "gcd") else fractions.gcd

A, B = map(int, input().split())

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

g = gcd(A, B)

print(len(set(factorize(g)))+1)


Measured memory_bytes: 5348
# import sys
# import math #sqrt
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # deque
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    s = input()
    for i in range(ord('a'),ord('z')+1):
        res = 1
        for j in range(len(s)):
            if s[j]==chr(i):
                res = 0
                break
        if res:
            print(chr(i))
            return 0
    print("None")
    return

if __name__=='__main__':
    main()

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=305;
int v[N][N];
int freq[N];
bool t[N];

int n,m,at;
int check(){
	int ret=0;
	memset(freq,0,sizeof freq);
	for(int i=0;i < n;i++){
		for(int j=0;j < m;j++){
			if(t[v[i][j]]){
				freq[v[i][j]]++;
				if(freq[v[i][j]] > ret){
					ret=freq[v[i][j]];
					at=v[i][j];
				}
				break;
			}
		}
	}
	return ret;
}

int main(){

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

	scanf("%d%d",&n,&m);
	for(int i=0;i < n;i++){
		for(int j=0;j < m;j++){
			scanf("%d",&v[i][j]);
			t[j + 1]=1;
		}
	}
	int ans=check();
	for(int i=0;i < m - 1;i++){
		t[at]=0;
		ans=min(ans,check());
	}
	cout << ans << endl;

	return 0;
}


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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m;
  cin >> n >> m;
  string s;
  cin >> s;
  reverse(all(s));

  ll cnt = 0;
  rep(i,n){
    if(s[i] == '1'){
      cnt++;
      if(cnt == m){
        cout << -1 << endl;
        return 0;
      }

    } else cnt = 0;
  }
  int board[n+1];
  rep(i,n+1){
    if(s[i] == '0') board[i] = i;
    else board[i] = board[i-1];
  }
  VI ans;
  int current = 0;
  while(true){
    current += m;
    if(current >= n){
      ans.push_back(m-(current-n));
      break;
    }else{
      int nx = board[current];
      ans.push_back(m-(current-nx));
      current = nx;
    }
  }

  reverse(all(ans));
  rep(i,ans.size()){
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}


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

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef long long ll;

int main()
{
    ll N,K,res;
    ll tmp;

    cin >> N >> K;

    vector <ll> cnt(200001,0);

    if(N == K)
    {
        cout << "0" << endl;
        return 0;
    }


    REP(i,N)
    {
        cin >> tmp;
        cnt[tmp]++; 
    }

    //大きい方からKまでたしていけばいいって話
    sort(cnt.begin(),cnt.end(),greater<ll>());

    ll zan = 0;
    ll keshi;

    for(ll i = 0; i < K; i++)
    {
        zan += cnt[i];
    }

    keshi = N - zan;

    cout << keshi << endl;

}



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

int main() {
  int n;
  cin >> n;
  vector<int>p(n);
  rep(i,n) cin >> p[i];
  int res = n;
  int ans = 0;
  rep(i,n){
    res = min(res, p[i]);
    if(p[i]<=res) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
// https://respect2d.hatenadiary.org/entry/20110209/1297332247

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define sz(x) (ll)(x).size()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;
typedef vector<ll> vl;
typedef vector<P> vp;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

const ll MAX_X = 15;
const ll MAX_N = 100005;
#define MAX_X 15
#define MAX_N 100005

// dp[i][j] .. probability for using [0,i) and succeeds j times in a row.
double dp[MAX_N][MAX_X];
double per[MAX_X];
double ans[MAX_N];

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cout << setprecision(10) << fixed;

  rep(i,MAX_X) {
    per[i] = pow(0.5,i);
  }
  dp[0][0] = 1.0;

  double sum = 0;
  rep(i,MAX_N) {
    rep(j,MAX_X) {
      if(dp[i][j] > 0) {
        sum += dp[i][j] * per[j];

        dp[i+1][0]   += dp[i][j] * (1-per[j]); // lose
        dp[i+1][j+1] += dp[i][j] * per[j];     // win
      }
    }

    ans[i] = sum;
  }

  while (true) {
    ll n;
    cin >> n;
    if (n == 0) { break; }
    cout << ans[n-1] << endl;
  }
}



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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main()
{
    ll i,j;
    ll n,k;
    cin >> n >> k;
    vector<ll> a(n);
    for(i = 0;i < n;++i){
        cin >> a.at(i);
    }
    vector<ll> kaisuu(n,-1);
    ll now = 0;
    ll next;
    ll times = 0;
    while(true){
        ++times;
        next = a.at(now)-1;
        if(kaisuu.at(next) == -1){
            kaisuu.at(next) = times;
            now = next;
        }else{
            break;
        }
    }
    if(k < times){
        for(i = 0;i < n;++i){
            if(kaisuu.at(i) == k){
                cout << i+1 << endl;
                return 0;
            }
        }
    }else{
        ll hazimari = kaisuu.at(next);
        ll syuuki = times-hazimari;
        k -= times;
        k %= syuuki;
        now = next;
        while(k){
            next = a.at(now)-1;
            --k;
            now = next;
        }
        cout << now+1 << endl;
    }

    return 0;
}


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

int minCost(int *arr, int n,int k, int *dp){
    if(n==1) return 0;
    if(k>n) k=n;
    
    if(dp[n]!=-1) return dp[n];
    
    int minC=INT_MAX;
    for(int i=1;i<=k;i++){
        minC=min(minC,i==n?INT_MAX:abs(arr[n]-arr[n-i]) + minCost(arr,n-i,k,dp));
        
    }
    dp[n]= minC;
    return dp[n];
}

int main(){
	int n,k;
  	cin>>n>>k;
  	int *arr=new int[n+1];
    for(int i=1;i<=n;i++){
    	int h;
      	cin>>h;
      	arr[i]=h;
    }
    
    int *dp=new int[n+1];
    memset(dp,-1,sizeof(dp[0])*(n+1));
    
    cout<< minCost(arr,n,k,dp)<<endl;
    return 0;
}

Measured memory_bytes: 10368
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 998244353;

ll powmod(ll n, ll k) {
    ll r = 1, t = n % P;
    for (; k != 0; k /= 2) {
        if (k & 1) r = r * t % P;
        t = t * t % P;
    }
    return r;
}
ll inv(ll n) {
    return powmod(n, P - 2);
}

vector<int> f0, f1;
void init(int n) {
    f0.resize(n + 1);
    f0[0] = 1;
    for (int i = 1; i <= n; i++) {
        f0[i] = (ll)f0[i - 1] * i % P;
    }
    f1.resize(n + 1);
    f1[n] = inv(f0[n]);
    for (int i = n; i > 0; i--) {
        f1[i - 1] = (ll)f1[i] * i % P;
    }
}
ll fact(int k) {
    return f0[k];
}
ll comb(int n, int k) {
    if (n < k || k < 0) return 0;
    return (ll)f0[n] * f1[k] % P * f1[n - k] % P;
}

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

    int k, n;
    cin >> k >> n;

    init(k + n);

    vector<int> b(k);
    b[0] = 1;
    for (int i = 1; i < k; i++) {
        b[i] = (ll)b[i - 1] * 2 % P;
    }

    for (int i = 2; i <= 2 * k; i++) {
        ll r = 0;
        int i0 = max(i - k, 1);
        int i1 = min(i - 1, k);
        int a = (i1 - i0 + 1) / 2; // 和がiになるペアの数
        int c = (i0 - 1) + (k - i1); // ペアの外側の数
        for (int h = 0; h < 2; h++) {
            int m = n - h;
            for (int j = 0; j <= min(a, m); j++) { // ペアの片側は非0な数
                int k = c + j - 1;
                r += comb(a, j) * b[j] % P * comb(m - j + k, k) % P; // n個をj個に振り分ける
            }
            r %= P;
            if (i % 2 == 1) break;
        }
        cout << r << '\n';
    }
    cout << flush;

    return 0;
}

Measured memory_bytes: 384
s = str(input())
count = 1
for i in s:
    if i == "A":
        A_index = count
        break
    count += 1
    
count = 1
for i in list(reversed(s)):
    if i == "Z":
        Z_index = count
        break
    count += 1
    
print(len(s)-A_index-Z_index+2)

Measured memory_bytes: 4840
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define INF 1LL<<50
#define fst first
#define sec second
#define pb push_back
#define int long long
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(int itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(int itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define debug(x)  cout << #x << " = " << (x) << endl;
typedef long long ll;
typedef pair<ll,ll> P;

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

  int n,m;
  cin >> n >> m;
  
  int a[n] = {};
  REP(i,m){
    int x,y;
    cin >> x >> y;
    a[x-1]++;
    a[y-1]++;
  }
  
  bool flag = true;
  REP(i,n){
    if(a[i] % 2 == 0) continue;
    flag = false;
    break;
  }
  
  if(flag) cout << "YES" << endl;
  else	   cout << "NO" << endl;

  return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int result = 0;

		while(x >= 500) {
			x -= 500;
			result += 1000;
		}

		while(x >= 5) {
			x -= 5;
			result += 5;
		}

		System.out.println(result);
	}

}


Measured memory_bytes: 23764
import math

x = list()
n, d = map(int, input().split())

for i in range(0, n):
  row = list(map(int, input().split()))
  x.append(row)
  
count = 0
for i in range(0, n):
  for j in range(i+1, n):
    tmp_list = map(lambda x, y: (x - y)**2, x[i], x[j])
    result = math.sqrt(sum(tmp_list))

    if (result.is_integer()):
        count += 1

print(count)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds; 
using ll = long long int;
#define INF             1e14
#define dd              double
#define MOD             1000000007
#define my_sizeof(type) ((char *)(&type+1)-(char*)(&type)) 
#define nl              cout<<endl
#define fill(a,val)     memset(a,val,sizeof(a))
#define mp              make_pair
#define endl            "\n"
#define pb              push_back
#define ff              first    
#define ss              second
#define SIZE            200005
#define all(v)          v.begin(),v.end()
#define s(ar,n)         sort(ar,ar+n)
#define rs(ar,n)        sort(ar, ar+n, greater<ll>()) 
#define oa(a,n)         for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n)         for(ll i=0;i<n;i++)cin>>a[i];
#define maxa(ar,N)      *max_element(ar,ar+N)
#define mina(ar,N)      *min_element(ar,ar+N)
#define fastio()        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define printclock      cerr<<"Time : "<<1000*(long double)clock()/(long double)CLOCKS_PER_SEC<<"ms\n";
typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// find_by_order() - 0 indexing
// order_of_key() - number of elements strictly smaller
ll power(ll x, ll y){
    ll res=1;x=x;
    while(y>0){
        if(y&1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}  
ll logtwo(ll n){
    if(n==1)
        return 0;
    return logtwo(n/2)+1;
}
//---------------------------------------GL HF------------------------------------------------------
// -------------------------------------ManavJ07----------------------------------------------------
signed main()
{
    fastio();   
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int t=1;
    //cin>>t;
    while(t--)
    {
        ll N;
        cin>>N;
        ll ans=0;
        for(ll i=1;i<=N;i++){
            ans+=(N-1)/i;
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 3608
N = int(input())
A = [int(input()) for _ in range(5)]
a = min(A)
n = N//a
k = N%a
ans = 0
if n>0:
    ans = 5+(n-1)
    if k>0:
        ans += 1
else:
    if k>0:
        ans = 5
print(ans)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)

char in[5];
int inf = 1e9;

bool q(ll n){
	printf("? %lld\n", n);
	fflush(stdout);
	scanf("%s", in);
	return in[0] == 'Y';
}

inline string S(ll x){
	string s;
	while (x)s += x % 10 + '0', x /= 10;
	reverse(s.begin(), s.end());
	return s;
}

int N;
string SS;
/*bool q(ll n){
	string s = S(n);
	printf("? %lld\n", n);
	return n <= N && s <= SS || n > N && s > SS;
}*/

void win(int an){
	printf("! %d\n", an);
	fflush(stdout);
	exit(0);
}

inline int dc(ll x){
	int an = 0;
	while (x)++an, x /= 10;
	return an;
}

inline ll fl(ll x){
	int d = dc(x);
	f(i, d, 15)x *= 10;
	return x;
}

inline ll one(int x){
	ll an = 1;
	f(i, 0, x)an *= 10;
	return an;
}

int bs(ll x, bool z){
	int l = 1, r = 9;
	if (z)l = 0;
	while (r > l){
		int m = l + r + 1 >> 1;
		ll t = x * 10 + m;
		if (q(t))l = m;
		else r = m - 1;
	}
	if (l < 9)return l;
	ll t = x * 10 + 9;
	ll tt = fl(t);
	if (q(tt)){
		int l = 0, r = 9;
		if (!z)l = 1;
		ll tttt = one(dc(x) + 1);
		if (q(tttt))return 9;
		while (r > l){
			int m = l + r + 1 >> 1;
			ll ttt = x * 10 + m;
			if (q(ttt * 10 - 1))r = m - 1;
			else l = m;
		}
		win(x * 10 + l);
	}
	t = t * 10 - 1;
	if (q(t))return 9;
	win(x * 10 + 9);
	return 0;
}

int main(){
	/*scanf("%d", &N);
	SS = S(N);*/
	
	ll an = 0;
	if (q(inf)){
		int l = 0, r = 9;
		while (r > l){
			int m = l + r >> 1;
			if (q(one(m) << 1))r = m;
			else l = m + 1;
		}
		win(one(l));
	}
	while (true)an = an * 10 + bs(an, an);
}

Measured memory_bytes: 680
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#include<bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned long long
#define repi(i,a) for(auto i = a.begin(); i!= a.end() ;++i) 
#define repdi(i,a) for(auto i = a.begin(); i!=a.end();++i) 
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define MOD 1000000007
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0); 
#define nl "\n"
#define INF 1e18
#define sz(a) (ll)a.size() 
#define all(a) a.begin(),a.end()
#define M 998244353
#define limit 100000000

typedef vector<ll> vll;
typedef pair<ll,ll> pii;
typedef vector<pii> vpi;
typedef vector<vector<ll> > vv;

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

const int block = 700 ;

bool cmp(tuple<int,int,int>& x,tuple<int,int,int>& y) {
	if (get<0>(x)/block != get<0>(y)/block) 
        return get<0>(x)/block < get<0>(y)/block; 
  
    return get<1>(x) < get<1>(y);
}

void solve() {
	
	double r; cin >> r;

	cout << fixed << setprecision(12) << (double) 2.0 * 3.14 * r ;
}


int main() {
 
    
    fast;
	int t=1;
	// cin>>t;
	rep(i,0,t) {
		solve() ;
	}
	return 0;
}

Measured memory_bytes: 3804
def main():
    D = int(input())
    C = [0] * 26
    C = list(map(int,input().split()))
    S = [ list(map(int,input().split(" "))) for i in range(D)]
    
    last = [0] * 26
    for i in range(D):
        max = -9999999999999
        max_t = 0
        for t in range(26):
            score = 0
            for j in range(26):
                if j == t:
                    #last[j] = 0
                    score += S[i][j]
                else:
                    #last[j] += 1
                    score -= (last[j]+10)*C[j]
            if  score > max:
                max = score
                max_t = t
        for j in range(26):
            if j == max_t:
                last[j] = 0
            else:
                last[j] += 1
        print(max_t + 1)
if __name__ == '__main__':
    main()

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

int main(){
  int H,W;
  cin >> H >> W;
  vector<vector<char>> vec(H,vector<char>(W));
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W;j++){
      cin >> vec.at(i).at(j);
    }
  }
  //行の調査
  vector<int> hVec(H);
  for(int i = 0; i < H; i++){
    int c = 0;
    for(int j = 0; j < W;j++){
      if(vec.at(i).at(j) == '.'){
        c++;
      } 
    }
    if(c == W){
      hVec.at(i) = 1;
    }
  }
  //列の調査
  vector<int> wVec(W);
  for(int i = 0; i < W; i++){
    int c = 0;
    for(int j = 0; j < H;j++){
      if(vec.at(j).at(i) == '.'){
        c++;
      } 
    }
    if(c == H){
      wVec.at(i) = 1;
    }
  }
  for(int i = 0; i < H; i++){
    if(hVec.at(i) == 1){
      continue;
    }
    for(int j = 0; j < W;j++){
      if(wVec.at(j) == 1){
        continue;
      }
      cout << vec.at(i).at(j);
    }
    cout << endl;
  }
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y) {
  ll tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}

ll calcgcd(ll x,ll y){
  if(x == 0){
    return y;
  }
  return calcgcd(y%x,x);
}

ll gcd(ll x,ll y){
  if(x <= y){
    return calcgcd(x,y);
  }else{
    return calcgcd(y,x);
  }
}

int main(){
  ll k;
  cin >> k;
  vector<vector<ll>> vec(k+1,vector<ll>(k+1,0));
  rep(i,k){
    rep(j,k){
      vec[i+1][j+1] = gcd(i+1,j+1);
    }
  }
  ll sum = 0;
  rep(i,k){
    rep(j,k){
      rep(l,k){
        ll t1 = i+1;
        ll t2 = j+1;
        ll t3 = l+1;
        sum += vec[t1][vec[t2][t3]];
      }
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3956
#abc121c

n,m=map(int,raw_input().split())
l=[]
for i in xrange(n):
 l.append(map(int,raw_input().split()))
l.sort()
b=0
s=0
for i in xrange(n):
 b+=l[i][1]
 s+=l[i][0]*l[i][1]
 if b>m:
  s-=l[i][0]*l[i][1]
  s+=l[i][0]*(l[i][1]-b+m)
  break
print s


Measured memory_bytes: 18876
n, m, r = map(int,input().split())
r_list = list(map(lambda x:int(x)-1,input().split()))
INF = float('inf')
edge = []
for _ in range(m):
    a,b,c = map(int,input().split())
    edge.append([a-1,b-1,c])
def warshall_floyd(n,edge):
    graph = [[INF]*n for _ in range(n)]
    for i in range(n):
        graph[i][i] = 0
    for a, b, c in edge:
        graph[a][b] = c
        graph[b][a] = c
    for k in range(n):
        for i in range(n):
            for j in range(n):
                if graph[i][k] + graph[k][j] < graph[i][j] :
                    graph[i][j] = graph[i][k] + graph[k][j]
    return graph
g = warshall_floyd(n,edge)
from itertools import permutations
ans = INF
for arr in permutations(range(r)):
    tmp = 0
    for a,b in zip(arr,arr[1:]):
        t1,t2 = r_list[a],r_list[b]
        tmp += g[t1][t2]
    ans = min(ans,tmp)
print(ans)

Measured memory_bytes: 7248
n = int(input())
s=input()
if ('.' not in s) or ('#' not in s):
    print(0)
else:
    bc = [0 for i in range(n)]
    wc = [0 for i in range(n)]
    for i in range(n):
        if s[i] == '#':
            bc[i] =1
        else:
            wc[i] = 1
    for i in range(n-1):
        bc[i+1] += bc[i]
    for i in range(n-1,0,-1):
        wc[i-1] += wc[i]
    ans = min(wc[0],bc[-1])
    for i in range(n-1):
        ans = min(ans,bc[i]+wc[i+1])
    print(ans)

Measured memory_bytes: 19304
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) std::memset(arg,n,sizeof(arg))
#define mp(a,b) std::make_pair(a,b)
using std::cin;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
typedef std::string str;
const int INF=1e+9;
const ll INFLL=1e+17;
const ll MOD=1e+9+7;
int N;
ll a[60];
void solve(){
  //絶対値最大を探す
  int j,max=0;
  rep(i,N){
    if(max<=std::abs(a[i])){
      j=i;
      max=std::abs(a[i]);
    }
  }
  prin(2*N-1);
  //絶対値最大を全ての要素に足す
  rep(i,N){
    a[i]+=a[j];
    prin2(j+1,i+1);
  }
  //a[j]の符号によって処理が分かれる
  if(a[j]>=0){
    //a[i]にa[i-1]を足す(i=1から)
    rep1(i,N-1){
      a[i]+=a[i-1];
      prin2(i,i+1);
    }
  }
  else{
    //a[i-1]にa[i]を足す(i=N-1から)
    for(int i=N-1;i>0;i--){
      a[i-1]+=a[i];
      prin2(i+1,i);
    }
  }
  /* rep(i,N){
    std::cout<<a[i]<<" ";
  }
  std::cout<<"\n";*/
}
int main(){
  cin>>N;
  rep(i,N) cin>>a[i];
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn = 100005;
const int INF = 1000000000;

int A[maxn];//石头高度
int dp[maxn] = {0}; 
int n;

int main(){
//	freopen("4.txt","r",stdin);
	scanf("%d",&n);
	fill(dp,dp+maxn,INF);
	
	for(int i=1;i<=n;i++){
		scanf("%d\n",&A[i]);
	}
	dp[1] = 0;
	for(int i=2;i<=n;i++){//跳到i上 
		int j1 = i-2, j2 = i-1;
		if(j1>=1){//
			dp[i] = min(dp[i] , dp[j1] + abs(A[i]-A[j1]));
		}
		if(j2>=1){//
			dp[i] = min(dp[i] , dp[j2] + abs(A[i]-A[j2]));
		}
	}
	printf("%d\n", dp[n]);
	
	return 0;
} 

Measured memory_bytes: 896
(defun splitat (c line)
  (labels ((rec (line acc)
				(let ((pos (position-if (lambda(cc) (char= c cc)) line)))
				  (if pos
					  (rec (subseq line (1+ pos)) (cons (subseq line 0 pos) acc))
					(nreverse (cons line acc))))))
	(rec line nil)))
(defun lessp(a b)
  (labels ((rec(a b)
             (if (null a)
               nil
               (if (< (car a) (car b))
                 t
                 (if (= (car a) (car b))
                   (rec (cdr a) (cdr b))
                   nil)))))
    (rec a b)))
(defun flatten1(lst)
  (nreverse (reduce (lambda (acc a)
					  (reduce (lambda (acc a)
								(cons a acc))
							  a :initial-value acc))
					lst :initial-value nil)))
(defun permutations(lst)
  (labels ((skip(i n lst acc)
			 (cond ((null lst) acc)
				   ((= i n) (skip (1+ i) n (cdr lst) acc))
				   (t (skip (1+ i) n (cdr lst) (cons (car lst) acc)))))
		   (rec (lst acc acc0)
				(if (null lst)
				  (cons acc acc0)
				  (flatten1 (mapcar (lambda(i) (rec (nreverse (skip 0 i lst nil)) (cons (nth i lst) acc) acc0)) (loop for i from 0 to (1- (length lst)) collect i)))
				  ))
				)
	(rec lst nil nil)))
(defun equallst(a b)
  (labels ((rec(a b)
             (if (null a)
               t
               (if (= (car a) (car b))
                 (rec (cdr a) (cdr b))
                 nil))))
    (rec a b)))
(defun searcher (hystack needle)
  (labels ((rec(hystack i)
             (if (null hystack)
               -1
               (if (equallst (car hystack) needle)
                 i
                 (rec (cdr hystack) (1+ i))))))
    (rec hystack 0)))
(defun f(n p q)
  (let* ((pq (sort (permutations (loop for i from 1 to n collect i)) #'lessp))
         (pn (searcher pq p))
         (qn (searcher pq q)))
    (abs (- pn qn))))

(compile 'lessp)
(compile 'equallst)
(compile 'searcher)
(compile 'f)
(let* ((n (parse-integer (read-line nil nil)))
       (p (mapcar #'parse-integer (splitat #\space (read-line nil nil))))
       (q (mapcar #'parse-integer (splitat #\space (read-line nil nil)))))
  (format t "~A~%" (f n p q)))


Measured memory_bytes: 22884
from collections import deque
n,m = map(int,input().split())
g = [[] for i in range(n)]
for i in range(m):
    x,y = map(int,input().split())
    g[x-1].append(y-1)
    g[y-1].append(x-1)
a = [-1]*n
d = deque([0])
while d:
    f = d.popleft()
    for o in g[f]:
        if a[o] == -1:
            a[o] = f
            d.append(o)
print("Yes")
for i in a[1:]:print(i+1)

Measured memory_bytes: 94924
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;

bool is753num(int x){
  int y;
  int flag7 = 0;
  int flag5 = 0;
  int flag3 = 0;
  
  while(x!=0){
  	y = x%10;
  	// is753(y)
  	if(y != 7 && y != 5 && y != 3){
  		return false;
  	}
    else if(y == 7){
    	flag7 = 1;
    }    
    else if(y == 5){
    	flag5 = 1;
    }
    else if(y == 3){
    	flag3 = 1;
    }
  	x = (x-y)/10;
  }
  if(flag7 * flag5 * flag3 == 1){
  	return true;
  }
  else{return false;}
}


void Main()
{
  int N;
  cin >> N;
  int count;

  auto g = [&](int d){
	int ans;
    if(d<3){ans = 0;}
	else{ans = pow(3,d)-3*pow(2,d)+3;}
    return ans;
  };
  
  //                         d = 3,  4,   5,   6,    7,    8,     9, ...
  // f(d) = 10^d 以下の七五三数 = 6, 42, 192, 732, 2538, 8334, 26484, ...
  auto f = [&](int d){
	int ans = 0;
    if(d<3){;}
    else{
      	// f(3)+...+f(d);
      	rep3(i,3,d){ans+=g(i);}
    }
    return ans;
  };
   
  int d = floor(log10(N))+1;
  count = f(d-1);
  
  int tend = pow(10,d-1);

  rep3(i, 3*tend, 4*tend){
	if(i>N){break;}
   	else if(is753num(i)){
   			count++;
    }
  }
  
  rep3(i, 5*tend, 6*tend){
	if(i>N){break;}
    else if(is753num(i)){
   			count++;	
  	}
  }
  
  rep3(i, 7*tend, 8*tend){
	if(i>N){break;}
    else if(is753num(i)){
   		count++;
    }
  }
  
  cout << count << endl;
  return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
typedef pair<int,int> Pi;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
const int inf = 1001001001;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
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;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m=numeric_limits<T>::max()){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }

template<class T> struct edge { int to; T cost;};


int main() {
  int n; cin >>n;
  int lb = 0;
  int ra = 0;
  int lbra = 0;
  int res = 0;
  rep(i, n){
    string s; cin >>s;
    if (s[0] == 'B' && s[s.size()-1] == 'A') lbra++;
    else if (s[0] == 'B') lb++;
    else if (s[s.size()-1] == 'A') ra++;
    rep(j, s.size()-1) if (s[j] == 'A' && s[j+1] == 'B') res++;
  }
  if (lbra > 0){
    res += lbra - 1;
    if (ra > 0){
      res++;
    }else if (lb > 0){
      res++;
    }
  }
  res += min(ra, lb);
  cout <<res <<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cctype>
using namespace std;
inline int read(int f = 1, int x = 0, char ch = ' ')
{
    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;
    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();
    return f*x;
}
const int N = 2e3+5;
int n, m, q;
char s[N][N];
int f[N][N], g[N][N], h[N][N];
void add(int (*s)[N], int x, int y, int d) { s[x][y] = s[x][y-1]+s[x-1][y]-s[x-1][y-1]+d; }
int ask(int (*s)[N], int x1, int y1, int x2, int y2) { return s[x2][y2]+s[x1-1][y1-1]-s[x1-1][y2]-s[x2][y1-1]; }
int main()
{
    n = read(), m = read(), q = read();
    for(int i = 1; i <= n; ++i) scanf("%s", s[i]+1);
    for(int i = 1; i <= n; ++i)
        for(int j = 1; j <= m; ++j)
            add(f, i, j, s[i][j] == '1'),
            add(g, i, j, s[i][j] == '1'&&s[i-1][j] == '1'),
            add(h, i, j, s[i][j] == '1'&&s[i][j-1] == '1');
    while(q--)
    {
        int x1 = read(), y1 = read(), x2 = read(), y2 = read();
        printf("%d\n", ask(f, x1, y1, x2, y2)-ask(g, x1+1, y1, x2, y2)-ask(h, x1, y1+1, x2, y2));
    }
    return 0;
}

Measured memory_bytes: 52736
import java.util.*;

public class Main {
    int MAX = 100000;
    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), C = sc.nextInt();
        int[][] m = new int[MAX + 5][C];

        for (int i = 0; i < n; i++) {
            int s = sc.nextInt(), t = sc.nextInt(), c = sc.nextInt() - 1;

            m[s - 1][c] += 1;
            m[t][c] += -1;
        }

        for (int i = 1; i <= MAX; i++) {
            for (int c = 0; c < C; c++) {
                m[i][c] += m[i - 1][c];
            }
        }
        int max = 0;
        for (int i = 0; i <= MAX; i++) {
            int cnt = 0;
            for (int c = 0; c < C; c++) {
                if (m[i][c] > 0)cnt++;
            }
            max = Math.max(cnt, max);
        }
        for (int[] a: m) debug(a);
        System.out.println(max);
    }

    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }

}


Measured memory_bytes: 169768
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include "math.h"

using namespace std;

int main() {
    
    vector<int> dig(4, 0);
    int a, b;
    
    for (int i = 0; i<3; i++) {
        cin >> a >> b;
        dig[a-1] += 1;
        dig[b-1] += 1;
    }
    
    int count = 0;
    
    for (int i = 0; i<4; i++) {
        if (dig[i] % 2 == 1) {
            count += 1;
        }
    }
    
    if (count == 2) {
        cout << "YES" <<endl;
    } else {
        cout << "NO" <<endl;
    }

    return 0;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    string s;
    cin>>s;
    rep(0,i,s.length()){
        cout<<"x";
    }
    cout<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	char s[11];
	int i = 0, cnt = 0, max = 0;
	
	scanf("%s", s);
	
	while (s[i]) {
		if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
			cnt++;
			if (cnt > max)
				max = cnt;
		} else
			cnt = 0;
		i++;
	}
	
	printf("%d", max);
		
	return 0;
}


Measured memory_bytes: 128
n=int(input())
a=list(map(int,input().split()))
m=max(a)
dp=[0 for i in range(m+1)]
ans=0
for i in range(n):
    if dp[a[i]]>=1:
        dp[a[i]]+=1
        continue
    for j in range(2*a[i],m+1,a[i]):
        dp[j]+=1 
    dp[a[i]]=1
for i in range(n):
    if dp[a[i]]==1:
        ans+=1 
print(ans)
    

Measured memory_bytes: 32236
def chmin(a, b):
  if (a > b):
    return b

  return a

def chmax(a, b):
  if (a < b):
    return b

  return a

H, N = map(int, input().split())
li = [list(map(int, input().split())) for i in range(N)]

dp = [[10**9] * (H+1) for i in range(N+1)]
dp[0][0] = 0

for n in range(N):
  for h in range(0, H+1):
    dp[n+1][h] = chmin(dp[n+1][h], dp[n][h])
    dp[n+1][min(h+li[n][0], H)] = chmin(dp[n+1][min(h+li[n][0], H)], dp[n+1][h]+li[n][1])

print(dp[N][H])

Measured memory_bytes: 121180
#include <iostream>
using namespace std;
 
int main() {
	// your code goes here
	long long int a,b,c,i,j,s=0;
	cin >> a;
	cin >> b >> c;
	for(i=b;i<=c;i++)
	{
		if(i%a==0)
		{
			s=1;
			break;
		}
	}
	if(s==1)
	{
		cout << "OK" << endl;
	}
	else{
		cout << "NG" << endl;
	}
	return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <map>
#include <cstdint>

using namespace std;

int main()
{
    uint64_t r, D, x;
    cin >> r >> D >> x;
    for(int i = 2000; i < 2010; ++i){
        x = r * x - D;
        cout << x << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
//DEFINE and TYPEDEF--------------------------------------------------------------
 
#define FORG(i,a,n) for(lld i=a;i<n;i++) //for - general
#define FORZ(i,n) for(lld i=0;i<n;i++) //for - zero
#define FORGI(i,a,n,inc) for(lld i=a;i<n;i+=inc) //for - general incremental
#define FORZI(i,n,inc) for(lld i=0;i<n;i+=inc) //for - zero incremental
#define DEBUG(x) cerr<<(#x)<<" is "<<(x)<<"\n" //to debug values of variables
#define ZINDA cerr<<"\nIdhar-ich hai apun!!\n"; //to debug if code reached that point
#define SPEEDUP ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
 
#define SORTall(m) sort(m.begin(),m.end());
 
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define endl '\n'
#define mod 1000000007
 
typedef long long int lld;
typedef unsigned long long int ulld;
 
lld power(lld b, lld e)
{
    if(e==0)
        return 1;
    if(e%2==1)
        return b*power(b*b,(e-1)/2);
    else
        return power(b*b,e/2);
}
 
lld power(lld b, lld e, lld m)
{
	if(e==0)
		return 1;
	if(e%2==1)
		return b*power(((b%m)*(b%m))%m,(e-1)/2,m)%m;
	else
		return power(((b%m)*(b%m))%m,e/2,m)%m;
}
 
int nDig(lld n)
{
	if(n==0)
		return 1;

    return floor(log10(n) + 1);
}

//endl : changed to '\n', to flush comment that definition
//--------------------------------------------------------------------------------

bool isPallindrome(string s)
{
	for(int i=0,j=s.length()-1;i<j;i++,j--)
	{
		if(s[i]!=s[j])
			return false;
	}
	return true;
}

void swagWaalaFunction()
{
	lld n;
	string s;
	cin>>s;

	n=s.length();
	string x1=s.substr(0,(n-1)/2), x2=s.substr((n+2)/2,n);
	//cerr<<x1<<" "<<x2;
	
	if(isPallindrome(s)==true)
	{
		if(isPallindrome(x1)==true && isPallindrome(x2)==true)
		{
			cout<<"Yes";
			return;
		}
	}
	cout<<"No";
	return;
}

int main()
{
    SPEEDUP;
 	lld t=1;
 	//cin>>t;

 	while(t--)
 		swagWaalaFunction();

 	return 0;
}

Measured memory_bytes: 256
import sys
z = []
x = list(map(int, input().split()))
s = [list(input()) for i in range(x[0])]
h = x[0]
w = x[1]
l = []
y = []
# 横
for i in range(0, h):
  for j in range(0, w):
    if s[i][j] == '#':
      y.append(s[i])
      break

t = []
# 縦
# 縦横逆にする
for j in range(0, len(y[0])):
  for i in range(0, len(y)):
    l.append(y[i][j])
  t.append(l)
  l = []

p = []
for i in range(0, len(t)):
  for j in range(0, len(t[i])):
    if t[i][j] == '#':
      p.append(t[i])
      break
u = []
for j in range(0, len(p[0])):
  for i in range(0, len(p)):
    l.append(p[i][j])
  u.append(l)
  l = []
for i in u:
  print(''.join(i))

Measured memory_bytes: 3444
from collections import Counter
N,M=map(int,input().split())
a=[0]*M
b=[0]*M
c=[]
for i in range(M):
  a[i],b[i]= map(int,input().split())
  c.append(a[i])
  c.append(b[i])
  
d=dict(Counter(c))
ans="YES"
for e in d:
  if d[e]%2==1:
    ans="NO"
print(ans)

Measured memory_bytes: 22140
import java.util.*;

class Main {
    private static Scanner sc;

    public static void main(final String[] args) {
        sc = new Scanner(System.in);
        long a = sc.nextLong(),b = sc.nextLong(),c = sc.nextLong(),k = sc.nextLong(),ans;
        if(k <= a) ans = k;
        else if(k > a && k-a <= b) ans = a;
        else ans = a - (k-a-b);
        System.out.println(ans);
    }
}








Measured memory_bytes: 35768
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    C = read().split()
    for i in range(3):
        if C[0][i] != C[1][2-i]:
            print('NO')
            break
    else:
        print('YES')


if __name__ == '__main__':
    main()


Measured memory_bytes: 9100
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int n, d;
			
			n = sc.nextInt();
			d = sc.nextInt();
			
			double[][] points = new double[n][d];
			
			int counter = 0;
			
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < d; j++) {
					points[i][j] = sc.nextInt();
					
				}
			}
			
			for (int i = 0; i < n - 1; i++) {
				for (int j = i+1; j < n; j++) {
					
					double total = 0;
					for (int k = 0; k < d; k++) {
						double tmpTotal = Math.abs(points[i][k] - points[j][k]);
						total += Math.pow(tmpTotal, 2);
					}
					total = Math.sqrt(total);

					int tmpTotal = (int) total;
					
					
					if (total == (double)tmpTotal) {
						counter++;
					}
				}
			}
			
			System.out.println(counter);
			
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
}


Measured memory_bytes: 22868
import java.util.Arrays;
import java.util.Scanner;

public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;
	private int n;

	private void mainrun() {
		scan = new Scanner(System.in);

		n = Integer.parseInt(scan.nextLine());

		for(int i = 0;i < n;i++) {
			looprun();
		}

		scan.close();
	}

	private char[] rstr,astr,transb = "Hoshino".toCharArray(),transa = "Hoshina".toCharArray();

	private void looprun() {
		rstr = scan.nextLine().toCharArray();

		astr = new char[rstr.length + 1];

		for(int i = 0;i < rstr.length;i++) {
			if(rstr[i] == 'H' && (rstr.length - i >= 7)) {
				for(int j = 1;j < 7;j++) {
					if(rstr[j + i] != transb[j]) {
						astr[i] = rstr[i];
						break;
					}
					if(j == 6) {
						for(int k = 0; k < 7;k++) {
							astr[i + k] = transa[k];
						}
						i += 6;
					}
				}
			}else {
				astr[i] = rstr[i];
			}
		}
		astr[rstr.length] = '\n';

		Arrays.asList(astr).forEach(System.out::print);

	}
}


Measured memory_bytes: 31808
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

struct WordCount{
  string word;
  int count;
};

void PushWordCount(const vector<string>, vector<WordCount>&);
vector<string> split(string);
bool space(char);
bool not_space(char);

int main(){
  int max=0, longest=0;
  string s, Max, Longest;
  vector<string> str;
  vector<WordCount> data;

  getline(cin, s);
  str = split(s);
  PushWordCount(str, data);

  for(vector<WordCount>::size_type i=0; i != data.size(); ++i){
    if(data[i].count > max){
      max = data[i].count;
      Max = data[i].word;
    }
    if(data[i].word.size() > longest){
      longest = data[i].word.size();
      Longest = data[i].word;
    }
  }

  cout << Max << " " << Longest << endl;
  return 0;
}

void PushWordCount(const vector<string> s, vector<WordCount>& words){
  int isFound;
  WordCount NewWord;
  vector<WordCount>::iterator iter;

  for(string::size_type i=0; i != s.size(); ++i){
    isFound = 0;
    iter = words.begin();
    while(iter != words.end()){
      if(iter->word == s[i]){
        ++iter->count;
        break;
      }
      ++iter;
    }
    if(isFound == 0){
      NewWord.word = s[i];
      NewWord.count = 1;
      words.push_back(NewWord);
    }
  }
}

vector<string> split(string str){
  string _str;
  vector<string> Str;
  string::iterator i, j;

  j = str.begin();
  while(i < str.end() || j < str.end()){
    i = find_if(j, str.end(), not_space);
    j = find_if(i, str.end(), space);
    copy(i, j, back_inserter(_str));
    Str.push_back(_str);
    _str.clear();
  }
  return Str;
}

bool space(char c){
  return (isspace(c));
}

bool not_space(char c){
  return (!isspace(c));
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, a, b;
	cin>>n;
	cin>>a>>b;
	vector<int> vec(n, 0);
	int first, second, third;
	first = second = third;								
	for(int i = 0; i < n; ++i){
		cin>>vec[i];
		if(vec[i] <= a)first++;
		if(vec[i] > a && vec[i] <= b)second++;
		if(vec[i] > b)third++;
	}
	cout<<min(first, min(second, third))<<endl;	
	return 0;
}


Measured memory_bytes: 256