akhauriyash/Code-Regression huggingface dataset:
package main
import(
  "fmt"
)
func gdc(p int, q int) int{
  if p==0||q==0{
    return p+q
  }else if p>q{
    return gdc(p%q, q)
  }else{
    return gdc(p, q%p)
  }
}
func main(){
  var n, i, x, temp, tmp int
  fmt.Scan(&n, &x)
  a:=make([]int, n)
  b:=make([]int, 1100000)
  for i=0;i<n;i++{
    fmt.Scan(&a[i])
    b[i]=a[i]-x
    if b[i]<0{
      b[i]*=-1
    }
    }
  temp=b[0]
  for i=0;i<n;i++{
    tmp=b[i]
    temp=gdc(temp, tmp)
  }
  fmt.Println(temp)
}


Measured memory_bytes: 9216
#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<list>
#include<map>
#include<vector>

using namespace std;


#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define ll long long
#define MOD 1000000007

#define IMIN INT_MIN;
#define IMAX INT_MAX;


int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    rep(i, N) cin >> a[i];
    bool flag = false;
    rep(i, N) if (a[i] == 1) flag = true;
    if (!flag) cout << -1 << endl;
    else {
        int cnt = 1;
        rep(i, N) {
            if (a[i] == cnt) cnt++;
        }
        cout << N - cnt + 1 << endl;

    }


	return 0;
}



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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int n;
int a[125252];

int main(){
  scanf("%d",&n);
  REP(i,n)scanf("%d",a+i);
  sort(a,a+n);
  bool win = false;
  REP(i,n)if(a[i]%2==1){
    win = true;
  }
  puts(win ? "first" : "second");
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define int long long int
double h[1005];
int32_t main(){
	double n,t,a,mn=1000000,mni=-1;cin>>n>>t>>a;
	for(int i=1;i<=n;i++){
		cin>>h[i];
		if(abs(a-t+h[i]*0.006)<mn){
			mn = abs(a-t+h[i]*0.006);mni=i;
		}
	}
	cout<<mni;
}


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

int main(){

	// #ifndef ONLINE_JUDGE
 //    	freopen("input", "r", stdin);
 //    	freopen("output", "w", stdout);
	// #endif
	ios_base::sync_with_stdio(false);
   	cin.tie(NULL);

   	string s;
   	cin>>s;

   	ll n=s.length()+1;
   	ll arr[n];
   	ll leftarr[n];
   	ll rightarr[n];

   	for(int i=0;i<n;i++){
   		arr[i]=leftarr[i]=rightarr[i]=0;
   	}

   	for(int i=1;i<n;i++){
   		if(s[i-1]=='<'){
   			leftarr[i]=leftarr[i-1]+1;
   		}
   		else{
   			leftarr[i]=0;   			
   		}
   	}

   	for(int i=n-1;i>=0;i--){
   		if(s[i]=='>'){
   			rightarr[i]=rightarr[i+1]+1;
   		}
   		else{
   			rightarr[i]=0;
   		}
   	}

   	ll ans=0;
   	for(int i=0;i<n;i++){
   		// cout<<i<<" "<<leftarr[i]<<" "<<rightarr[i]<<endl;
   		arr[i]=max(leftarr[i],rightarr[i]);
   		ans+=arr[i];
   	}

   	cout<<ans<<endl;

}


Measured memory_bytes: 12572
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <cstdlib>
#include <math.h>

using namespace std;

typedef long long ll;
#define rep(i, n) for(long (i) = 0; (i) < (long) (n); (i)++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,a,b) for(long i=(a);i<(b);i++)
#define rrep1(i,a,b) for(long i=(a);i<=(b);i++)
#define rrrep(i,a,b) for(long i=(a);i>=(b);i--)
#define define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define X first
#define Y second
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vector<int> >
#define vpl vector<pair<long, long> >
#define vppl vector<pair<long, pair<long, long> > >

const int INF = 100100100;
const long LONG_INF = 2147483647;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const ll LINF = 1e18;


int pow(int x) {
	if (x == 0) {
		return 1;
	}
	else {
		return pow(x - 1) * 2;
	}
}

int main(int argc, char const *argv[])
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    double w,h,x,y;
    cin >> w >> h >> x >> y;
    cout << w * h / 2 << " ";
    if(w / 2 == x && h / 2 == y) {
        cout << 1 << endl;
    } else {
        cout << 0 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
struct P{
	int x,y;
}a[200005];
int n,c[8005][4005],f[4005][4005];
ll ans=0;
int add(int a,int b){
	return a+b>=mod?a+b-mod:a+b;
}
int main(){
	for(int i=0;i<=8002;i++){
		c[i][0]=1;
		for(int p=1;p<=min(i,4002);p++) c[i][p]=add(c[i-1][p],c[i-1][p-1]);
	}
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a[i].x,&a[i].y);
		f[2001-a[i].x][2001-a[i].y]++;
		ans-=c[a[i].x+a[i].y+a[i].x+a[i].y][a[i].x+a[i].x];
	}
	ans%=mod;
	for(int i=1;i<=4002;i++){
		for(int p=1;p<=4002;p++){
			f[i][p]=add(f[i][p],add(f[i-1][p],f[i][p-1]));
		}
	}
	for(int i=1;i<=n;i++){
		ans+=f[2001+a[i].x][2001+a[i].y];
	}
	ans%=mod;
	ans=ans*(mod+1>>1)%mod;
	printf("%lld",(ans%mod+mod)%mod);
	return 0;
}

Measured memory_bytes: 189696
n = int(input())

s = input()
t = 0
m = 0
for i in range(n):
    a = s[:i]
    b = s[i:]
    A = list(set(a))
    B = list(set(b))
    for i in A:
        if i in B:
            t += 1
    if m < t:
        m = t
    t = 0
print(m)

Measured memory_bytes: 39024
fun main(args: Array<String>) {
    val inStr = readLine()
    val dataSets = inStr?.split(' ')?.map { s -> s.toInt() } ?: return
    val a = dataSets[0]
    val b = dataSets[1]
    val c = dataSets[2]

    val numOfDivisors = (a..b).filter { i -> (c % i) == 0 }.count()
    println(numOfDivisors)
}



Measured memory_bytes: 32808
#include<bits/stdc++.h>
using namespace std;
string to_string(const string& s) {
	return '"' + s + '"';
}
string to_string(const bool b) {
	return (b ? "true" : "false");
}
string to_string(const char* s) {
	return to_string((string)s);
}
string to_string(const char c) {
	string s = "'";
	s += c;
	s += "'";
	return s;
}
template<class T, class U>
string to_string(const pair<T, U>& p) {
	string s = "(";
	s += to_string(p.first);
	s += ", ";
	s += to_string(p.second);
	s += ")";
	return s;
}
template<class T>
string to_string(const T& a) {
	bool first = true;
	string s = "{";
	for (const auto& x : a) {
		if(!first){
			s += ", ";
		}
		first = false;
		s += to_string(x);
	}
	s += "}";
	return s;
}
void debug_out() {cerr << '\n';}
template<class Head, class... Tail>
void debug_out(Head head, Tail... tail) {
	cerr << ' ' << to_string(head);
	debug_out(tail...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "] = ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const int inf = 1e9 + 100;
const ll inf64 = 7e18l;
int add(int x, int y) {
	x += y;
	if (x >= mod) {
		return x - mod;
	}
	return x;
}
void add_self(int& x, int y) {
	x = add(x, y);
}
int mult(int x, int y) {
	return 1ll * x * y % mod;
}
void mult_self(int& x, int y) {
	x = mult(x, y);
}
int bin_pow(int x, int y) {
	if (y == 0) {
		return 1;
	}
	if (y % 2 == 0) {
		return bin_pow(mult(x, x), y / 2);
	}
	return mult(x, bin_pow(x, y - 1));
}
int inv(int x) {
	return bin_pow(x, mod - 2);
}
vector<int> fact, inv_fact;
const int maxn = 1e6 + 15;
int C(int x, int y) {
	return mult(mult(fact[x], inv_fact[y]), inv_fact[x - y]);
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(20);
	fact.resize(maxn);
	inv_fact.resize(maxn);
	for (int i = 0; i < maxn; ++i) {
		if (i == 0) {
			fact[0] = 1;
		} else {
			fact[i] = mult(fact[i - 1], i);
		}
		inv_fact[i] = inv(fact[i]);
	}
	int x, y;
	cin >> x >> y;
	int answer = 0;
	for (int two = 0; two <= x / 2; ++two) {
		int one = x - 2 * two;
		if (one * 2 + two == y) {
			add_self(answer, C(two + one, two));
		}
	}
	cout << answer << '\n';
	return 0;
}


Measured memory_bytes: 8064
// template version 1.13
using namespace std;
#include <bits/stdc++.h>

// varibable settings
#define infile "../test/sample-1.in"
#define int long long //{{{
const int INF=1e18;
const int MOD=1e9+7; //}}}

// define basic macro {{{
#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<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define ceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

int solve(){
  int n;cin>>n;
  int ans = INF;
  rep(i, 1, 1000002){
    if (n%i==0){
      int j = n/i;
      chmin(ans, i+j);
    }
  }
  cout << ans-2 << endl;
  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


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

int main() {
    ll a, b, k;
    cin >> a >> b >> k;
    ll ap = max((ll)0, a-k);
    ll bp = max((ll)0, min(b, a+b-k));
    printf("%lld %lld\n", ap, bp);
    return 0;
}

Measured memory_bytes: 3688
#include <bits/stdc++.h>
using namespace std;
/*
插入排序模拟 
已经给伪代码了，所以很好写 
*/
int a[105];
int n;
int main(){
//	freopen("a.txt","r",stdin);
	cin>>n;
	for(int i=0;i<n-1;i++)
		cin>>a[i],cout<<a[i]<<' ';
	cin>>a[n-1];
	cout<<a[n-1]<<endl;
	for(int i=1;i<n;i++){
		int key=a[i];
		int j=i-1;
		while(j>=0&&a[j]>key)
			a[j+1]=a[j],j--;
		a[j+1]=key;
		for(int i=0;i<n-1;i++)
			cout<<a[i]<<' ';
		cout<<a[n-1]<<endl;
	}
	return 0;
}


Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mp  make_pair
#define pb  push_back
#define endl "\n"
#define rep(i,a,n) for(int i=a;i<n;i++)
const int mod = 1e9 + 7;
void solve() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (a == b and c == d) {
		cout << a*c;
	}
	// else if (b >= 0 and d >= 0) {
	// 	if (a > 0 and c > 0)
	// 		cout << b*d;
	// 	if (a < 0 and c < 0)
	// 		cout << max(a * c, b * d);
	// 	if ((a > 0 and c < 0) or (a<0 and c>0))
	// 		cout << b*d;
	// }
	else {
		int max1 = a * c;
		int max2 = a * d;
		max2 = max(max1, max2);
		max1 = b * c;
		max2 = max(max1, max2);
		max1 = b * d;
		max2 = max(max1, max2);
		cout << max2;
	}
}
int32_t main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	int t;
	t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}


Measured memory_bytes: 3644
import java.util.Scanner;


public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
		    int N = scanner.nextInt();
		    int A = scanner.nextInt();
		    
		    if(N % 500 <= A ) 
		    {
		    	System.out.println("Yes");
		    }
		    else
		    {
		    	System.out.println("No");
		    }
		    scanner.close();}
		  }

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

typedef long long ll;

#define        optimize           ios::sync_with_stdio(0); cin.tie(0);
#define PI    acos(-1.0)
#define pb push_back
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define RESET(a, b) memset(a, b, sizeof(a))
#define pii pair <int, int>
#define gcd(a, b) __gcd(a, b)
#define min3(a, b, c) min(c, min(a, b))
#define max3(a, b, c) max(c, max(a, b))

#define        MX        200005
void max_self(ll& a, ll b)
{
    a = max(a, b);
}
int main()
{
    optimize
    int N, W;
    cin>>N>>W;

    vector <ll> dp(W+1);
    for(int i = 0; i < N; i++){
        int weight, val;
        cin>>weight>>val;

        for(int j = W-weight; j >= 0; j--){
            max_self(dp[j+weight], dp[j]+val);
        }
    }
    ll ans = 0;
    for(int i = 0; i <= W; i++){
        max_self(ans, dp[i]);
    }
    cout<<ans<<endl;
}


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

int main() {
	int n;
	int mul=1;
	int sum=0;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            mul=a[i]*a[j];
            sum=sum+mul;
        }

    }
    cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;
typedef pair<int, long> P;

const int MAX_N = 1e5;
int n;
long m;
int v[MAX_N];
long x[MAX_N];
vector<P> a, b, c, d;

int main() {
    scanf("%d %ld", &n, &m);
    for (int i = 0; i < n; i++) {
        scanf("%ld %d", &x[i], &v[i]);
    }
    
    a.push_back(P(0, 0));
    b.push_back(P(0, 0));
    c.push_back(P(0, 0));
    d.push_back(P(0, 0));
    long a0 = v[0] - x[0];
    if (a0 > 0) a.push_back(P(1, a0));
    long b0 = a0 - x[0];
    if (b0 > 0) b.push_back(P(1, b0));
    long c0 = v[n - 1] - m + x[n - 1];
    if (c0 > 0) c.push_back(P(1, c0));
    long d0 = c0 - m + x[n - 1];
    if (d0 > 0) d.push_back(P(1, d0));
    for (int i = 1; i < n; i++) {
        a0 = a0 + v[i] - x[i] + x[i - 1];
        b0 = a0 - x[i];
        c0 = c0 + v[n - i - 1] + x[n - i - 1] - x[n - i];
        d0 = c0 - m + x[n - i - 1];
        if (a0 > a.back().second) a.push_back(P(i + 1, a0));
        if (b0 > b.back().second) b.push_back(P(i + 1, b0));
        if (c0 > c.back().second) c.push_back(P(i + 1, c0));
        if (d0 > d.back().second) d.push_back(P(i + 1, d0));
    }
    
    long ans = 0;
    for (int i = 0; i <= n; i++) {
        vector<P>::iterator k = --upper_bound(a.begin(), a.end(), P(i, 1e14));
        vector<P>::iterator l = --upper_bound(c.begin(), c.end(), P(i, 1e14));
        long ans1 = k->second + (--upper_bound(d.begin(), d.end(), P(n - k->first, 1e14)))->second;
        long ans2 = l->second + (--upper_bound(b.begin(), b.end(), P(n - l->first, 1e14)))->second;
        ans = max(ans, max(ans1, ans2));
    }

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


Measured memory_bytes: 6868
import java.util.*;

public class Main {
    public static void main(String[] args) {
        solve(new Scanner(System.in));
//        solve(new Scanner(ex));
    }

    private static final String ex = "56 25 31";
//    private static final String ex = "30 30 100";

    private static void solve(Scanner scanner) {
        String[] split = scanner.nextLine().split(" ");
        int[] nums = new int[3];
        nums[0] = Integer.parseInt(split[0]);
        nums[1] = Integer.parseInt(split[1]);
        nums[2] = Integer.parseInt(split[2]);

        Arrays.sort(nums);

        if (nums[0] + nums[1] == nums[2]) System.out.println("Yes");
        else System.out.println("No");
    }
}


Measured memory_bytes: 22608
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <queue>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
typedef long long ll;
typedef pair <int,ll> pii;
int a[55];
ll n;

int main(void)
{
  cin >> n;
  vector<ll>t(n,0);
  vector<ll>x(n,0);
  vector<ll>y(n,0);
  ll time=0,nowx=0,nowy=0,index;
  for(int i=0;i<n;i++)
    {
      cin >> t[i] >> x[i] >> y[i];
    }
  time+=t[0];
  nowx=x[0],nowy=y[0];
  index=0;
  while(index<=n-1)
    {
      //cout << time << ' ' << nowx << ' ' << nowy << endl;
      if((nowx+nowy)>time)
	{
	  cout << "No" << endl;
	  return 0;
	}
      else if(abs(time-(nowx+nowy))% 2 !=0)
	{
	  cout << "No" << endl;
	  return 0;
	}
      time=t[index+1]-t[index];
      nowx=abs(x[index+1]-x[index]);
      nowy=abs(y[index+1]-y[index]);
      index++;
    }
  cout << "Yes" << endl;
  return 0;
}


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

using namespace std;

#define fastio cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(0)
typedef long long ll;
#define int ll
#define swap(x, y)((x)^=(y)^=(x)^=(y))
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> matrix;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(c) c.begin(),c.end()
#define mp make_pair
#define pb push_back
#define f first
#define tcase int _; cin>> _; for( ; _; --_)
#define s second
#define endl '\n'
const int MAX = 1e6+1;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1);
const double DEG = 180/PI;
const int MOD = 1e9+7;
int mod(int x, int m){ if(x >= 0) return x % m; if(-x < m) return m-(-x); return mod(x%m, m);}
int gcd (int a, int b) {while(b){a = mod(a, b); swap(a, b);} return a;}
int lcm (int a, int b) {return a / gcd(a, b) * b;}
int fexp(int base, int exp, int m){
	int total = 1;
	while(exp > 0){
		if(exp % 2 == 1){
			total = mod(((mod(total, m)) * (mod(base, m))), m);
			exp--;
		}
		base= mod((mod(base, m) * mod(base, m)), m);
		exp /= 2;
	}
	return mod(total, m);
}

set<int> s;

set<int> div(int n){
    set<int> ans;
    for(int i = 1; i*i <= n; ++i){
        if(n % i == 0){
            ans.insert(i);
            if(n / i != i) ans.insert(n / i);
        }
    }
    return ans;
}

void check1(set<int> div, int n){
    for(int i: div){
        int x = n;
        if(i == 1) continue;

        while(x >= i && x%i == 0) x/=i;
        if(x%i == 1) s.insert(i);
    }
}

void check2(set<int> div){
    for(int i: div) if(i != 1) s.insert(i);
}

void solve(){
    int n;
    cin>> n;
    
    check1(div(n), n);
    check2(div(n-1));
   

    cout<< s.size()<< endl;
}

int32_t main(){
	fastio;
	solve();
	return 0;
}



Measured memory_bytes: 3852
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int n;
long a[1<<17],b[1<<17];
vector<pair<long,int> >A;
main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>b[i];
		A.push_back(make_pair(a[i]+b[i],i));
	}
	sort(A.begin(),A.end());
	reverse(A.begin(),A.end());
	long ans=0;
	for(int i=0;i<n;i++)
	{
		if(i%2)ans-=b[A[i].second];
		else ans+=a[A[i].second];
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 3568
#include<stdio.h>
int main()
{
    int a,b;
  
 
    // スペース区切りの整数の入力
    scanf("%d",&a);
 
    // 出力
  if(a<10){
    b=a;
   
  }else if(a<100){
    b = 9;
  }else if(a<1000){
    b = 9+a-99;
  
  }else if(a<10000){
    b=9+999-99;
  }else if(a<100000){
    b=9+999-99+a-9999;
  }else{
  b = 9+999-99+99999-9999;
  }
   printf("%d",b);
    return 0;
}

Measured memory_bytes: 128
a = (int)(input())
b = (int)(input())
c = (int)(input())
d = (int)(input())
e = (int)(input())

at = -(-a//10)*10
bt = -(-b//10)*10
ct = -(-c//10)*10
dt = -(-d//10)*10
et = -(-e//10)*10

aa = a % 10
ba = b % 10
ca = c % 10
da = d % 10
ea = e % 10

array = (aa, ba, ca, da, ea)
minn = aa
for i in array:
    if (i != 0 and minn > i):
        minn = i
test = array.index(minn)

if (test == 0):
    time = a + bt + ct + dt + et
elif (test == 1):
    time = at + b + ct + dt + et
elif (test == 2):
    time = at + bt + c + dt + et
elif (test == 3):
    time = at + bt + ct + d + et
elif (test == 4):
    time = at + bt + ct + dt + e

print(time)

Measured memory_bytes: 3188
#include<iostream>
using namespace std;
int main(){
    int a,b,c,d;
    string s;
    cin >> a >> b >> c >> d;
    if(a+b>c+d) s="Left";
    else if(a+b==c+d) s="Balanced";
    else s="Right";
    cout << s << endl;
}

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

int main() {
  int K;
  cin >> K;
  int ans = 0;
  for (int a = 1; a <= K; ++a)
    for (int b = 1; b <= K; ++b)
      for (int c = 1; c <= K; ++c)
        ans += gcd(gcd(a, b), c);
  cout << ans << endl;
}

Measured memory_bytes: 3596
#include <iostream>
#include <vector>

using namespace std;

int n, q;
vector<int> edge[220000];
bool done[220000];
int cnt[220000];

void dfs(int u) {
  done[u] = true;
  for (int v: edge[u]) {
    if (done[v]) continue;
    cnt[v] += cnt[u];
    dfs(v);
  }
}

int main()
{
  cin >> n >> q;
  
  for (int i = 0; i < n-1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  
  for (int i = 0; i < q; i++) {
    int p, x;
    cin >> p >> x;
    p--;
    cnt[p] += x;
  }
  
  dfs(0);
  
  for (int i = 0; i < n; i++) {
    cout << cnt[i] << " ";
  }
  
  return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define int ll
const ll MOD = 1000000007;
const int MAX = 510000;

int n, k;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

signed main() {
    COMinit();
    cin >> n >> k;
    for (int i=1;i<=k;i++) {
        int ans = COM(n-k+1, i) * COM(k-1,i-1) % MOD;
        cout << ans << endl;
    }
}

// n-k+1個の箱からi個選ぶ
// k個をi個に分割する→k-1個の仕切りからi-1個選ぶ
// mod(Combination)

Measured memory_bytes: 12160
from collections import deque

N,M,*AB=map(int,open(0).read().split())
to=[[] for _ in range(N)]

for a,b in zip(*[iter(AB)]*2):
  to[a-1].append(b-1)
  to[b-1].append(a-1)
  
q=deque([0])
r=[None]*N

while q:
  x=q.popleft()
  for i in to[x]:
    if r[i] is None:
      q.append(i)
      r[i]=x+1
      
print("Yes",*r[1:],sep="\n")

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

#define int long long

#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)

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

template<typename T, typename U>
istream& operator>>(istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}

vector<int> f(int n){
    vector<int> ret;
    for(int i=1;i*i<=n;i++){
        if(n%i==0){
            ret.push_back(i);
            if(n/i!=i){
                ret.push_back(n/i);
            }
        }
    }
    return ret;
}

// https://twitter.com/vane11ope ←フォローしましょう
// (ノ)>◡<(ヾ)ﾓﾁﾓﾁ
signed main(signed argc, char* argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    const int MOD = 1e9+7;

    int n;
    cin>>n;
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    sort(a.begin(),a.end(),greater<>());
    vector<int> copy_a=a;
    sort(copy_a.begin(),copy_a.end());
    int ans=0;
    rep(i,n){
        ans++;
        vector<int> e=f(a[i]);
        for(int it:e){
            if(upper_bound(copy_a.begin(),copy_a.end(),it)-lower_bound(copy_a.begin(),copy_a.end(),it)>(it==a[i]?1:0)){
                ans--;
                break;
            }
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 6324
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

const int MOD = 1000000000 + 7;

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

  int a,b;
  cin >> a >> b;
  cout << (a + b) % 24 << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final int parL = Integer.parseInt(sc.next());
        final int parR = Integer.parseInt(sc.next());
        final int pard = Integer.parseInt(sc.next());
        sc.close();
        int result = 0;

        for (int i = parL; i <= parR; i++) {
            if (i % pard == 0) {
                result++;
            }
        }

        System.out.println(result);
    }
}

Measured memory_bytes: 35572
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define max3(x, y, z) max(x, max(y, z))

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endl
#endif
using namespace std;
int main() {
  ll A;
  cin >> A;
  if (A > 10000) {
    cout << 1;
    return 0;
  }
  rep(i, A/100+1) {
    rep(j, A / 100 + 1) {
      rep(k, A / 100 + 1) {
        rep(l, A / 100 + 1) {
          rep(m, A / 100 + 1) {
            rep(n, A / 100 + 1) {
              if (i * 100 + j * 101 + k * 102 + l * 103 + m * 104 + n * 105 == A) {
                cout << 1;
                return 0;
              }
            }
          }
        }
      }
    }
  }
  cout << 0;
  return 0;
}
/*
//よく使うやつ
int N;
cin >> N;
vector<int> list(N);
for (int i = 0; i < N; i++) {
cin >> list[i];
}
// for文
for (int i = 0; i < N; i++) {
}
//配列
vector<int> list;
list.at(i)
vector<vector<int>> list(10, vector<int>(10));
sort(all(list));
sort(all(list), greater<int>());
  //配列の内容表示
dout << "====listの内容====\n";
for (int i = 0; i < N; i++) dout << list[i] << endl;
dout << "====ここまで====\n";
*/


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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

		double num2=Math.pow(num1,2);
		int num3=(int)num2;
		System.out.println(num3);
	}
}


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

int main (){
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  A += B;
  C += D;
  if (A == C) {
    cout << "Balanced" << endl;
  }else if (A > C){
    cout << "Left" << endl;
  }else{
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){

    int n; cin >> n;
    vector<int> t(n);
    int sum = 0;
    for(int i = 0; i < n; i++){
        cin >> t.at(i);
        sum += t.at(i);
    }

    int m; cin >> m;
    for(int i = 0; i < m; i++){
        int p, x; cin >> p >> x;
        p--;
        cout << sum - t.at(p) + x << endl;
    }

    
    return(0);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define lint long long
#define st first
#define nd second
#define INF 0x3f3f3f3f

using namespace std;


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	lint x, y;
	cin>>x>>y;
	if(y%2 !=0 ){
		cout<<"No\n";
	}else{
		int per = y/2;
		if((per/2+per%2) <= x && x <=per){
			cout<<"Yes\n";
		}else{
			cout<<"No\n";
		}
	}

	return 0;	
}


Measured memory_bytes: 3568
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repA(i,a,b) for(ll i=a;i<=b;i++)
#define repD(i,b,a) for(int i=b;i>=a;i--)
#define fill(a) memset(a,0,sizeof(a))
#define f first
#define s second
#define M_E 2.71828182845904523536
#define M_PI 3.14159265358979323846
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main()
{
    string str;
    cin>>str;
    for(int i=0;i<str.size();i++)
    {
        if(str[i]=='7')
        {
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
using namespace std;
int main(){
  int n,count=0;
  int a[101]={};
  cin>>n;
  for(int i=0;i<n;i++)cin>>a[i];
  
  for(int j=0;j<n;j++)
    for(int i=0;i<n;i++)
      if(a[i-1]>a[i]){
	swap(a[i-1],a[i]);
	count++;
      }
    for(int i=0;i<n-1;i++)
      cout<<a[i]<<' ';
    cout<<a[n-1]<<endl<<count<<endl;
    return 0;
}

Measured memory_bytes: 1160
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

h,w=get_i
if w==1 or h==1
  puts 1

elsif (h%2).zero? or (w%2).zero?
  puts (h*w)/2
else
  puts (h*w)/2+1
end

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

using namespace std;
typedef long long ll;
const ll mod=(1e9+7);
const ll inf=(1ll<<61);
const int MX=3e5+9;
int n,a[MX],p[MX],s[MX];
int gcd(int x,int y){
    if(y==0)return x;
    return gcd(y,x%y);
}
int main(){
    cin>>n;
    for(int i=0;i<n;i++)scanf("%d",&a[i]);
    p[0]=a[0];
    s[n-1]=a[n-1];
    for(int i=1;i<n;i++)p[i]=gcd(a[i],p[i-1]);
    for(int i=n-2;i>=0;i--)s[i]=gcd(a[i],s[i+1]);
    int ans=p[n-1];
    for(int i=0;i<n;i++){
        if(i==0)ans=max(ans,s[i+1]);
        else if(i==n-1)ans=max(ans,p[i-1]);
        else ans=max(ans,gcd(p[i-1],s[i+1]));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1536
#include <cstdio>
using namespace std;

long long int A[100010], B[100010];
int main() {
    int N; scanf("%d", &N);
    for(int i=0; i<N; i++) {
        scanf("%lld%lld", &A[i], &B[i]);
    }

    long long int ofs = 0;
    for(int i=N-1; i>=0; i--) {
        A[i] += ofs;
        if(A[i] == 0) continue;
        if(A[i] <= B[i]) ofs += B[i] - A[i];
        else {
            long long int mo = A[i] % B[i];
            ofs += (B[i] - mo) % B[i];
        }
    }
    printf("%lld\n", ofs);
    return 0;
}

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

int main() {
  int A,B,M;
  cin >> A >> B >> M;
  vector<int> a(A);
  
  int min2=pow(10,7);
  for(int i=0;i<A;i++){
    cin >> a.at(i);
    min2 = min(min2,a.at(i));
  }
  
  vector<int> b(B);
  int min3 =pow(10,7);
  for(int i=0;i<B;i++){
    cin >> b.at(i);
    min3 = min(min3,b.at(i));
  }
  
  int ans = 0;
  int min1 = pow(10,8);
  int x,y,z;
  
  for(int i= 0;i<M;i++){
    cin >> x >> y >> z;
    ans = a.at(x-1)+b.at(y-1)-z;
    min1 = min(min1,ans);
  }
  
  cout << min(min1,min2+min3) << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
using vl=vector<ll>;
using vb=vector<bool>;
using vs=vector<string>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
const ll oo =0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORD(i,a,b) for(ll i=ll(b)-1;i>=(a);i--)
#define TR(X) ({if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })
vvl adj;	// Adjazenzliste des Baums. Ungerichtet. Wenn gerichtet muss der 
		// richtige Wurzelknoten beim ersten dfs Aufruf angegeben werden
vector<vector<pll>> weighted_adj;
vl visitedNodes, depths, firstOccurences;
ll idx;

/*
void dfs(ll cur, ll de, ll par) {
	firstOccurences[cur] = idx; // First time cur is found in visitedNodes
	visitedNodes[idx] = cur; // Append node to visitedNodes
	depths[idx] = de;
	idx++;

	for (ll nei : adj[cur]) {
		if (nei == par) continue;
		dfs(nei, de + 1, cur);
		visitedNodes[idx] = cur;
		depths[idx] = de;
		idx++;
	}
}

void initLCA(ll root) {
	idx = 0;
	visitedNodes.resize(sz(adj) * 2);
	depths.resize(sz(adj) * 2);
	firstOccurences.assign(sz(adj) * 2, -1);

	dfs(root, 0, -1);

	data = depths;
	initRMQ();
}

ll LCA(ll u, ll v) {
	if (u == v) return u;
	if (firstOccurences[u] > firstOccurences[v]) swap(u, v);
	// query ist RMQ query
	return visitedNodes[query(firstOccurences[u], firstOccurences[v] + 1)];
}
*/

vl disToRoot;
void dfs(ll cur, ll par, ll dis) {
    disToRoot[cur] = dis;

    for (pll nei : weighted_adj[cur]) {
        if (nei.xx == par) continue;
        dfs(nei.xx, cur, dis+nei.yy);
    }
}

int main() {
  cin.sync_with_stdio(0);
  ll N;
  cin >> N;
  adj.resize(N);
  weighted_adj.resize(N);
  FOR(i, 0, N - 1) {
    ll a, b, c;
    cin >> a >> b >> c;
    a--, b--;
    adj[a].pb(b);
    adj[b].pb(a);
    weighted_adj[a].pb({b, c});
    weighted_adj[b].pb({a, c});
  }

  ll Q, K;
  cin >> Q >> K;
  K--;

  disToRoot.resize(N);
  dfs(K, -1, 0);

  FOR(i, 0, Q) {
    ll x, y;
    cin >> x >> y;
    x--, y--;

    cout << disToRoot[x] + disToRoot[y] << endl;
  }
}  // cin.tie(0) bei schnellem Wechseln


Measured memory_bytes: 19840
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		String s = reader.next(), t = reader.next();
		int minChanges = Integer.MAX_VALUE;
		for (int i = 0; i < s.length() - t.length() + 1; i++) {
			int changes = 0;
			for (int k = 0; k < t.length(); k++) {
				if (t.charAt(k) != s.charAt(k + i)) {
					changes++;
				}
			}
			minChanges = Math.min(minChanges, changes);
		}
		System.out.println(minChanges);
		reader.close();
	}
	
}


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

void call(int n)
{
	int i = 1;
CHECK_NUM:
  	int x = i;
  	if (x % 3 == 0)
  	{
    	cout << " " << i;
    	goto END_CHECK_NUM;
  	}
INCLUDE3:
  	if (x % 10 == 3)
  	{
    	cout << " " << i;
    	goto END_CHECK_NUM;
  	}
  	x /= 10;
  	if (x != 0) 
	{
		goto INCLUDE3;
	}
END_CHECK_NUM:
	if (++i <= n) 
	{
		goto CHECK_NUM;
	}

  	cout << endl;
}


int main()
{
	int n;
	cin >> n;
	call(n);
	return 0;
}
 

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, m, n) for(ll i = m; i > n; i--)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define lmax(x, y) max<ll>(x, y)
#define lmin(x, y) min<ll>(x, y)
#define tmax(x, y, z) lmax((x), lmax((y), (z)))
#define tmin(x, y, z) lmin((x), lmin((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
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<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
// struct edge{ ll from, to, cost; };
// struct edge{ ll to, cost; };
// using Graph = vector<vector<ll>>;  // 重み無し
// using Graph = vector<edge>;  // 辺
// using Graph = vector<vector<edge>>;  // 重み付き
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};


int main(){
    ll x; cin >> x;
    if(x == 0) cout << 1 << endl;
    else cout << 0 << endl;
}


Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    string s;
    cin>>s;
    int ans=700;
    for(int i=0;i<3;i++){
        if(s[i]=='o')ans+=100;
    }
    cout<<ans<<endl;
    
    return 0;
}


Measured memory_bytes: 256
// clear time: 24:00
(function (input) {
    /*
    利子：運用資金残高に年利率をかけ、1円未満は切り捨て

    複利：利子は翌年以降の運用資金の残高に加算
    単利：利子は別の場所へ蓄積

    手数料：上記の処理を行ったあとに、運用資金の残高から手数料が引かれる
    */
    var inputs = input.replace(/\r/g, '').split("\n"),
        n;

    n = parseInt(inputs.shift());

    while ( n-- ) {
        var funds = parseInt(inputs.shift()),   // 初期運用資金
            years = parseInt(inputs.shift()),   // 運用年数
            m = parseInt(inputs.shift()),       // データセット数
            max = 0;

        // 最高最終資金を求める
        while ( m-- ) {
            var line = inputs.shift().split(' '),
                funds_tmp = funds,
                box = 0;
            method = {
                kind: line[0] === '0' ? true : false,                // 単利=true
                annualInterestRate: parseFloat(line[1]),             // 年利率
                charge: parseInt(line[2])                            // 手数料
            };
            for ( var i = 0; i < years; i++ ) {
                if ( method.kind ) {
                    box += ~~(funds_tmp * method.annualInterestRate);
                } else {
                    funds_tmp += ~~(funds_tmp * method.annualInterestRate);
                }
                funds_tmp -= method.charge;
            }
            funds_tmp += box;
            if ( funds_tmp > max ) {
                max = funds_tmp;
            }
        }

        console.log(max);
    }

})(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 11092
#include <iostream>
#include <queue>
#include <algorithm>
#include <string>

using namespace std;

struct items{string num; int time;};

int main()
{
    int n,step;
    cin>>n>>step;
    items item[n];
    int cost=0;
    queue<items> que;
    for(int i=0;i<n;i++){
        cin>>item[i].num>>item[i].time;
        que.push(item[i]);
    }
    while(!que.empty()){
        items tep=que.front();
        if(tep.time>step){
            tep.time-=step;  cost+=step;
            que.push(tep);que.pop();
        }
        else{
            cost+=tep.time;
            cout<<tep.num<<" "<<cost<<endl;
            que.pop();
        }
    }
    return 0;
}



Measured memory_bytes: 7108
#include <stdio.h>
 
int main(void) {
  int dice[101][6],subdice[6],i,j,k,l,n,a[6],b[6],subA,subB;
  scanf("%d",&n);
  for(i = 0; i < n; i++)for(j = 0; j < 6; j++)scanf("%d",&dice[i][j]);

  for(i = 0; i < n; i++){
    for(j = i + 1; j < n; j++){
      if(dice[i][0] == dice[j][0]);
      else if(dice[i][0] == dice[j][1] || dice[i][0] == dice[j][4]){
        for(k = 0; k < 6; k++){
          subdice[0] = dice[j][4];
          subdice[4] = dice[j][5];
          subdice[5] = dice[j][1];
          subdice[1] = dice[j][0];
          subdice[2] = dice[j][2];
          subdice[3] = dice[j][3];
          for(l = 0; l < 6; l++)dice[j][l] = subdice[l];
          if(dice[i][0] == dice[j][0])break;
        }
      }
      else if(dice[i][0] == dice[j][2] || dice[i][0] == dice[j][3] || dice[i][0] == dice[j][5]){
        for(k = 0; k < 6; k++){
          subdice[0] = dice[j][2];
          subdice[2] = dice[j][5];
          subdice[5] = dice[j][3];
          subdice[3] = dice[j][0];
          subdice[1] = dice[j][1];
          subdice[4] = dice[j][4];
          for(l = 0; l < 6; l++)dice[j][l] = subdice[l];
          if(dice[i][0] == dice[j][0])break;
        }
      }
      for(k = 0; k < 4; k++){
        subdice[1] = dice[j][2];
        subdice[2] = dice[j][4];
        subdice[4] = dice[j][3];
        subdice[3] = dice[j][1];
        for(l = 1; l < 5; l++)dice[j][l] = subdice[l];
        if(dice[i][1] == dice[j][1]){
          if(dice[i][0] == dice[j][0] && dice[i][2] == dice[j][2] && dice[i][3] == dice[j][3] && dice[i][4] == dice[j][4] && dice[i][5] == dice[j][5]){
            printf("No\n");
            return 0;
          }
        }
      }
    }
  }
  if(i == n && j == n)printf("Yes\n");
  return 0;
}



Measured memory_bytes: 2148
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using vl=vector<long long>;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i)
#define FORE(x,c) for(auto &x:c)
#define FOR(i,a,n) for(int i=a,i##_len=(int)n;i<i##_len;++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i=((int)(n)-1);i>=0;--i)
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)   // c++14
#define SZ(c) ((int)c.size())
#define EXIST(c,x) (c.find(x)!=end(c))
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0}, DY[9]={-1,0,1,0,-1,1,1,-1,0};
const int INF=1001001001; const long long INFLL=1001001001001001001ll;
template<class T> ostream& operator << (ostream &os, const vector<T> &v) {
    ITR(i,v) os << *i << (i==end(v)-1 ? "" : " "); return os; }
template<class T> istream& operator >> (istream &is, vector<T> &v) {
    ITR(i,v) is >> * i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> p.second; return is; }
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(b<a){a=b;return 1;}return 0;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
    #ifdef int
        cerr<<"\x1b[7m"<<"'int' is defined as 'long long' !!!!"<<"\x1b[m"<<endl;
    #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(12)<<fixed;
    }
} before_main_function;
//------------------------------------------------------------------------------

signed main() {
    int n,a,b,ans=0;
    cin>>n>>a>>b;
    vi x(n);
    cin>>x;
    FOR(i,1,n) ans+=min((x[i]-x[i-1])*a,b);
    cout<<ans<<endl;
    return 0;
}


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

int main(){
	using namespace std;
	string str;
	bool judge = false;
	int x = 0;
	while(cin >> str){
		for(;;x++){
			if(x == 4){
				for(int i=1;i<=4;i++){
					if(str[(x + i)] == str[x] && str[(x - i)] == str[x] && str[x] != 's'){
						cout << str[x] << endl;
						judge = true;
						break;
					}
				}
				if(judge==true) break;
			}
			else if(x == 1 || x == 7){
				if(str[x] == str[x-1] && str[x] == str[x+1]&& str[x] != 's'){
					cout << str[x] << endl;
					break;
				}
			}
			else if(x == 3 || x == 5){
				if(str[x] == str[x+3] && str[x] == str[x-3]&& str[x] != 's'){
					cout << str[x] << endl;
					break;
				}
			}
			else if(x == 8){
				cout << 'd' << endl;
				break;
			}
		}
		judge = false;
		x = 0;
	}
	return 0;
}

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

using namespace std;

int main(){
	string s;
	cin>>s;
	
	for(int i=0;i<s.size();i++)
	{
		if((i+1)%2==0){
			if(s[i]!='L'&&s[i]!='U'&&s[i]!='D'){
					cout<<"No";
					return 0;
				}
			}else
			{
				if(s[i]!='R'&&s[i]!='U'&&s[i]!='D'){
					cout<<"No";
					return 0;
				}
			}
	}
	
	cout<<"Yes";
	
	return 0;
	}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,start,lim) for(lld i=start;i<lim;i++)
#define repd(i,start,lim) for(lld i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define br printf("\n")
#define sz(a) lld((a).size())
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
using namespace std;
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl '\n'
#define N 1000005
#define fre freopen("1.in","r",stdin); freopen("1.out","w",stdout);
int main()
{
  sync;
  lld x;
  cin>>x;
  cout<<(48-x);
  return 0;
}

Measured memory_bytes: 768
s = input()
t = input()

s = list(s)
s.append("0")
t = list(t)
roop = len(s)-len(t)
cc = []
for i in range(roop):
  c = 0
  tmp = []
  tmp = s[i:len(t)+1+i]
  for i in range(len(t)):
    if tmp[i] == t[i]:
      c += 1
  cc.append(c)

ma = max(cc)
a = cc.index(ma)
tmp = s[a:a+1+len(t)]
ans = 0

for i in range(len(t)):
  if tmp[i] != t[i]:
    ans += 1
print(ans)

Measured memory_bytes: 68008
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cstring>
#include<climits>
#include<cmath>
#include<map>

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

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

typedef unsigned int uint;
typedef long long ll;

using namespace std;

char buff[12][13];
int  cl[12][12];
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

void check(int x, int y, int c){
  if(buff[y][x] == '0') return;
  if(cl[y][x] != 0) return;
  if(y < 0) return;
  if(x < 0) return;
  if(y > 11) return;
  if(x > 11) return;
  cl[y][x] = c;
  REP(i,4)
    check(x+dx[i],y+dy[i],c);
}

int main(){
  while(cin>>buff[0]){
    REP(i,11)
      cin>>buff[i+1];

    memset(cl,0,sizeof(cl));
    int cnt = 1;
    REP(i,12) REP(j,12){
      if(cl[i][j] == 0 && buff[i][j] == '1')
        check(j,i,cnt++);
    }

    /*
    REP(i,12){ REP(j,12)
        printf("%2d ",cl[i][j]); puts("");}
    */
    cout << cnt-1 << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define x_ real()
#define y_ imag()
#define cross(a, b) (conj(a)*(b)).imag()
#define dot(a, b) (conj(a)*(b)).real()
#define PI acos(-1)
#define F first
#define S second
#define fastIO ios_base::sync_with_stdio(false), cin.tie(NULL)
#define fileIO freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef complex<ld> point;
typedef tuple<int, int, int> line;
typedef vector<point> polygon;
typedef pair<double, double> pd;
pair<int, int> dirs[] = { {1, 2}, {-1, 2}, {2, 1}, {2, -1}, {-2, 1}, {-2, -1}, {1, -2}, {-1, -2} };
const ll mod = 1e9 + 7;
const ll N = 2e6 + 7;
ll fact[N];



int main() {
	fastIO;
	int n, k;
	cin >> n >> k;
	int cnt = 0;
	while(n) {
		n /= k;
		cnt++;
	}
	cout << cnt;

}



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

/*freopen("testcases/17.in", "r", stdin);
    freopen("output.txt", "w", stdout);*/

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	double a,b;
	int g1,g2;
	cin >> a >> b;
	g1=ceil(a/0.08);
	g2=ceil(b/0.1);
	if(floor((double)max(g1,g2)*0.08)==a && floor((double)max(g1,g2)*0.1)==b)
        cout << max(g1,g2);
    else
        cout << -1;
}


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

int main(void){
    int n, t, a;
    cin >> n >> t >> a;

    int res = 0;
    double tmp;
    double min_t = 100001;
    vector<int> h(n);
    rep(i, n){
        cin >> h.at(i);
        tmp = abs(a-((double)t-(double)h.at(i)*0.006));
        if(min_t > tmp){
            min_t = tmp;
            res = i+1;
        }
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256