akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("O3")
#pragma GCC target("avx512f")
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

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

  int N;
  int a[200000], b[200000];
  cin >> N;
  rep(i, N) cin >> a[i];
  rep(i, N) cin >> b[i];
  int ans = 0;
  rep(i, N) rep(j, N) ans ^= a[i] + b[j];
  cout << ans << endl;
}

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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

template<typename T1,typename T2> using P = pair< T1, T2 >;
using Pii = P<int,int>;

int main(){
    Vi abcde(5);
    REP(i,5) cin>>abcde[i];

    V<Pii> abcde_10;
    REP(i,5){
        if(abcde[i]%10==0) abcde_10.pb(mp(0,abcde[i]));
        else abcde_10.pb(mp(10-abcde[i]%10,abcde[i] + (10-abcde[i]%10)));
    }

    sort(ALL(abcde_10));

    int time = 0;
    REP(i,5){
        if(i!=4) time += abcde_10[i].se;
        else time += abcde_10[i].se-abcde_10[i].fi;
    }

    cout<<time<<endl;

    return 0;
}

Measured memory_bytes: 256
import math

x, y = 0, 0
angle = 90

while True:
  line = map(int, raw_input().split(','))
  if line[0] == 0 and line[1] == 0: break
  radian = math.radians(angle)
  x += math.cos(radian) * line[0]
  y += math.sin(radian) * line[0]
  angle -= line[1]

print(int(x))
print(int(y))

Measured memory_bytes: 4420
#include<bits/stdc++.h>
using namespace std;
long long read()
{
	char ch=getchar();long long x=0,ff=1;
	while(ch<'0'||ch>'9') {if(ch=='-') ff=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x*ff;
}
void write(long long aa)
{
	if(aa<0) putchar('-'),aa=-aa;
	if(aa>9) write(aa/10);
	putchar('0'+aa%10);
	return;
}
long long n,X,sum,ans;
long long b[100005],l[100005],r[100005],id[100005];
long long vis[100005];
long long F(long long aa)
{
	return (X-b[aa])*r[aa]+b[aa]*l[aa];
}
bool cmp(long long aa,long long bb)
{
	return F(aa)>F(bb);
}
int main()
{
	n=read(),X=read();
	for(long long i=1;i<=n;++i) b[i]=read(),l[i]=read(),r[i]=read(),id[i]=i,sum+=l[i]*b[i];
	if(sum==0) {puts("0");return 0;}
	sort(id+1,id+n+1,cmp);
	for(long long i=1;i<=n;++i)
	{
		if(sum>=F(id[i])) sum-=F(id[i]),ans+=X;
		else
		{
			sum-=F(id[i]);
			long long mx=X;
			for(long long j=1;j<=n;++j)
			{
				long long tmp=0;
				if(vis[j]) sum+=F(j);
				else sum+=F(id[i]);
				if(sum<=b[j]*l[j]) tmp=(sum-1)/l[j]+1;
				else sum-=b[j]*l[j],tmp=b[j]+(sum-1)/r[j]+1,sum+=b[j]*l[j];
				if(vis[j]) sum-=F(j);
				else sum-=F(id[i]);
				mx=min(tmp,mx);
			}
			ans+=mx;
			sum=0;
		}
		if(!sum) break;
		vis[id[i]]=1;
	}
	write(ans);
	return 0;
}

Measured memory_bytes: 4096
#include<bits/stdc++.h>
using namespace std; 
long long a,b,n,c,d,e,x;
int main(){
    cin>>n>>a>>b>>c>>d>>e;
    x=min(a,b);
    x=min(x,c);
    x=min(x,d);
    x=min(x,e);
    cout<<(n+x-1)/x+4; 
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
typedef long long LL;

int int_vector_find(std::vector<int> vec,int num) {
	auto itr = std::find(vec.begin(), vec.end(), num);
	int index = std::distance(vec.begin(), itr);

	if (index != vec.size()) {
		return 1;
	}
	else {
		return 0;
	}
}

int main() {
	int n, t;
	double a;
	double temp = 100000000;
	int hoge = 0;
	std::cin >> n >> t >> a;

	std::vector<int>arr;

	for (int i = 0; i < n; ++i) {
		int x;
		std::cin >> x;
		arr.push_back(x);
	}

	for (int i = 0; i < n; ++i) {
		if (temp > std::abs(a - (t - (arr[i] * 0.006)))) {
			temp = std::abs(a - (t - (arr[i] * 0.006)));
			hoge = i + 1;
		}
	}

	std::cout << hoge << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long int
 
#define REP(i, n) for(int i = 0; i < (n); i++)
#define SREP(i, s) for(int i = 0; i < (s.size()); i++)
#define SORT(v, n) sort(v, v+n);
#define GSORT(v, n) sort(v, v+n, greater<int>());
#define VSORT(v) sort(v.begin(),v.end());
#define VGSORT(v) sort(v.begin(),v.end(),greater<int>());
#define REV(a) reverse(begin(a),end(a));

int main(){
	ios::sync_with_stdio(false);cin.tie(0);
////////////////////////////////////////////	
	int n[3];
	string s[3];
	REP(i,3){
		cin >> s[i];
		n[i]=s[i].size();
	}
	int turn=0;
	int ans=0;
	while(1){
		n[turn]--;
		ans=turn;
		if(n[turn]<0){
			if(turn==0) cout << 'A' << endl;
			else if(turn==1) cout << 'B' << endl;
			else if(turn==2) cout << 'C' << endl;
			break;
		}
		if(s[turn][0]=='a') turn=0;
		else if(s[turn][0]=='b') turn=1;
		else if(s[turn][0]=='c') turn=2;
		REP(i,s[ans].size()-1) s[ans][i]=s[ans][i+1];
		//cout << turn << s[turn] << endl;
	}
//////////////////////////////////////////////
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    int a, b, c;
    cin >> a >> b >> c;

    if (a == b) {
        cout << c << endl;
    } else if (b == c) {
        cout << a << endl;
    } else if (c == a) {
        cout << b << endl;
    }
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()

using ll = long long;
using P = pair<int,int>;

const int MOD = 1e9 + 7;
const int INF = 1001001001;



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

    int a, b, h, m;
    cin >> a >> b >> h >> m;

    double rad = 2 * M_PI * (h / 12.0 + m / 60.0 / 12.0 - m / 60.0); 
    double ans = (a * a) + (b * b) - 2 * a * b * cos(rad);

    cout << fixed << setprecision(12);
    cout << sqrt(ans) << "\n";

    return 0;
}


Measured memory_bytes: 4244
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;

#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

typedef long long ll;

int main(){
    ll N, A, B;
    cin >> N >> A >> B;
    if(A>B || (N==1 && A!=B)){
        cout << 0 << endl;
    }
    else if(N==1 || A==B){
        cout << 1 << endl;
    }
    else{
        cout << (B-A)*(N-1)+A-B+1 << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>  // ver2.2.9
#define int long long
#define endl "\n"
#define ALL(v) (v).begin(),(v).end()
#define COUNT(a,k) upper_bound(ALL(a),k)-lower_bound(ALL(a),k)
#define BIGGER(a,k) a.end()-upper_bound(ALL(a),k)
#define SMALLER(a,k) lower_bound(ALL(a),k)-a.begin()
#define Vi vector<int>
#define VVi vector<Vi>
#define Vs vector<string>
#define Pii pair<int,int>
#define VPii vector<Pii>
#define Tiii tuple<int,int,int>
#define PQi priority_queue<int>
#define PQir priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define itos to_string
#define stoi stoll
#define FI first
#define SE second
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define cyes cout<<"yes"<<endl
#define cno cout<<"no"<<endl
#define _ <<' '<<
#define sortr(v) sort(v,greater<>())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define repreq(i,a,b) for(int i=a;i>=b;i--)
#define leng(n) (int)(log10(n)+1)
#define dem(a,b) ((a+b-1)/(b))
#define Vin(a) rep(iI,0,a.size())cin>>a[iI]
#define Vout(a) rep(lZ,0,a.size()-1)cout<<a[lZ]<<' ';cout<<a.back()<<endl
#define VVout(a) rep(lY,0,a.size()){if(!a[lY].empty()){Vout(a[lY]);}else cout<<endl;}
#define VPout(a) rep(lX,0,a.size())cout<<a[lX].FI<<' '<<a[lX].SE<<endl
#define Verr(a) rep(iZ,0,a.size()-1)cerr<<a[iZ]<<' ';cerr<<a.back()<<endl
#define VVerr(a) rep(J,0,a.size()){if(!a[J].empty()){Verr(a[J]);}else cerr<<'.'<<endl;}
#define VPerr(a) rep(iX,0,a.size())cerr<<a[iX].FI<<' '<<a[iX].SE<<endl
#define INF 3000000000000000000  //  3.0*10^18(MAXの1/3くらい)
#define MAX LLONG_MAX
#define MOD 1000000007  //  10^9 + 7
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm
int mypow(int x, int n, int m){  //  累乗x^n(mod m)  O(log(n))
if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}
int scomb(int n, int r){  //  nCr (小さい場合)
int a=1;for(int i=n;i>n-r;--i){a=a*i;}for(int i=1;i<r+1;++i){a=a/i;}return a;}
int comb(int n, int r){  //  nCr (%MOD)
int a=1;for(int i=n;i>n-r;--i){a=a*i%MOD;}for(int i=1;
i<r+1;++i){a=a*mypow(i,MOD-2,MOD)%MOD;}return a%MOD;}
int stpow(int n){  //  階乗(%MOD)
if(n==0)return 1;int a=1;rep(i,1,n+1)a=a*i%MOD;return a;}
Vi stpowV(){Vi a(100001);  //  階乗配列(%MOD)
a[0]=1;repeq(i,1,100000)a[i]=a[i-1]*i%MOD;return a;}
void press(auto &v){v.erase(unique(ALL(v)),v.end());}  //  圧縮



signed main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(12);
  
  int n,k;
  cin >> n >> k;
  Vi w(n),v(n);
  
  rep(i,0,n) cin >> w[i] >> v[i];
  
  VVi dp(n+5,Vi(100010,INF));  //  dp[何個目まで][価値] = 重さ
  dp[0][0] = 0;
  
  rep(i,0,n){
    repeq(j,0,100010){
      
      if(j-v[i] >= 0){
        dp[i+1][j] = min(dp[i][j],dp[i][j-v[i]] + w[i]);
      }
      
      else dp[i+1][j] = dp[i][j];
    }
  }
  //VVerr(dp);
  int ans = 0;
  rep(i,0,100010){
    if(dp[n][i] <= k && dp[n][i] != 0) ans = i;
  }
  //cout << dp[n][100009] << endl;
  cout << ans << endl;
  return 0;
}

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


int main(){
    string s;
    cin>>s;
    int ans = 0;
    rep(i,s.length()/2){
        if(s[i]!=s[s.length()-i-1]){
            ans ++;
        }
    }
    cout << ans << endl;
    return 0;
}



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

using namespace std;
int N, M;
int t[100];
int sumt;
int ans[100];
typedef pair<int, int> P;
P k[100];
int main(){
	scanf("%d", &N);
	for (int i = 0; i < N; i++){
		scanf("%d", &(t[i]));
		sumt += t[i];
	}
	scanf("%d", &M);
	for (int i = 0; i < M; i++){
		scanf("%d %d", &(k[i].first), &(k[i].second));
	}
	for (int i = 0; i < M; i++){
		ans[i] =sumt - t[k[i].first - 1] + k[i].second;
	}
	for (int i = 0; i < M; i++){
		printf("%d\n", ans[i]);
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstring>

using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define RREP(i,n) for(int i = n - 1; i >= 0; i--)

#define ALL(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

#define UNIQUE(v) do{sort(v.begin(), v.end()); v.erase( unique(v.begin(), v.end()), v.end() );} while(0)


#define y0 y3487465
#define y1 y8687969

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

int N;
const int MAX_N = 100000;
int p[MAX_N];

int main(){
  cin >> N;
  REP(i, N) cin >> p[i];

  int i = 0;
  int ans = 0;
  while(i < N) {
    if(p[i] == i + 1) {
      ans ++;
      i++;
    }
    i++;
  }

  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
#define pb push_back
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x, y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb3(x, y, z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define all(x) x.begin(), x.end()
#define sz(a) int((a).size())
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;
template<class T, class U> inline void add_self(T &a, U b){a += b;if (a >= mod) a -= mod;if (a < 0) a += mod;}
template<class T, class U> inline void min_self(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void max_self(T &x, U y) { if (y > x) x = y; }

template <typename T>void print(T v, bool show_index = false){int w = 2;if(show_index){for(int i=0; i<v.size(); i++)cout<<setw(w)<<i<<" ";cout<<endl;}for(auto i= v.begin(); i!=v.end(); i++)cout<<setw(w)<<*i<<" ";cout<<endl;}
template <typename T>void print_vv(T v){if(v.size()==0) {cout<<"Empty"<<endl; return;} int w = 3;cout<<setw(w)<<" ";for(int j=0; j<v[0].size(); j++)cout<<setw(w)<<j<<" ";cout<<endl;for(auto i= 0; i<v.size(); i++){cout<<i<<" {";for(auto j = 0; j!=v[i].size(); j++){cout<<setw(w)<<v[i][j]<<",";}cout<<"},"<<endl;}cout<<endl;}
template <class T, class U> void print_m(map<T,U> m, int w=3){if(m.empty()){cout<<"Empty"<<endl; return;}for(auto x: m)cout<<"("<<x.first<<": "<<x.second<<"),"<<endl;cout<<endl;}

int main(){
    int n;
    while(cin>>n){
        set<string> ss;
        string s;
        forn(i,n){
            cin>>s;
            ss.insert(s);
        }
        int sz = ss.size();
        cout<<sz<<endl;
    }
    return 0;
}

Measured memory_bytes: 19252
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		BitSet sb = new BitSet();
		List<Integer> list = new ArrayList<Integer>();
		while (!("0 0".equals(line))) {
			int n = Integer.parseInt(line.substring(0, line.indexOf(' ')));
			int k = Integer.parseInt(line.substring(line.indexOf(' ') + 1));
			sb.clear();
			list.clear();
			for (int i = 0; i < k; i++) {
				sb.set(Integer.parseInt(br.readLine()));
			}
			int sizeMax = 0;
			if (!sb.get(1)) {
				list.add(0);
			}
			int start = sb.nextSetBit(1);
			while (start != -1) {
				final int end = sb.nextClearBit(start);
				list.add(Integer.valueOf(end - start));
				start = sb.nextSetBit(end);
				if (start - end != 1) {
					list.add(Integer.valueOf(0));
				}
			}
			if (sb.get(0)) {
				for (int i = 0; i < list.size() - 1; i++) {
					sizeMax = Math.max(sizeMax, list.get(i) + list.get(i + 1)
							+ 1);
				}
			} else {
				for (int i = 0; i < list.size(); i++) {
					sizeMax = Math.max(sizeMax, list.get(i));
				}
			}
			System.out.println(sizeMax);
			line = br.readLine();
		}
	}

}

Measured memory_bytes: 29476
# 高橋君のモンスターは体力が A で攻撃力が B です。
# 青木君のモンスターは体力が C で攻撃力が D です。
# 高橋君→青木君→高橋君→青木君→... の順に攻撃を行います。
# 先に自分のモンスターの体力が 0 以下になった方の負け、そうでない方の勝ちです。
# 高橋君が勝つなら Yes、負けるなら No を出力してください。

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

while True:
    C = C - B
    if C <= 0:
        print('Yes')
        break
    A = A - D
    if A <= 0:
        print('No')
        break


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

int main(){
  int N,M; cin >> N >> M;
  int A[100001],B[100001];
  for(int i=1;i<=M;i++){
    cin >> A[i];
    cin >> B[i]; 
  }
  sort(A+1,A+M+1);
  sort(B+1,B+M+1);
  int sum = B[1] - A[M] + 1;
  if(sum < 0){cout << 0 << endl;}
  else {cout << sum << endl;}
}
  


Measured memory_bytes: 1024
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

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

typedef long long ll;

const int Inf = 100100100;
const double EPS = 1e-9;

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

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int N, A, B, C;
vector<int> l;
int ans = Inf;

int rec(int i, int a, int b, int c) {
  if (i == N) {
    if (!a || !b || !c) return Inf;
    return abs(a - A) + abs(b - B) + abs(c - C);
  }
  int ans = rec(i + 1, a, b, c);
  ans = min(ans, rec(i + 1, a + l[i], b, c) + 10);
  ans = min(ans, rec(i + 1, a, b + l[i], c) + 10);
  ans = min(ans, rec(i + 1, a, b, c + l[i]) + 10);

  return ans;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> A >> B >> C;
    l.resize(N);
    rep(i, N) {
      cin >> l[i];
    }
    cout << rec(0, 0, 0, 0) - 30 << '\n';

    return 0;
}


Measured memory_bytes: 256
#include<map>
int64_t k,t=1,n,s,p;int S(int64_t x){return x?x%10+S(x/10):0;}int main(){scanf("%d",&k);while(printf("%ld\n",n+=t),--k)t+=t*9*(S(p=n+t+t)*(n+t)>S(n+t)*p);}

Measured memory_bytes: 128
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()
A=LIST()

tmp=0
for i in range(N):
    if i%2==0:
        tmp+=A[i]
    else:
        tmp-=A[i]

ans=[0]*N
ans[0]=tmp
for i in range(1, N):
    ans[i]=(A[i-1]-ans[i-1]//2)*2

print(*ans)


Measured memory_bytes: 14400
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}
struct multi {
  ll first;
  ll second;
  ll third;
  multi(ll first, ll second, ll third)
      : first(first), second(second), third(third) {}
};
bool multicomp(const multi &a, const multi &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll MODPOW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = MODPOW(n, m / 2);
    return (tmp * tmp) % MOD;
  } else {
    return (n * MODPOW(n, m - 1)) % MOD;
  }
}

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

ll MODDIV(ll a, ll b) { return a * MODPOW(b, MOD - 2) % MOD; }

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N;
  cin >> N;
  vl f(N + 1, 0);
  REP(i, N) f[i + 1] = (f[i] + MODDIV(1, i + 1)) % MOD;
  vl A(N, 0);
  vl B(N, 0);
  REP(i, N) cin >> A[i];
  REP(i, N) { B[i] = (MOD + f[i + 1] + f[N - i] - 1LL) % MOD; }
  ll ans = 0;
  REP(i, N) ans = (ans + ((A[i] * B[i]) % MOD)) % MOD;
  REP(i, N) ans = (ans * (i + 1)) % MOD;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 2560
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#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>
using namespace std;
int main()
{
    int x,a,b;
    cin>>x>>a>>b;
    cout<<(x-a)%b;
 system("pause");
 return 0;
}

Measured memory_bytes: 504
#include "bits/stdc++.h"
using namespace std;

// fundamental
using ll = long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define FOR(i,s,n) for (ll i = (s); i < (n); ++i)
#define ALL(c) (c).begin(), (c).end()
#define TEN(x) ((ll)1e##x)
#define MAXC(c,x) (c = max(c, x))
#define MINC(c,x) (c = min(c, x))
const ll mod = TEN(9) + 7;

// vector
using vl = vector<ll>; using vvl = vector<vl>; using vvvl = vector<vvl>;
template<class T, size_t N, class A = size_t> auto mdv(A size = 0) -> typename enable_if<N==1, vector<T>>::type { return vector<T>(size); }
template<class T, size_t N, class A = size_t> auto mdv(A size = 0) -> vector<decltype(mdv<T, N - 1>())> { return vector<decltype(mdv<T, N - 1>())>(size); }
template<class T, size_t N, class A, class... B> auto mdv(A size, B... rest) -> typename enable_if<N!=1, vector<decltype(mdv<T, N - 1>(rest...))>>::type { return vector<decltype(mdv<T, N - 1>(rest...))>(size, mdv<T, N - 1>(rest...)); }
template<class T, class... A> auto mdv(A... size) -> decltype(mdv<T, sizeof...(size), A...>(size...)) { return mdv<T, sizeof...(size), A...>(size...); }
// template<size_t N, class A, class... B> auto mdvl(A size, B... rest) -> decltype(mdv<N, ll, A, B...>(size, rest...)) { return mdv<N, ll, A, B...>(size, rest...); }

// template<class T, class A> auto mdv(A size) -> vector<T> { return vector<T>(size); }
// template<class T, class A, class... B> auto mdv(A size, B... rest) -> vector<decltype(mdv<T>(rest...))> { return vector<decltype(mdv<T>(rest...))>(size, mdv<T>(rest...)); }

// io
template<class T> istream& operator >>(istream& is, vector<T>& vec){ for(T& x: vec) is >> x; return is; }
template<class T, class U> istream& operator >>(istream& is, pair<T, U>& p){ is >> p.first >> p.second; return is; }
template<class T> void input(T& t) { cin >> t; assert(cin); } template<class T, class... Ts> void input(T& t, Ts&... ts) { cin >> t; input(ts...); }
template<class T> void print(T&& t) { cout << t; } template<class T, class... Ts> void print(T&& t, Ts&&... ts) { cout << t; print(ts...); }
template<class T> void println(T&& t) { cout << t << endl; } template<class T, class... Ts> void println(T&& t, Ts&&... ts) { cout << t; println(ts...); }
template<class T> string join(const vector<T>& v, const string & sep) { stringstream ss; REP(i, v.size()) ss << (i != 0 ? sep : "") << v[i]; return ss.str(); }

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(50);

    ll n, m; cin >> n >> m;
    vl x(m), y(m), z(m);
    REP(i, m) cin >> x[i] >> y[i] >> z[i];
    vvl path(n);
    REP(i, m) {
        x[i]--, y[i]--;
        path[x[i]].push_back(y[i]);
        path[y[i]].push_back(x[i]);
    }
	
    vl visited(n, 0);
    function<void(ll)> dfs = [&](ll cur) {
        visited[cur] = 1;
        for (ll next : path[cur]) if (!visited[next]) dfs(next);
    };

    ll cnt = 0;
    REP(i, n) if(!visited[i]) {
        cnt++;
        dfs(i);
    }
    cout << cnt << endl;
}


Measured memory_bytes: 13568
H, W = (list)(map(int, input().split()))
N = 10
mp = [[l for l in (list)(map(int, input().split()))] for _ in range(N)]

wall = [[l for l in (list)(map(int, input().split()))] for _ in range(H)]


def dijkstra(s, g):
    '''
        s:start node
        g:foal node
        return cost from s to g
    '''
    return 0


def war(mp):
    for i in range(N):
        for j in range(N):
            for k in range(N):
                mp[j][k] = min(mp[j][k], mp[j][i]+mp[i][k])
    return mp


mp = war(mp)
cost = 0
for l in wall:
    for i in l:
        if i == -1:
            continue
        else:
            cost += mp[i][1]
print(cost)


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n[4]= {0};
    char s[100050];
    scanf("%s",s);
    for(int i=0; i<strlen(s); i++)
    {
        if(s[i]=='a')
            n[1]++;
        else if(s[i]=='b')
            n[2]++;
        else if(s[i]=='c')
            n[3]++;
    }
    sort(n+1,n+3+1);
    if(strlen(s)==1)
    {
        printf("YES\n");
        return 0;
    }
    if(n[1]==0)
    {
        if(n[2]==1&&n[3]==1)
            printf("YES\n");
        else
            printf("NO\n");
    }
    else
    {
        if(n[2]+n[1]<n[3]-1)
        {
            printf("NO\n");
        }
        else
        {

            if(n[1]>=n[3]-1&&n[2]>=n[3]-1)
                printf("YES\n");
            else
                printf("NO\n");
        }
    }
    return 0;
}


Measured memory_bytes: 384
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <iomanip>
using namespace std;
const int N=210005;
char a[N];
int sum,z,s;
int main ()
{
	scanf("%s",&a);
	int len=strlen(a);
	for(int i=0;i<len;i++)
	    if(a[i]=='A'){
		    s=i;
		    break;
		}
	for(int i=len-1;i>0;i--) 
	    if(a[i]=='Z'){
		    z=i;
		    break;
		}
	printf("%d\n",z-s+1);
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int a[4];
int main()
{
    scanf("%d%d%d",&a[1],&a[2],&a[3]);
    sort(a+1,a+3+1);
    printf("%d\n",a[3]*10+a[2]+a[1]);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
	while (true)
	{
		int a, b;
		cin >> a >> b;

		if (a == 0 && b == 0)
		{
		break;
		}
		for (int i = 1; i <= a; i++)
		{
			for (int i = 2; i <= b; i++)
			{
				cout << "#";
			}
		cout << "#" << endl;
		}cout << endl;
	}
}

Measured memory_bytes: 1152
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <iomanip>       // fixed, setprecision
using namespace std;

int main()
{
  char s[3];
  int c = 0, m = 0;
  cin >> s;

  for (int i = 0; i < 3; i++)
  {
    if (s[i] == 'R')
    {
      c++;
      m = max(m, c);
    }
    else
    {
      c = 0;
    }
  }
  cout << m << endl;
}


Measured memory_bytes: 3148
#include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = a; i < b; ++i)
#define ll long long
#define M 100000007
#define fr first
#define sc second
#define endl "\n"
#define vc vector
#define pb push_back
#define pii pair<ll, ll>
#define psi pair<string, ll>
#define fast                                                                   \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define PI 3.14159265
#define r0 return 0
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define what_is(x) cerr << #x << " is " << x << endl;
using namespace std;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
const char char_max = (char)(((unsigned char) char(-1)) / 2);

int main() {
  fast
  ll n,r;
  cin>>n>>r;
  if(n>=10) cout<<r;
  else cout<<r+100*(10-n);
}



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

int main(){
	char* o;
	char* e;
	int i,j,k;

	o = (char*)calloc(51,sizeof(char));
	e = (char*)calloc(51,sizeof(char));

	scanf("%s",o);
	scanf("%s",e);

	j = 0;
	k = 0;
	for(i=0; i<strlen(o)+strlen(e); i++){
		if( i%2 == 0 ){
			printf("%c",o[j]);
			j++;
		}else{
			printf("%c",e[k]);
			k++;
		}
	}
	printf("\n");

	return 0;
}

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

using namespace std;

int main(void) {

	string S;
	cin >> S;

	if (S == "Sunny") { cout << "Cloudy" << endl; }
	else if (S == "Cloudy") { cout << "Rainy" << endl; }
	else { cout << "Sunny" << endl; }
	return 0;
}

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

int main() {
  int loopCount;
  int index;
  int startPos;
  int endPos;
  int sum;

  cin >> loopCount;

  sum = 0;
  for(index = 0; index < loopCount; index++)
  {
    cin >> startPos >> endPos;
    sum += (endPos - startPos + 1);
  }
  
  cout << sum << endl;
}



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

int main(){
  
  long long int k, n;
  cin >> k >> n;
  
  long long int A[n];
  for(long long int i = 0;i<n;i++){
    cin >>A[i];
  }
  
  long long int max_interval= 0;

  for(long long int i = 0;i<n-1;i++){
    if(A[i+1]- A[i] > max_interval){
      max_interval = A[i+1] - A[i];
    }
  }
  
  if(k- A[n-1] + A[0] > max_interval){
      max_interval = k - A[n-1]+ A[0];
    }

    cout << k- max_interval << endl;


  return 0;
}



Measured memory_bytes: 1792
while 1:
    n = int(input())
    if n == 0: break
    i = 0
    while True:
        if i == n: break
        m, e, j = map(int, input().split())
        sum = m + e + j
        if m==100 or e==100 or j==100:
            print("A")
        elif (m+e)/2 >= 90:
            print("A")
        elif sum/3 >= 80:
            print("A")
        elif sum/3 >= 70:
            print("B")
        elif sum/3 >= 50 and m >= 80 or e >= 80:
            print("B")
        else:
            print("C")
        i += 1
    


Measured memory_bytes: 5612
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N ; cin >>N ; //モチの枚数
  vector<int> x(N);
  for(int i=0;i<N;i++) cin>>x[i];
  int a,b,c,d,e;
  c=0;
  a=0;
  d=1;
  //xの中から最大のものを拾い
  while(d)
  {
    d=0;
    for(int i=0;i<N;i++)
    {
    if(x[i]>a){a=x[i];b=i;d=1;}
    
    }
    if(d==1)c++;
    for(int i=0;i<N;i++)
    {
    if(x[i]==a)x[i]=0;
    
    }
    a=0;
  }
  cout <<c <<endl;
}

Measured memory_bytes: 256
/* A - ABC Swap */

#include <stdio.h>

void Swap(int *a, int *b){
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
  // printf("%d %d\n", *a, *b);
}

int main(void){
  int X, Y, Z;
  scanf("%d %d %d", &X, &Y, &Z);
  Swap(&X, &Y);
  Swap(&X, &Z);
  printf("%d %d %d\n", X, Y, Z);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<l_l> vpl;
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=1;i<=(n);i++)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=10100100100100100;
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;
}
int main(){
    ll n,m;cin>>n>>m;
    ll l=1,r=n-1;
    vl v;
    while(l<r){
        if(l%2!=0)v.pb(l);
        else v.pb(r);
        l++;r--;
    }
    sort(v.begin(),v.end());
    vp ans(m);
    ll u=n/2;
    rep(i,m){
        ans[i]=P(u,u+v[i]);
        u--;
    }
    rep(i,m)cout<<ans[i].fi<<" "<<ans[i].se<<endl;
    return 0;
}

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

int main() {
    int n,sum=1,maxi;
    cin>>n;
    vector<int> h(n);
    rep(i,n) cin>>h[i];
    maxi=h[0];
    for (int i=1; i<n; i++) {
        if (maxi<=h[i]) {
            sum++;
            maxi=h[i];
        }
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 256
import java.util.Comparator;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeSet;

public class Main 
{
	static class C implements Comparator<Bridge>
	{

		@Override
		public int compare(Bridge arg0, Bridge arg1) 
		{
			int ans = arg0.v1 - arg1.v1;
			if(ans == 0)ans = arg0.v2 - arg1.v2;
			return ans;
		}
	}
	
	static class Bridge
	{
		int v1;
		int v2;
		
		public Bridge(int v1, int v2)
		{
			this.v1 = Math.min(v1, v2);
			this.v2 = Math.max(v1, v2);
		}
		
		public String toString()
		{
			return v1 + " " + v2;
		}
	}
	
	static class Vertex
	{
		TreeSet<Integer> adjlist = new TreeSet<Integer>();
		
		int dim()
		{
			return adjlist.size();
		}
		
		public Vertex()
		{
			
		}
		
		public Vertex(int adjacentTo)
		{
			adjlist.add(adjacentTo);
		}
	}
	
	static Scanner sc = new Scanner(System.in);
	static int vn, en;
	static Vertex[] v;
	static int[] low;
	static int[] disc;
	static int[] parent;
	static boolean[] visited;
	static TreeSet<Bridge> b;
	
	static void DFS()
	{
		int time = 0;
		int pos = 0;
		Stack<Integer> queue = new Stack<Integer>();
		
		queue.push(0);
		
		int children = 0;
		
		while(!queue.isEmpty())
		{
			pos = queue.peek();
			
			if(!visited[pos])
			{
	//			System.out.println("Visit " + pos + " " + queue);
				if(pos == 0)time = 0;
				else
				{
					time = disc[parent[pos]] + 1;
				}
				Vertex v0 = v[pos];
				boolean alreadyvisited = visited[pos];
				visited[pos] = true;
				disc[pos] = time;
				low[pos] = time;
				children = 0;
				
				for(int adj : v0.adjlist)
				{
					if(parent[pos] != adj)
					{
						if(!visited[adj])
						{
							children++;
//							if(pos == 0)rootchildren++;
							
							parent[adj] = pos;
							queue.push(adj);
						}
						else
						{
							low[pos] = Math.min(low[pos], disc[adj]);
	//						System.out.println("Re " + pos + " " + adj);
						}
					}				
				}

			}
			else
			{
				pos = queue.pop();
				
				int par = parent[pos];
				if(par >= 0)
				{
					low[par] = Math.min(low[par], low[pos]);
					if(disc[par] < low[pos])
					{
						b.add(new Bridge(par, pos));
					}
				}
			}

			
		}

	}

	public static void main(String[] args) 
	{
		vn = sc.nextInt();
		en = sc.nextInt();
		v = new Vertex[vn];
		disc = new int[vn];
		low = new int[vn];
		parent = new int[vn];
		visited = new boolean[vn];
		C c = new C();
		b = new TreeSet<Bridge>(c);

		for(int i = 0; i < vn; i++)
		{
			v[i] = new Vertex();
			parent[i] = -1;
			low[i] = 999999999;
		}
		
		for(int i = 0; i < en; i++)
		{
//			System.out.println("Reading edge " + (i+1));
			int v1 = sc.nextInt();
			int v2 = sc.nextInt();
			
			v[v1].adjlist.add(v2);
			v[v2].adjlist.add(v1);
		}
		
		DFS();
		
		for(Bridge s : b)
		{
			System.out.println(s);
		}
//		System.out.println(ap);
//		System.out.println("Disc "+ Arrays.toString(disc));
//		System.out.println("Low "+ Arrays.toString(low));
	}

}



Measured memory_bytes: 76320
//R<3S
#include <bits/stdc++.h>
#define DECIMAL(n)  std::cout << std::fixed;std::cout << std::setprecision(n);
#define FAST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define hell 1000000007
#define PI 3.14159265358979323844
#define mp make_pair
#define pb push_back
#define fi first 
#define se second
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))  
#define REVERSE(v) reverse(ALL(v))
#define endl "\n"
#define vecmax(v) max_element(all(v))
#define vecmin(v) min_element(all(v))
#define GCD(m,n) __gcd(m,n)
#define LCM(m,n) m*(n/GCD(m,n))
#define inputarr(a,n) for(int i=0;i<n;++i) cin>>a[i]
#define initarr(a,n,x) for (int i=0;i<n;++i) a[i]=x
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(x) for(auto i : x)
#define sz(a) (int)a.size()
#define sl(a) (int)a.length()
#define invect(data,n) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.pb(tmp);}
#define inset(data,n) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.insert(tmp);}
#define ll long long
#define int long long
#define ld long double 
#define pii std::pair<int, int> 
#define pll std::pair<ll, ll>  
#define vi vector<int>  
#define vl vector<ll>
#define vvi vector<vi > 
#define vii vector<pii >
#define mii map<int,int>
#define mll map<ll,ll>
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl


using namespace std;

void solve()
  {

	int amt;
	cin>>amt;
	int inc=1;
	int ti=0,st=100;
	while(st<amt)
	{
		st+=inc;
		inc=st/100;
		ti++;
	}
	cout<<ti<<endl;
	
  }



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


   return 0;
}


Measured memory_bytes: 3648
#include <stdio.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0)

int isRAT(int a,int b,int c){
  if(a<b)swap(int,a,b);
  if(a<c)swap(int,a,c);
  if(a*a==b*b+c*c)return 1;
  else return 0;
}

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

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n,k;
  cin>>n>>k;
  int ans=0;
  vector<int>h(n);
  rep(i,n) {
    cin>>h[i];
    if(h[i]>=k)
      ans++;
  }
  cout<<ans<<endl;
}

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

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

int main() {
  ll n, m;
  cin >> n >> m;
  vector<vector<ll>> g(n, vector<ll>(n, 0));
  rep(i, m) {
    int from, to;
    cin >> from >> to;
    g[from-1][to-1] = 1;
    g[to-1][from-1] = 1;
  }
  vector<ll> v(n-1);
  rep(i, n-1) {
    v[i] = i+1;
  }
  ll ans = 0;
  do {
    bool ok = true;
    if (!g[0][v[0]]) {
      ok= false;
      continue;
    }
    rep(i, v.size()-1) {
      //printf("g[%d][%d] = %d\n", v[i+1], v[i], g[v[i+1]][v[i]]);
      if (g[v[i+1]][v[i]]==0) {
        ok = false;
        break;
      }
    }
    if (ok) ans++;
  } while(next_permutation(v.begin(), v.end()));//順列全探索
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int len_(int n){
  int res=0;
  while(n>0){
    n /= 10;
    res++;
  }
  return res;
}

string itos_(int n){
  string res="";
  int len = len_(n);
  int pad = 6-len;
  char temp;
  while(n>0){
    temp = '0'+n%10;
    res = temp+res;
    n /= 10;
  }
  REP(i,pad){
    res = "0" + res;
  }
  return res;
}

string process_(int p, int index){
  string res="";
  res += itos_(p);
  res += itos_(index);
  return res;
}
  
int main(){
  
  int n,m;
  cin>>n>>m;
  vector<pair<int,int>> years[n];
  int p,y;
  REP(i,m){
    cin>>p>>y;
    p--;
    years[p].push_back(make_pair(y,i));
  }
  pair<int,int> ans[m];
  int num;
  int index;
  REP(i,n){
    if(years[i].empty())continue;
    sort(years[i].begin(),years[i].end());
    num = years[i].size();
    REP(j,num){
      index = years[i][j].second;
      ans[index] = make_pair(i+1,j+1);
    } 
  }
  string res;
  REP(i,m){
    res = process_(ans[i].first,ans[i].second);
    cout<<res<<endl;
  }
  return 0;
}


Measured memory_bytes: 7808
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>

using namespace std;

using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)
const int inf = 1e+9;

const ll mod = 1000000007;

int main() {
	ll n, k;
 	cin >> n >> k;
 	int a[n];
 	rep(i, n) {
 		cin >> a[i];
 		a[i]--;
 	}


 	vector<bool> visit(n, false);
 	vector<int> visited;
 	int pos = 0; 
 	ll count = 0;
 	while(visit[pos] == false) {
 		visit[pos] = true;
 		visited.push_back(pos);
 		count++;
 		pos = a[pos];
 	}

 	int start = -1;
 	rep(i, visited.size()) {
 		if (visited[i] == pos) {
 			start = i;
 		}
 	}

 	//cout << "start:" << start << " count:" << count << endl;
 	ll num = count - start;

 	if (k < start) {
 		cout << visited[k] + 1 << endl;
 		return 0;
 	}

 	cout << visited[(k - start) % num + start] + 1 << endl;

	return 0;
}


Measured memory_bytes: 4712
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;

using Graph = vector<vector<ll>>;

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; }

#define MAX_N 2010

const long long INF = 1LL << 60;

//境界値に注意！！！

int main() {
    ll a,b,ans=0;
    bool flag;
    cin >> a >> b ;
    for (ll i=a;i<=b;++i){
        flag=true;
        string s=to_string(i);
        for (ll j=0;j<s.size()/2;j++){
            if (s[j]==s[s.size()-j-1]){
                continue;
            }else{
                flag=false;
            }
        }
        if (flag)ans++;
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main()
{

    ll n;
    cin>>n;
    ll arr[2][n];
    for(ll i=0; i<n; i++)
    cin>>arr[0][i];
    for(ll i=0; i<n; i++)
    cin>>arr[1][i];

    ll count=0;
    ll count1=0;
    ll sum=0;
    ll netsum=0;
    
    for(ll count1=0; count1<n; count1++)
    {
        for(ll i=0; i<=count1; i++)
        {
            sum = sum + arr[0][i];
        }
        for(ll j=count1; j<n; j++)
        {
            sum= sum +arr[1][j];
        }
        if(sum>netsum)
        netsum = sum;
        sum=0;
    }

    
    cout<<netsum<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int r,g,b,n,ans=0;
    cin>>r>>g>>b>>n;
    for(int i=0;i<=n/r;i++){
        for(int j=0;j<=n/g;j++){
            if((n-i*r-j*g)%b==0 && n-i*r-j*g>=0){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
    return(0);
}

Measured memory_bytes: 3564