akhauriyash/Code-Regression huggingface dataset:
fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toInt() }.toMutableList()
    aa.add(0)

    val fees = aa.mapIndexed { idx, a ->
        if (idx == 0) {
            Math.abs(a)
        } else if (idx == n) {
            Math.abs(aa[n-1])
        } else {
            Math.abs(a-aa[idx-1])
        }
    }

    val feesSum = fees.sum()

    val ans = mutableListOf<Int>()
    for (i in 0 until n) {
        var tmp = feesSum - fees[i] - fees[i+1]
        if (i == 0) {
            tmp += Math.abs(aa[i+1])
        } else {
            tmp += Math.abs(aa[i+1]-aa[i-1])
        }
        ans.add(tmp)
    }

    println(ans.joinToString(separator = System.lineSeparator()))
}

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

int main()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	if(a+b==c || a+c==b || c+b==a)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}
return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
#define Inf 0x3f3f3f3f3f3f3f3f
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define REP(i, s, t) for (int i = (s), i##ed = (t); i <= i##ed; i ++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
template <typename T> void chkmax(T &x, T y) { x = x > y ? x : y; }
template <typename T> void chkmin(T &x, T y) { x = x < y ? x : y; }
template <typename T> void read(T &x) {
  x = 0; bool w = 0; char ch = 0;
  for (; !isdigit(ch); ch = getchar()) w |= ch == '-';
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  x *= w ? -1 : 1;
}
template <typename T> void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <typename T> void write(T x, char ch) { write(x); putchar(ch); }
template <typename T> void writeln(T x) { write(x); puts(""); }

const int N = 2e5 + 5;
int n;
ll a[N];
ll ans = 0;
int main() {
  read(n);
  for (int i = 1; i <= n; i ++) read(a[i]);
  int l = 1, r = 1, sumx = a[1], sum = a[1];
  for (int i = 1; i <= n; i ++) {
    while ((sumx == sum) && r <= n) {
      ++ r; 
      sum += a[r]; sumx ^= a[r];  
    }
    ans += r - l;
    sumx ^= a[l]; sum -= a[l]; 
    ++ l; 
    if (r < l) r = l;
  }
  writeln(ans);
  return 0; 
}

Measured memory_bytes: 1792
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	int A[100000 + 1] = {0};
	long long S = 0;
	for (int i = 0; i < N; i++) {
		int a;
	 	scanf("%d", &a);
		A[a]++;
		S += a;
	}

	int Q;
	scanf("%d", &Q);
	for (int i = 0; i < Q; i++) {
		int B, C;
		scanf("%d%d", &B, &C);
		printf("%lld\n", S += (C - B) * A[B]);
		A[C] += A[B];
		A[B] = 0;
	}
	return 0;
}


Measured memory_bytes: 2100
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef map<int,int> mii;
typedef vector<int>vi;
#define pb push_back
#define sc(n) scanf("%d",&n)
#define lsc(n) scanf("%lld",&n)
#define all(x) x.begin(),x.end()
#define rep(i,n) for(i=0;i<n;i++)
#define rep1(i,n) for(i=1;i<=n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define rev1(i,n) for(i=n;i>0;i--)
#define in insert
#define IT ::iterator
#define pr(n) printf("%d\n",n)
#define lpr(n) printf("%lld\n",n);


int main()
{
	ll n,k,i;
	lsc(n);lsc(k);
	ll a[n];
	rep(i,n)
	{
		lsc(a[i]);
	}
	sort(a,a+n);
	ll s=0LL;
	rep(i,k)
	{
		s+=a[i];
	}
	cout << s;
    return 0;
}


Measured memory_bytes: 3692
#include <bits/stdc++.h> 
using namespace std;
#define     mod             1e9+7
#define     ll              long long
#define     mp              make_pair
#define     t()             int test;cin>>test;while(test--)
#define     setbits(x)      __builtin_popcountll(x)
#define     si              set<int>
#define     ii              pair<int,int>
#define     vi              vector<int>
#define     que_max         priority_queue <int>
#define     que_min         priority_queue <int, vi, greater<int>>
#define     IOS             ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define     endl            '\n'

/*
	For Debugging we have define TRACE.
*/

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif  

const int N = 1e7 + 5;
int a[N];
int reach [10000001];


void solve(){

	int n;
	cin>>n;
	if(n>=400 && n<=599) cout<<"8";
	else if(n >= 600 && n<=799) cout<<"7";
	else if(n >= 800 && n<=999) cout<<"6";
	else if(n >=1000 && n<=1199) cout<<"5";
	else if(n>=1200 && n<=1399) cout<<"4";
	else if(n>=1400 && n<=1599) cout<<"3";
	else if(n>=1600 && n<=1799) cout<<"2";
	else if(n>=1800 && n<=1999) cout<<"1";



}
 
int32_t main()
 
{  
    #ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    #endif

    IOS;
    solve();


}








Measured memory_bytes: 3608
#include<iostream>

using namespace std;

int main(){
  int a,b,c, answer;
  int i;
  answer = 0;
  cin >> a;
  for(c = 1;c <= a;c++){
    i  = 0;
      if(c%2==0){}
      else{
        for(b = 1;b <= c;b++){
          if(c%b==0){
          i++;
        }
      }
    }
    if(i==8){
    answer++;
  }
}
cout << answer << endl;
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int Maxn=100005,p=1e9+7;
string str;
int n;
long long T,p10[Maxn],f[15],tmp[15];
int main()
{
	cin>>str;
	n=str.size();
	p10[0]=1;
	for(int i=1;i<=n;i++)
		p10[i]=p10[i-1]*10%13;
	f[0]=1;
	for(int i=0;i<n;i++)
		if(str[i]!='?')
			T+=p10[n-i-1]*(str[i]-'0')%13,T%=13;
	for(int i=0;i<n;i++)
	{
		if(str[i]!='?') continue;
		for(int j=0;j<13;j++)
			tmp[j]=f[j],f[j]=0;
		for(int k=0;k<13;k++)
			for(int j=0;j<10;j++)
				f[(k+p10[n-i-1]*j%13)%13]=(f[(k+p10[n-i-1]*j%13)%13]+tmp[k])%p;
	}
	printf("%lld",f[(18-T)%13]);
	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

int main() {
  int n;
  cin >> n;
  int arr[n];
  map <int, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    cnt[arr[i]]++;
  }
  long long ans = 0;
  for (auto it : cnt) {
    ans += 1ll * (it.second) * (it.second - 1) / 2;
  }
  for (int i = 0; i < n; i++) {
    int x = cnt[arr[i]];
    ans -= 1ll * x * (x - 1) / 2;
    ans += 1ll * (x - 1) * (x - 2) / 2;
    cout << ans << endl;
    ans -= 1ll * (x - 1) * (x - 2) / 2;
    ans += 1ll * x * (x - 1) / 2;
  }
  return 0;
}


Measured memory_bytes: 8320
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};

int a,b,c,x,y;
ll a_[100010],b_[100010],c_[100010];
ll C[100010];

void solve(){
    cin >> x >> y >> a >> b >> c;
    rep(i,a) cin >> a_[i];
    rep(i,b) cin >> b_[i];
    rep(i,c) cin >> c_[i];
    vector<P> v;
    rep(i,a){
        v.push_back(P(a_[i],0));
    }
    rep(i,b){
        v.push_back(P(b_[i],1));
    }
    sort(v.begin(),v.end());
    sort(c_,c_+c);
    reverse(v.begin(),v.end());
    reverse(c_,c_+c);
    rep(i,c){
        C[i+1]=C[i]+c_[i];
    }
    ll ans=0,sum=0,pre_a=0,pre_b=0,k=0;
    if(c>=x+y){
        ans=C[x+y];
    }
    Rep(i,1,x+y+1){
        while(pre_a==x && v[k].second==0){
            k+=1;
        }
        while(pre_b==y && v[k].second==1){
            k+=1;
        }
        sum+=v[k].first;
        if(v[k].second==0) pre_a+=1;
        else pre_b+=1;
        //cout << v[k].first << " " << v[k].second << endl;
        k+=1;
        if(x+y-i>c) continue;
        ll res=C[x+y-i];
        //cout << sum+res << endl;
        ans=max(ans,sum+res);
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 5104
#include<stdio.h>

int dp[10][10][100];

int main(){
  int i, j, k, n, s;
  dp[0][0][0] = dp[0][1][0] = 1;
  for(i = 1;i < 10;i++){
    for(j = 0;j < 10;j++){
      for(k = 0;k < 100;k++){
	dp[i][j][k] = dp[i - 1][j][k];
	if(k - i >= 0 && j > 0){
	  dp[i][j][k] += dp[i - 1][j - 1][k - i];
	}
      }
    }
  }
  while(1){
    scanf("%d%d", &n, &s);
    if(n == 0 && s == 0)return 0;
    if(s >= 100)puts("0");
    else printf("%d\n", dp[9][n][s]);
  }
}

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

struct Node{
  int key;
  struct Node *parent, *left, *right;
};

struct Node *root, *NIL;

void insert(int k){
  
  struct Node *y = NIL;
  struct Node *x = root;
  struct Node *z;

  z=(struct Node *)malloc(sizeof(struct Node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x!=NIL){
    y=x;
    if(z->key < x->key){
      x=x->left;
    }else{
      x=x->right;
    }
  }
  
  z->parent = y;
  if(y==NIL){
    root=z;
  }else{
    if(z->key < y->key){
      y->left=z;
    }else{
      y->right=z;

    }
  }
}


void inorder(struct Node *u){
  if(u==NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(struct Node *u){
  if(u==NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}

int main(){
  int n,i,x;
  char com[10];
  
  scanf("%d",&n);

  
  for(i=0;i<n;i++){
    scanf("%s",com);
    if(strcmp(com,"insert")==0){
      scanf("%d",&x);
      insert(x);
    }else if(strcmp(com,"print")==0){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  
  return 0;
}

    
 
    
    



Measured memory_bytes: 25184
#include<iostream>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

class question {
public:
	ll A, B, C;
	
	void ans() {
		cin >> A >> B >> C;
		ll res;
		if (A == B && B == C && A % 2 == 0) res = -1;
		else {
			res = 0;
			while (A % 2 == 0 && B % 2 == 0 && C % 2 == 0) {
				res++;
				ll a = B + C, b = A + C, c = A + B;
				A = a / 2;
				B = b / 2;
				C = c / 2;
			}
		}
		cout << res << "\n";
	}

};

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	question q;
	q.ans();
	
	return 0;
}





Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define nn 100008
#define int long long 

struct fs{
	int x,y;
	fs(int a=0,int b=0){
		x=a,y=b;
	}
	void refresh(){
		int d=__gcd(x,y);
		x/=d,y/=d;
	}
}; 
bool operator<(fs a,fs b){
	return (a.x*b.y<a.y*b.x);
}


int n,ai[nn],bi[nn];
int sum[nn];vector<int> ap;
signed main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++) scanf("%lld%lld",&ai[i],&bi[i]);
	
	int base=0;
	for(int i=1;i<=n;i++) if(bi[i]>ai[i]){
		base+=bi[i]-ai[i];
		ap.push_back(bi[i]);
	}	
	else{
		ap.push_back(ai[i]);
	}
	sort(ap.begin(),ap.end());
	sum[0]=ap[0];for(int i=1;i<ap.size();i++) sum[i]=sum[i-1]+ap[i];
	
	int l=1,r=n-1;int res=0;
	while(l<=r){
		int mid=(l+r)/2;
		int ans=base;
		for(int i=0;i<mid;i++) ans-=ap[i];
		
		if(ans>=0) 
			res=mid,l=mid+1;
		else r=mid-1;
	}
	
	fs ans=fs(0,1);
	
	for(int i=1;i<=n;i++){
		int ui;
		if(bi[i]>ai[i]){
			ui=base;-ai[i]+bi[i];
			if(ap[res]>=bi[i]) ui-=sum[res]-bi[i];
			else if(res) ui-=sum[res-1];
		}
		else{
			ui=base-ai[i]+bi[i];
			if(ap[res]>=ai[i]) ui-=sum[res]-ai[i];
			else if(res) ui-=sum[res-1];
		}
		if(ui>=0) ans=max(ans,fs(ui,bi[i]));
	}
	
	ans.x=ans.x+ans.y*res;ans.y*=n;
	ans.refresh();
	cout<<ans.x<<" "<<ans.y;
	
	
	return 0;
} 

Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
int INF = 100;
int main(){
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vector<int> t(N);
  for (int i = 0; i < N; i++){
    cin >> t[i];
  }
  vector<int> v(N);
  for (int j = 0; j < N; j++){
    cin >> v[j];
  }
  vector<int> S(N + 1, 0);
  for (int i = 0; i < N; i++){
    S[i + 1] = S[i] + t[i] * 2;
  }
  int T = S[N];
  vector<double> V(T + 1, INF);
  for (int i = 0; i < N; i++){
    for (int j = S[i]; j <= S[i + 1]; j++){
      V[j] = min(V[j], (double) v[i]);
    }
  }
  V[0] = 0;
  for (int i = 1; i <= T; i++){
    V[i] = min(V[i], V[i - 1] + 0.5);
  }
  V[T] = 0;
  for (int i = T - 1; i >= 0; i--){
    V[i] = min(V[i], V[i + 1] + 0.5);
  }
  double ans = 0;
  for (int i = 0; i < T; i++){
    ans += V[i] + V[i + 1];
  }
  ans /= 4;
  cout << ans << endl;
}

Measured memory_bytes: 3800
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
    int n,t[100000],x[100000],y[100000];
    cin>>n;
    for(int i=0;i<n;i++)cin>>t[i]>>x[i]>>y[i];
    if((x[0]+y[0])%2!=t[0]%2||(x[0]+y[0])>t[0]){
            cout<<"No"<<endl;
            return 0;
        }
    for(int i=1;i<n;i++){
        if((abs(x[i]-x[i-1])+abs(y[i]-y[i-1]))%2!=(t[i]-t[i-1])%2||(abs(x[i]-x[i-1])+abs(y[i]-y[i-1]))>t[i]-t[i-1]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
int n;
int prime[1005];
void seive()
{
    prime[1]=1;
    for(int i=2;i<=1000;i++)
    {
        if(!prime[i])
        {
            for(int j=i+i;j<=1000;j+=i)
                prime[j]=1;
        }
    }
}
int po(int p)
{
    int ans=0;
    int x=n;
    while(x)
    {
        x/=p;
        ans+=x;

    }
    return ans;
}
int main()
{
    seive();
    scanf("%d",&n);
    long long int meghans=1;
    for(int i=1;i<=n;i++)
    {
        if(!prime[i])
        {
            meghans=(meghans*(1+po(i)))%mod;
        }
    }
    printf("%lld\n",meghans);
    return 0;
}



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

int main(){
  int a,b;
  cin >> a >> b;
  if(a >= 10 || b >= 10) cout << "-1" << endl;
  else cout << a*b << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<cstdio>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>

#include<stack>
#include<queue>
#include<time.h>
#include<set>
#include<map>
#include <iomanip>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll mod = 998244353;



pair<double, double>Z[51];
ll ans, N, K;

queue<ll>que;


ll X[55], Y[55];

int main() {

	int n;
	cin >> n;
	set<P> st;

	FOR(i, 0, n) {
		cin >> X[i] >> Y[i];
		st.insert(P(X[i], Y[i]));
	}
	vector <P>vx;

	int ret = 0;
	FOR(i, 0, n) {
		FOR(j, 0, n) {
			if (i == j)continue;
			P p = P(X[i] - X[j], Y[i] - Y[j]);
			int cnt = 0;
			FOR(k, 0, n) {
				P q = P(p.first + X[k], p.second + Y[k]);
				if (st.count(q))cnt++;
			}
			ret = max(ret, cnt);
		}
	}
	cout << n - ret << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int fav[40];

int main() {
    int n,m;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        int k;
        cin >> k;
        for (int j = 0; j < k; j++) {
            int tmp;
            cin >> tmp;
            fav[tmp]++;
        }
    }
    int ans = 0;
    for (int i = 1; i <= m; i++) {
        if (fav[i] == n) {
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;
const double PI = 3.1415926535897932;
const int MOD = 1e9 + 7;

//cin.tie(0);ios::sync_with_stdio(false);
int main() {
  ll n, k;
  cin >> n >> k;

  ll ans = 0;
  for (ll i = k; i <= n + 1; i++) {
    ll head = i * (i - 1) / 2;
    ll tail = i * (2*n - i + 1) / 2;
    //printf("k = %d : head = %lld, tail = %lld\n", i, head, tail);
    ans += tail - head + 1;
    ans %= MOD;
  }

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


Measured memory_bytes: 3632
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for(int i=0; i<n; i++) {
      cin >> v[i];
  }
  int q,m,M;
  cin >> q;
  for(int i=0; i<q; i++) {
      int a;
      cin >> a;
      if(a==0) {
          m=1000000001;
          int b,c;
          cin >> b >> c;
          for(int j=b; j<c; j++) {
              m=min(m,v[j]);
          }
          cout << m << endl;
      }
      else {
          M=-1000000001;
          int b,c;
          cin >> b >> c;
          for(int j=b; j<c; j++) {
              M=max(M,v[j]);
          }
          cout << M << endl;
      }
  }
}


Measured memory_bytes: 3108
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template<class T> T ceil(T a, T b) { return a / b + !!(a % b); }

int main() {
    int a, b; cin >> a >> b;
    cout << ceil(b - 1, a - 1) << endl;
    return 0;
}

Measured memory_bytes: 256
<?php
list($S)=sscanf(trim(fgets(STDIN)),"%s");
list($T)=sscanf(trim(fgets(STDIN)),"%s");
$cnt=0;
for($i=0;$i<3;$i++){
    if($S[$i] == $T[$i]){
        $cnt++;
    }
}
printf($cnt);


Measured memory_bytes: 4604
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                   \
  ifstream in("abc134/abc134_b.txt"); \
  cin.rdbuf(in.rdbuf());
#define print_vec(v) \
rep(l, v.size()) { cout << v[l] << " "; } \
cout << endl;
#else
#define INPUT_FILE
#define print_vec(v)
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
typedef pair<ll, ll> pl;
const int INF = 100100100;
const ll LINF = 1e18+100;
const int MOD = 1e9 + 7;

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N, D;
  cin >> N >> D;

  int ans = ceil(float(N) / (2 * D + 1));

  cout << ans << endl;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
//template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
signed main(){
  int a,b;
  cin>>a>>b;
  if(a==2){
    if(b==2)
    cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  else if(a==4||a==6||a==9||a==11){
    if(b==4||b==6||b==9||b==11)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  else {
    if(b!=2&&b!=4&&b!=6&&b!=9&&b!=11)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
}


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

bool prime(int x) {
    if (x<2) return false;
    if (x==2) return true;
  if (x%2==0) return false;
    for (int i=3;i*i<=x;i++)
        if (x%i==0)
            return false;
    return true;
}

int main() {
    int x;cin>>x;
    for (int i=x;;i++)
        if (prime(i)) {
            cout<<i<<endl;
            return 0;
        }
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define speedX ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
template<typename T>
void __p(T a) { cout << a << " "; }
template<typename T, typename F>
void __p(pair<T, F> a) { cout << "{ "; __p(a.first); __p(a.second); cout << "}"; }
template<typename T>
void __f(const char* s, T t) { cout << s << " : "; __p(t); }
template<typename T>
void __t(const char* s, const T &x) { cout << s << " : { "; for (auto it : x) __p(it); cout << "} ";}
template<typename T, typename ... F>
void __f(const char* s, T t, F ... f) {
	int i = 0; for (;; ++i) if (s[i] == ',') break;
	cout.write(s, i) << " : "; __p(t); cout << " | "; __f(s + i + 1, f...);
}
#define trace(...) { cout<<"LINE: "<<__LINE__<<" || "; __f(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
#define debug(...) { cout<<"LINE: "<<__LINE__<<" || "; __t(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
int begtime = clock();
#define end_time() cout << "\n\nTime of execution: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define trace(...)
#define debug(...) 
#define end_time()
#endif
 
 
#define int long long 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef vector<int> vi;
typedef vector<pii> vii;

inline bool equals(ld a, ld b) {return fabs(a - b) < 1e-9;}
inline int gcd(int a, int b) { a=abs(a); b=abs(b); while(a>0 && b>0) (a>b?a%=b:b%=a); return (a==0?b:a); } 
inline int power(int x, int n, int m = LLONG_MAX)
    {  int res=1; x = (x%m + m)%m;
       while(n) { if(n&1) res=(res*x)%m;  x=(x*x)%m;  n >>= 1; }  return res;
    }
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define uset unordered_set
#define umap unordered_map
#define all(x) x.begin(), x.end()
#define mod 1000000007

void solve(){
	int d,y,s;
	cin>>d>>y>>s;
	if(d<=(y*s)) cout<<"Yes";
	else cout<<"No";
}
signed main(){
	speedX;
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
	int t=1;
	//cin>>t;
	for(int i=1;i<=t;++i) {
		//cout<<"Case #"<<i<<": ";
		solve();
	}
	end_time();
	return 0;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define endl "\n"
#define MAXN 100123
#define ll long long
#define ull unsigned long long
#define INF INT_MAX
#define FORE(i,m,n) for(int i=m;i<n;i++)
#define FOR(i,n) FORE(i,0,n)
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define ps(v) push_back(v)
#define ms(v,x) memset(v,x,sizeof(v)) 
#define PI M_PI
using namespace std;

// cout << fixed << setprecision(4);

ull n;
ull a,b,maior;

ull resul(ull x){
    return (ull)((a*x)/b) - a*((ull)(x/b));
}

int main(){_
    cin >> a >> b >> n;

    maior = resul(min(b-1,n));
    cout << maior << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>    
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//using namespace __gnu_pbds; 
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb  push_back
#define show(x) cout<<(#x)<<" : "<<x<<endl;
#define ll  long long
#define ld  long double
#define fill(a,val) memset(a,val,sizeof(a))
#define mp  make_pair
#define ff  first
#define ss  second
#define pii pair<ll,ll>
#define sq(x) ((x)*(x))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define endl "\n"
#define int long long 
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
const ll MOD     = 1000*1000*1000+7;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7;
const ll MOD2    = 998244353;
const ll N       = 2000 * 100 + 10;
const ll N2      = 70;
const ld PI  = 3.141592653589793;
//template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);} 
ll power(ll x,ll y,ll p = LLONG_MAX ){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
ll lcm(ll a , ll b){return (a*b)/gcd(a,b);}
int a[N] , si[N];
void initialize(int n)
{
    for (int i = 0; i < n; ++i)
    {
        a[i] = i;
        si[i] = 1;
    }
}
int root(int i )
{
    while(a[i]!=i)
        i = a[i];
    return i;
}
bool find(int A , int B)
{
    return (root(A)==root(B));
}
void weighted_union(int A , int B)
{
    int root_A = root(A);
    int root_B = root(B);
    if(si[root_A]<si[root_B])
    {
        a[root_A] = a[root_B];
        si[root_B]+=si[root_A];
    }
    else
    {
        a[root_B] = a[root_A];
        si[root_A]+=si[root_B];
    }
}
signed main()
{
    fastio();
    //cout<<fixed<<setprecision(20);
    //CHECK for LONG LONG and LONG DOUBLE
    //*comment for all except cc/cf    
    #ifndef ONLINE_JUDGE    
           freopen("input.txt","r",stdin);
           freopen("output.txt","w",stdout);
    #endif//*/
    int n,m;
    cin>>n>>m;
    initialize(n);
    set<pii> s;
    for (int i = 0; i < m; ++i)
    {
        int x,y;
        cin>>x>>y;
        x--;y--;
        s.insert({max(x,y),min(x,y)});
    }
    for(auto x : s)
    {
        if(!find(x.ff,x.ss))
            weighted_union(x.ff,x.ss);
    }
    int ans = 1;
    for (int i = 0; i < n; ++i)
    {
        ans = max(ans,si[root(i)]);
    }
    cout<<ans;


    printclock;
    return 0;
}

Measured memory_bytes: 19464
var
	c,i:Longint;
	S:String[4];
	cnt:Array[1..600]of Longint;
begin
	readln(S);
	for i:=1 to length(S) do begin
		inc(cnt[ord(S[i])]);
		if cnt[ord(S[i])]=2 then inc(c);
	end;
	if c=2 then writeln('Yes')else writeln('No');
end.


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

int main(){

  int a,b,num = 0;
  double ans = 0,count = 0,ave;
  char c;

  while(cin >> a >> c >> b){

    ans = a * b + ans;
    num = num + b;
    count++;

  }

  ave = num/count;
  ave += 0.5;
  num = ave;

  printf("%.0lf\n%d\n",ans,num);
} 

Measured memory_bytes: 1188
n,k = map(int, input().split())
str = input()
str_list = list(str)

# リストの3番目の要素を'z'で上書き
if str[k-1] == "A":
    str_list[k-1] = 'a'
elif str[k-1] == "B":
    str_list[k-1] = 'b'
elif str[k-1] == "C":
    str_list[k-1] = 'c'

# またリストから文字列へ戻す
str_changed = "".join(str_list)
print(str_changed)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
#define pll pair<lld,lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define mod 1000000007
#define answer cout<<endl<<"answer : ";
#define messi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main() {messi //lld t=0;cin>>t;while(t--){
        lld n=0,m=0,k=0,i=0,j=0,p=0,q=0,x=0,y=0,z=0,ans=0,cnt=0;string s;bool flag=false;
        lld w;
        cin>>n>>w;
        lld wt[n+1];
        lld val[n+1];
        for(i=1;i<=n;i++)
            cin>>wt[i]>>val[i];
        lld dp[n+1][w+1];
        memset(dp,0,sizeof(dp));
        for(i=1;i<=n;i++)
        {
            for(j=1;j<=w;j++)
               {
                   dp[i][j]=dp[i-1][j];
                   if(j-wt[i]>=0)
                    dp[i][j]=max(dp[i][j],val[i]+dp[i-1][j-wt[i]]);
               }
        }
        cout<<dp[n][w]<<endl;
    //}
	return 0;
}
/*  CODED BY:-
           __        __
 /\   /\  |__)  /\  |  \ |__| \ /  /\
/~~\ /~~\ |  \ /~~\ |__/ |  |  |  /~~\

*/


Measured memory_bytes: 79232
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define all(v) v.begin(), v.end()
#define SENTINEL 2000000000
#define NIL -1
using namespace std;
typedef long long ll;


const ll MAX = 510000;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template <class T>inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}

int main()
{
    int n,x,t;
    cin >> n >> x >> t;
    if(n%x==0){
        cout << t*(n/x) << endl;
    }
    else{
        cout << t*(n/x+1) << endl;
    }
}


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

int main(){
    string s;
    cin>>s;
    bool flgn=false,flgw=false,flgs=false,flge=false;
    for(int i=0;i<s.size();i++){
        if(s[i]=='N') flgn=true;
        else if(s[i]=='W') flgw=true;
        else if(s[i]=='S') flgs=true;
        else flge=true;
    }
    if(!flgn!=!flgs || !flgw!=!flge) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <queue>
using namespace std;

typedef unsigned int uint;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vint;
typedef vector<uint> vuint;
typedef vector<ull> vull;
typedef vector<ll> vll;

#define init(type,var) type var;cin>>var;
#define vinit(type,var,n) vector<type> var((uint)n);loop(i,0,n)cin>>var[i];
#define range(container) container.begin(),container.end()
#define loop(i,first,end) for(ull i=(first);i<(end);i++)
#define outl(out) cout<<(out)<<endl;

const ull INF = (ull)(-1LL);

typedef ll dint;

int main(void){
	init(dint, n);
	init(dint, m);
	priority_queue<dint> a;
	loop(i, 0, n){
		dint _a;
		cin >> _a;
		a.push(_a);
	}

	loop(i, 0, m){
		dint max = a.top();
		a.pop();
		a.push(max / 2);
	}
	

	dint v = 0;
	loop(i, 0, n){
		v += a.top();
		a.pop();
	}
	outl(v);

	return 0;
}

Measured memory_bytes: 1528
#include <cstdio>
#include <algorithm>
using namespace std;
#define INF 1000000
int C[30][30];
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            C[i][j]=i==j?0:INF;
        }
    }
    for(int i=0;i<m;++i){
        int a,b,c,d;
        scanf("%d,%d,%d,%d",&a,&b,&c,&d);
        a--;b--;
        C[a][b]=c;
        C[b][a]=d;
    }
    for(int k=0;k<n;++k){
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j){
                C[i][j]=min(C[i][j],C[i][k]+C[k][j]);
            }
        }
    }
    int a,b,c,d;
    scanf("%d,%d,%d,%d",&a,&b,&c,&d);
    a--;b--;
    printf("%d\n",c-d-C[a][b]-C[b][a]);
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    int count[100001] = {};
    int num;
    for(int i=0;i<N;i++){
        cin >> num;
        count[num]++;
        if(0<num)
            count[num-1]++;
        if(num<100000)
            count[num+1]++;
    }
    int max = 0;
    for(int i=0;i<100001;i++){
        if(max < count[i])
            max = count[i];
    }
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 768
N,K=map(int,input().split())
*P,=map(int, input().split())

E2=[p+1 for p in P]
for i in range(N-1): E2[i+1]+=E2[i]
E2=[0]+E2

ans2=0
for i in range(N-K+1):
    ans2 = max(ans2, E2[i+K]-E2[i])
print(ans2/2)

Measured memory_bytes: 80008
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD = 1000000007;
#define IsInteger(a) (fabs((a)-round(a)) < 0.00001)
#define SWAP(a, b)        \
    {                     \
        auto swapvar = a; \
        a = b;            \
        b = swapvar;      \
    }

#define lcm(x, y) ((x) * (y) / __gcd((x), (y)))
#define sz(a) (long long)((a).size())
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define debug(x) cout << #x << " : " << x << endl
#define part cout << "----------------------------------\n";
#define mp make_pair
#include <iostream>

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1}; // trick to explore an implicit 2D grid
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; // S,SE,E,NE,N,NW,W,SW neighbors  //GO FOR EVEN FOR 4 moves

#define fastinput                     \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

bool comp(LL a, LL b)
{
    return b < a;
}
int main()
{
    fastinput;
    LL n, i, j, k, t, temp, x, y, a, c, b, d;
    cin >> x >> y >> a >> b >> c;
    vector<LL> v1, v2, v3;
    for (i = 0; i < a; i++)
    {
        cin >> t;
        v1.pb(t);
    }
    for (i = 0; i < b; i++)
    {
        cin >> t;
        v2.pb(t);
    }
    for (i = 0; i < c; i++)
    {
        cin >> t;
        v3.pb(t);
    }
    sort(all(v1), comp);
    sort(all(v2), comp);
    sort(all(v3), comp);
    LL sum = 0;
    for (i = 0; i < x; i++)
    {
        sum += v1[i];
    }
    for (i = 0; i < y; i++)
    {
        sum += v2[i];
    }

    LL now = 0;
    LL ptr_a = x - 1, ptr_b = y - 1;
    while (now < c)
    {
        if (ptr_a >= 0 && ptr_b >= 0)
        {
            LL minima = min(v1[ptr_a], v2[ptr_b]);
            if (minima >= v3[now])
            {
                break;
            }
            else
            {
                sum += v3[now] - minima;

                if (minima == v1[ptr_a])
                {
                    ptr_a--;
                }
                else
                {
                    ptr_b--;
                }
                now++;
            }
        }
        else if (ptr_a < 0 && ptr_b < 0)
        {
            break;
        }
        else if (ptr_a >= 0)
        {
            LL minima = v1[ptr_a];

            if (minima >= v3[now])
            {
                break;
            }
            else
            {
                sum += v3[now] - minima;

                ptr_a--;
            }
            now++;
        }
        else
        {
            LL minima = v2[ptr_b];

            if (minima >= v3[now])
            {
                break;
            }
            else
            {
                sum += v3[now] - minima;

                ptr_b--;
            }
            now++;
        }
    }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

ll solve(ll a, ll b)
{
	if (a > b) swap(a, b);
	if (a == 0) return 0;
	ll res = a * 2 * (b / a);
	if (b%a == 0) res -= a;
	return res + solve(a, b % a);
}

int main()
{
	cin.sync_with_stdio(false);
	ll n, x;
	while (cin >> n >> x) {
		cout << solve(n - x, x) + n << endl;
		/*
		if (n % 2ll)
		{
			cout << n / 2ll * 6ll << endl;
		}
		else
		{
			if (x > n / 2ll) x = n - x;
			cout << (n-x) * 3ll << endl;
	}*/
	}
	return 0;
}

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

typedef long long ll;
typedef pair<int, pair<int, int>> piii;
//loop
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
//STL
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

//const
#define MOD 1000000007 //10^9+7:合同式の法

//acronym
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素

const int INF = 1e9;

#define deg_to_rad(deg) ((deg)*M_PI / 180.0)

// const int MOD = 998244353;

void Main()
{
    int R, G;
    cin >> R >> G;

    cout << R + (G - R) * 2 << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    Main();
    return 0;
}


Measured memory_bytes: 3644
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
ld EPS = 1e-12;
int INF = numeric_limits<int>::max() / 2;
int MOD = 1e9 + 7;
#define rep(i,n) for(int i=0;i<n;i++)

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

    int n, m;
	cin >> n >> m;
	vector<int> p(m), y(m), s(m);
	vector<vector<pair<int, int> > > v(n+1);

	for(int i = 0; i < m; i++){
		cin >> p[i] >> y[i];
		v[p[i]].push_back(pair<int, int>(y[i], i));
	}

	for(int i = 1; i <= n; i++){
		sort(v[i].begin(), v[i].end());
		for(int j = 0; j < v[i].size(); j++){
			s[v[i][j].second] = j + 1;
		}
	}

    for(int i = 0; i < m; i++){
        string zen = to_string(s[i]);
        while(zen.size()<6){zen="0"+zen;}
        string kou = to_string(p[i]);
        while(kou.size()<6){kou="0"+kou;}
        cout << kou << zen <<endl;
    }
}


Measured memory_bytes: 8192
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;

int gcd(int a, int b) {//最大公約数
	if (b == 0)return a;
	return gcd(b, a%b);
}
int lcm(int a, int b) {//最小公倍数
	int g = gcd(a, b);
	return a / g * b;
}

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

	int A, B, C;
	cin >> A >> B >> C;
	int N= gcd(A, B);
	A /= N;
	B /= N;

	//cout << A << B << endl;
	cout << A * B*C << endl;
	return 0;
}




Measured memory_bytes: 3224
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <iomanip>
#include <cmath>
#include <queue>
#include <bitset>
#include <numeric>
#include <array>
#include <cstring>
#include <random>
#include <chrono>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {

  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  ll a, b, c, d;

  cin >> a >> b >> c >> d;

  cout << max(a * c, max(a * d, max(b * c, b * d))) << endl;

  return 0;
}
/*

*/


Measured memory_bytes: 3668
N = int(input())
# cnt[i][j] := 先頭がi, 末尾がjで始まるような数
cnt = [[0] * 10 for i in range(10)]
for n in range(1, N + 1):
    cnt[int(str(n)[0])][int(str(n)[-1])] += 1

ans = 0
for i in range(10):
    for j in range(10):
        ans += cnt[i][j] * cnt[j][i]

print(ans)

Measured memory_bytes: 3060
def main():
    MOD=10**9+7
    s="0"+input()
    dp=[[0]*len(s)for i in range(13)]
    dp[0][0]=1
    for k,j in enumerate(s[1:]):
        for i in range(13):
            if dp[i][k]:
                if j=="?":
                    for r in range(10):
                        dp[(10*i+r)%13][k+1]+=dp[i][k]%MOD
                else:
                    dp[int(str(i)+j)%13][k+1]+=dp[i][k]%MOD
    print(dp[5][-1]%MOD)
if __name__ == '__main__':
    main()

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

int main(){

    int N;
    long long K;
    cin >> N >> K;
    vector<int> A(N+1);
    for(int i=1;i<=N;i++)
        cin >> A[i];

    int now = 1;
    long long rest = K;
    int result;
    int loop_start = -1;
    int dist = 1;
    bool flags[N+1];
    for(int i=0;i<=N;i++)
        flags[i] = false;

    while(1){
        int next = A[now];

        if(rest-- == 0){
            result = now;
            break;
        }

        else{
            if(loop_start < 0){ //ループを探索
                if(flags[next])
                    loop_start = next;
                else
                    flags[next] = true;  
            }

            else{ //１ループの長さを探索
                if(next == loop_start)
                    rest %= dist; //ループできるだけループする
                else
                    dist++;
            }
            now = next;
        }
    }

    cout << result;
    return 0;
}

Measured memory_bytes: 4288
#include<stdio.h>

int main(){
char p[10],pp[4][4];
bool f1=false;
char ch;

while(scanf("%s",p)!=EOF){
int R=0;f1=false;

for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
{pp[j][i]=p[R];R++;}

for(int i=0;i<3;i++)
if(pp[i][0]==pp[i][1]&&pp[i][0]==pp[i][2]){if(pp[i][0]!='s')ch=pp[i][0];}

for(int i=0;i<3;i++)
if(pp[0][i]==pp[1][i]&&pp[0][i]==pp[2][i]){if(pp[0][i]!='s')ch=pp[0][i];}

if(pp[0][0]==pp[1][1]&&pp[0][0]==pp[2][2]){if(pp[0][0]!='s')ch=pp[0][0];}

if(pp[0][2]==pp[1][1]&&pp[0][2]==pp[2][0]){if(pp[0][2]!='s')ch=pp[0][2];}

if(ch!='s')printf("%c\n",ch);
else printf("d\n");
ch='s';
}
return 0;
}

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

typedef int64_t Int;
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

int main() {
    Int x;
    cin >> x;
    Int cur = 100;
    Int cnt = 0;
    while (cur < x) {
        Int add = (double)cur * 0.01;
        cur += add;
        cnt++;
    }
    print(cnt);
    return 0;
}

Measured memory_bytes: 3592
#include<stdio.h>
int main()
{
    char s[4];
    scanf("%s",s);
    if(s[0]=='A'&&s[1]=='B'&&s[2]=='C')
    {
        printf("ARC\n");
    }
    else
    {
          printf("ABC\n");
    }
    
}

Measured memory_bytes: 1656
// Best dish by Chef at the Michelin's, Vatican
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
#endif
	int n, m, a, b;
	cin >> n >> m >> a >> b;
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= m; ++j) {
			printf("%c", "01"[(i <= b) == (j <= a)]);
		}
		printf("\n");
	}
	return 0;
}



Measured memory_bytes: 1280
from collections import defaultdict
n = int(input())
l = []
for i in range(2,144):
    l.append(i)
dic = defaultdict(int)
for i in range(142):
    for j in range(i, 142):
        for k in range(j, 142):
            
            if (l[i]+l[j]+l[k])%2==0 and 2+l[i]<=l[k]+l[j] and 2+l[k]<=l[i]+l[j] and 2+l[j]<=l[i]+l[k]:
                
                if i==j and j==k:
                    dic[l[i]**2+l[j]**2+l[k]**2]+=1
                elif i==j or j==k or i==k:
                    dic[l[i]**2+l[j]**2+l[k]**2]+=3
                else:
                    dic[l[i]**2+l[j]**2+l[k]**2]+=6

for i in range(1, n+1):
    print(dic[2*i])

Measured memory_bytes: 71668
#include <iostream>
#include<bits/stdc++.h>
#define rep(k,i,n) for(int i=k;i<n;++i)
using namespace std;
int main(void){
    // Your code here!
    int N,c=0;
    cin>>N;
    rep(0,i,N)if(i%2==0)++c;
    cout<<1.0*c/N<<endl;
}


Measured memory_bytes: 256
#include <cstdio>

using namespace std;

struct point
{
    int x,y;
};

point add (point a, point b)
{
    point c;
    c.x = a.x + b.x;
    c.y = a.y + b.y;

    return c;
}

point rotate90left (point a)
{
    int aux;
    aux = a.x;
    a.x = -a.y;
    a.y = aux;

    return a;
}

int main()
{
    point first, second, third, fourth;
    point distance;

    scanf("%d %d %d %d\n", &first.x, &first.y, &second.x, &second.y);

    distance.x = second.x - first.x;
    distance.y = second.y - first.y;

    third = add(second, rotate90left(distance));
    fourth = add(third, rotate90left(rotate90left(distance)));

    printf("%d %d %d %d\n", third.x, third.y, fourth.x, fourth.y);
    return 0;
}


Measured memory_bytes: 384