akhauriyash/Code-Regression huggingface dataset:
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#define pb push_back
using namespace std;

namespace Header_Template {
  typedef long long li;
  template<class T>inline void read(T &x) {
    x = 0;
    T tmp = 1;
    char c = getchar();
    while ((c < '0' || c > '9') && c != '-') c = getchar();
    if (c == '-') tmp = -1, c = getchar();
    while (c >= '0' && c <= '9')
      x = (x << 1) + (x << 3) + c - '0', c = getchar();
    x *= tmp;
  }
  template<class T>inline void Max(T &x, T y) {
    if (y > x) x = y;
  }
  template<class T>inline void Min(T &x, T y) {
    if (y < x) x = y;
  }
}
using namespace Header_Template;

int n, k, q;
vector<int> g;
multiset<int> a, b;
set<int> s;

int main(void) {
  read(n), read(k), read(q);
  for (int i = 1, x; i <= n; ++i) {
    read(x);
    g.pb(x);
    s.insert(x);
  }
  int ans = 1e9;
  for (int bound : s) {
    for (int x : g) {
      if (x >= bound) a.insert(x);
      else {
        while (a.size() >= k) {
          b.insert(*a.begin());
          a.erase(a.begin());
        }
        a.clear();
      }
    }
    while (a.size() >= k) {
      b.insert(*a.begin());
      a.erase(a.begin());
    }
    a.clear();
    if (b.size() < q) break;
    int low = *b.begin();
    for (int i = 1; i < q; ++i) b.erase(b.begin());
    int high = *b.begin();
    Min(ans, high - low);
    b.clear();
  }
  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
using P = pair <int, int>;
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; }

ll MOD = 1000000007;
ll INF =1<<30;

int main(){
    int n; string s; int k;
    cin >> n >>s >>k;
    rep(i,n){
        if(s[i]!=s[k-1]) s[i] ='*';
    }
    cout << s<<endl;
}

Measured memory_bytes: 3568
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

int a,b,c;

signed main(){
	read(a,b,c);
	a=max(a,b);
	write(c/a+(c%a>0));
}

Measured memory_bytes: 3584
using AtCoderBeginnerContest147.Questions;
using AtCoderBeginnerContest147.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace AtCoderBeginnerContest147.Questions
{
    public class QuestionB : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var s = inputStream.ReadLine();

            var count = 0;
            for (int i = 0; i < s.Length / 2; i++)
            {
                if (s[i] != s[s.Length - 1 - i])
                {
                    count++;
                }
            }

            yield return count;
        }
    }
}


namespace AtCoderBeginnerContest147
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionB();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace AtCoderBeginnerContest147.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace AtCoderBeginnerContest147.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

Measured memory_bytes: 13140
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <map>
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;

int n;
vector<int> tree[200001];
vector<int> type(200001);
vector<int> searched(200001);
vector<int> per(200001);
vector<int> used(200001);

void dfs(int now, int num){
	searched[now] = true;
	type[now] = num;
	for (int i = 0; i < tree[now].size(); i++){
		if (searched[tree[now][i]] == false){
			dfs(tree[now][i], (num+1)%2);
		}
	}
	return;
}


int main(){
 	cin >> n;
 	for (int i = 1; i < n; i++){
 		int a, b;
 		cin >> a >> b;
 		tree[a].push_back(b);
 		tree[b].push_back(a);
 	}
 	dfs(1, false);

 	int coun0 = 0, coun1 = 0;
 	int temp1 = 0, temp2 = 0;
 	int temp3 = -2, temp4 = -1;

 	for (int i = 1; i <= n; i++){
 		if (type[i] == 0) coun0++;
 		else coun1++;
 	}

 	if (coun0 <= n/3){
 		for (int i = 1; i <= n; i++){
 			if (type[i] == 0){
 				temp1 += 3;
 				per[i] = temp1;
 			}
 		}
 		for (int i = 1; i <= n; i++){
 			if (type[i] == 1){
 				if (temp1+3 <= n){
 					temp1 += 3;
 					per[i] = temp1;
 				}else{
 					temp2++;
 					if (temp2%3 == 0) temp2++;
 					per[i] = temp2;
 				}
 			}
 		}
 	}else if (coun1 <= n/3){
 		for (int i = 1; i <= n; i++){
 			if (type[i] == 1){
 				temp1 += 3;
 				per[i] = temp1;
 			}
 		}
 		for (int i = 1; i <= n; i++){
 			if (type[i] == 0){
 				if (temp1+3 <= n){
 					temp1 += 3;
 					per[i] = temp1;
 				}else{
 					temp2++;
 					if (temp2%3 == 0) temp2++;
 					per[i] = temp2;
 				}
 			}
 		}
 	}else{
 		for (int i = 1; i <= n; i++){
 			if (type[i] == 0){
 				if (temp3+3 <= n){
 					temp3 += 3;
 					per[i] = temp3;
 				}else{
 					temp1 += 3;
 					per[i] = temp1;
 				}
 			}else{
 				if (temp4+3 <= n){
 					temp4 += 3;
 					per[i] = temp4;
 				}else{
 					temp1 += 3;
 					per[i] = temp1;
 				}
 			}
 		}
 	}
 	for (int i = 1; i <= n; i++){
 		cout << per[i] << " ";
 	}
 	cout << endl;
	return 0;
}


Measured memory_bytes: 20992
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#include<deque>
#include<queue>
#include<set>
#include <functional>
#include <cmath>


//マクロ
/*動かない・・・
#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 _roverload3(_1,_2,_3,name,...) name
#define _rrep(i,n) repi(i,0,n)
#define rrepi(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(...) _roverload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
//*/
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define REPS(i,n) for(int i=1; i<=(int)(n); ++i)
#define RREP(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define RREPS(i,n) for(int i=(int)(n); i>0; --i)
#define FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)
//*/
#define All(a) (a).begin(),(a).end()
#define dump(x)  cerr << #x << " = " << (x) << endl;

//定数
#define INF 1e9
#define MOD (int)(1e9+7)

typedef long long ll;
typedef unsigned long long ull;
/*
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
//*/
using namespace std;

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数

//使用する関数
template<class T>bool chmax(T &a, const T &b) {
	if (a < b) { a = b; return 1; }
	return 0;
}
template<class T>bool chmin(T &a, const T &b) {
	if (a > b) { a = b; return 1; }
	return 0;
}

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

	int k,x;
	cin >> k >> x;
	cout << ((500 * k >= x) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){//gotoを使ってみよう
    string s;
    int n,k;
    std::cin >> n>>k;
    std::cin >> s;
    if(s.at(k-1)=='A'){
       s.at(k-1)='a' ;
    }else if(s.at(k-1)=='B'){
        s.at(k-1)='b';
    }else{
        s.at(k-1)='c';
    }
    std::cout << s << std::endl;
}

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

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

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)
#define MOD 1000000007

//debug
#define debug(arr) cerr<<#arr<<"(l"<<__LINE__<<") : ";for(auto x:arr)cerr<<x<<" ";cerr<<endl;

int main(){
  double L;
  cin >> L;
  double ans = (L/3.0) * (L/3.0) * (L/3.0);
  printf("%.7f\n", ans);
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<queue>

using namespace std;

int a,b,c,d,e,f;
int mwa;
int msu;

void solve(int i,int j){
  int tmpwa = 100*a*i+100*b*j;
  if(tmpwa > f) return;
  int tmpsu = min(f-tmpwa,tmpwa/100*e);
  int sudp[3000];for(int i=0;i<3000;i++)sudp[i] = 0;
  sudp[0] = 1;
  sudp[c] = 1;
  sudp[d] = 1;
  int tt = 0;
  for(int i=0;i<=tmpsu;i++){
    if((i-c >=0) && (sudp[i-c])) sudp[i] = 1;
    if((i-d >=0) && (sudp[i-d])) sudp[i] = 1;
    if(sudp[i]) tt = i;
  }

  if(sudp[tt]){
    //cout<<msu<<" "<<mwa<<" "<<tt<<" "<<tmpwa<<endl;
    //cout<<((tt+tmpwa)*msu)<<((mwa+msu)*tt)<<endl;
    if((tt+tmpwa)*msu < (mwa+msu)*tt){
      //cout<<tt<<endl;
      mwa = tmpwa;
      msu = tt;
    }
  }
}

int main(){

  cin>>a>>b>>c>>d>>e>>f;
    mwa = 100*a;
  for(int i=0;i<=30;i++){
    for(int j=0;j<30;j++){
      solve(i,j);
    }
  }
  cout<<(mwa+msu)<<" "<<msu<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
	long long W, H, x, y; cin >> W >> H >> x >> y;
	long double res = (long double)W * H / 2;
	cout << fixed << setprecision(6) << res << " ";
	if(2 * x == W && 2 * y == H) cout << "1" << endl;
	else cout << "0" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,s[65536],a[16][16],dp[65536];
signed main(){
	cin>>n;
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
			cin>>a[i][j];
	for(int i=0;i<(1<<n);i++)
		for(int j=0;j<n;j++)
			for(int k=j+1;k<n;k++)
				if(i>>j&1&&i>>k&1)
					s[i]+=a[j][k];
	for(int i=0;i<(1<<n);i++)
		for(int j=i;j;j=(j-1)&i)
			dp[i]=max(dp[i],s[j]+dp[i^j]);
	cout<<dp[(1<<n)-1]<<endl;
}

Measured memory_bytes: 1280
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[] line = br.readLine().split(",",0);
		
		System.out.println(line[0]+" "+line[1]+" "+line[2]);
	}
}


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

using namespace std;

int main()
{
    int a, b, c, k;

    cin >> a >> b >> c >> k;

    int ans = 0;

    if (a >= k)
    {
        ans = k;
    }
    else
    {
        k = k - a;

        if (b >= k)
        {
            ans = a;
        }
        else
        {
            k = k - b;

            ans = a - min(c, k);
        }
    }

    cout << ans << "\n";

    return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
#define MAX_MESSAGE_LEN 76

char table[10][6] = { { 0  , 0  , 0  , 0  , 0  , 0 },
                      { '.', ',', '!', '?', ' ', 0 },
                      { 'a', 'b', 'c', 0  , 0  , 0 },
                      { 'd', 'e', 'f', 0  , 0  , 0 },
                      { 'g', 'h', 'i', 0  , 0  , 0 },
                      { 'j', 'k', 'l', 0  , 0  , 0 },
                      { 'm', 'n', 'o', 0  , 0  , 0 },
                      { 'p', 'q', 'r', 's', 0  , 0 },
                      { 't', 'u', 'v', 0  , 0  , 0 },
                      { 'w', 'x', 'y', 'z', 0  , 0 } };

int main(void)
{
    char message[MAX_MESSAGE_LEN], ch;
    short len = 0, x, y;

    scanf("%*s%*c");

    while((ch = getchar()) != EOF)
    {
        if(ch == '\n')
        {
            message[len] = '\0';
            puts(message);
            len = x = y = 0;
        }

        else
        {
            ch = ch - '0';

            if(ch == 0)
            {
                if(table[y][x])
                    message[len++] = table[y][x];
                x = y = 0;
            }

            else if(ch == y)
            {
                x++;
                if(!table[y][x]) x = 0;
            }

            else
                y = ch, x = 0;
        }
    }

    return 0;
}

Measured memory_bytes: 524
from operator import itemgetter
N, M = map(int, raw_input().split())
a = []
b = []
for i in range(M):
	_a, _b = map(int, raw_input().split())
	a.append(_a)
	b.append(_b)

c = zip(a, b)
c.sort(key=itemgetter(0))
a, b = zip(*c)

c = 0
min_b = 0
for i in range(M):
	min_b = min(min_b, b[i])
	if a[i] < min_b:
		continue
	else:
		c += 1
		min_b = b[i]
print(c)


Measured memory_bytes: 27912
#include <bits/stdc++.h>
#define ALL(A) (A).begin(),(A).end()
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N = 0;
	cin >> N;
	vector<ll> A(N);
	rep(i,N)cin >> A[i];
	
	int right = 0;
	int sum = 0;
	ll ans = 0;
	for(int left = 0;left<N;left++){
		while(right < N && (sum^A[right]) == (sum + A[right])){
			sum += A[right];
			right++;
		}
		ans += right - left;
		if(right == left)right++;
		else sum -= A[left];
	}
	cout << ans << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<set>
using ll =  long long;

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

using namespace std;

int main(){

    int n;
    cin >> n;
    vector<int> ans(n);
    rep(i,n-1){
        int a;
        cin >> a;
        ans[a-1]++;
    }
    for(int x : ans){
        cout << x << endl;
    }


    return 0;
}

Measured memory_bytes: 4000
#include <cstdio>
int main(){
 int H,W;
 while(1){
  scanf("%d %d",&H,&W);
  if(!W&&!H){break;}
  for(int i=0;i<H;i++){
   for(int j=0;j<W;j++){
    putchar('#');
   }
   putchar('\n');
  }
 putchar('\n');
 }
}

Measured memory_bytes: 1000
#include <iostream>
using namespace std;
typedef long long ll;

ll n, s, a, ans, M=998244353, d[3005]={1};
int main() {
	cin >> n >> s;
	while(n--) {
		cin >> a;
		if(s >= a) (ans += d[s-a] * (n+1)) %= M;
		for(ll i=s-a-1; i>=0; i--) (d[i+a] += d[i]) %= M;
		d[0]++;
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
/*
Rathin Bhargava
IIIT Bangalore

*/
#include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==INF? cout<<"INF " : cout<<v[i]<<" "; } cout<<endl;}
#define t1(x)                cerr<<#x<<" : "<<x<<endl
#define t2(x, y)             cerr<<#x<<" : "<<x<<" "<<#y<<" : "<<y<<endl
#define t3(x, y, z)          cerr<<#x<<" : " <<x<<" "<<#y<<" : "<<y<<" "<<#z<<" : "<<z<<endl
#define t4(a,b,c,d)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<endl
#define t5(a,b,c,d,e)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<endl
#define t6(a,b,c,d,e,f)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<" "<<#f<<" : "<<f<<endl
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define t(...) GET_MACRO(__VA_ARGS__,t6,t5, t4, t3, t2, t1)(__VA_ARGS__)
#define _ cerr<<"here"<<endl;
#define __ {ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}

using namespace std;
template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &a){ return out<<"("<<a.first<<", "<<a.second<<")";}
template <int> ostream& operator<<(ostream& os, const vector<int>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { if(v[i]!=INF) os << v[i]; else os << "INF";if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { os << v[i]; ;if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 

int min(int x, int y)
{
  if(x<y) return x;
  return y;
}

int main()
{
  __;
  int n,w;
  cin >> n >> w;
  vector<vector<int> > dp(2,vector<int> (1e5+10,INF));

  // Base Case
  int weight,value;
  cin >> weight >> value;
  dp[0][value] = weight;
  dp[0][0] = 0;

  for(int i=1;i<n;i++)
  {
    cin >> weight >> value;
    int par = i&1;
    for(int j=0;j<=1e5;j++)
    {
      int a = (j >= value) ? dp[par^1][j-value] + weight: INF;
      if(a > w) a = INF;
      dp[par][j] = min(a,dp[par^1][j]);
    }
  }

  int ans = -1;
  for(int i=0;i<=1e5;i++)
  {
    int par = (n-1)&1;
    if(dp[par][i] - INF) ans = i; 
  }
  cout << ans << endl;
  return 0;
}

/*
3 8
3 1
4 2
5 4

*/

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
string s; Int D;
constexpr Int mod = 1e9 + 7;
Int solve(Int idx, Int cmod, bool bind,
vector<vector<vector<Int>>>&dp,vector<vector<vector<bool>>>&visit){
       Int res = 0;
       if(idx + 1 == s.size()){
           Int ub = ( not bind ? 9 : s[idx] - '0');
           for(Int i = 0; i <= ub; ++i)
               res += (i % D == cmod);
           return res;
       }
       if(visit[idx][cmod][bind])
           return dp[idx][cmod][bind];
       Int num = (not bind ? 9 : s[idx] - '0' );
       for(Int i = 0; i <= num; ++i){
           res += solve(idx + 1,(D + cmod - i % D)%D,bind and num == i,dp,visit);
           res %= mod;
       }
       visit[idx][cmod][bind] = true;
       return dp[idx][cmod][bind] = res;
   };
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
int main(){
    cin >> s;
    cin >> D;
    auto dp    = vectors(s.size(),D,2, 0LL);
    auto visit = vectors(s.size(),D,2,false);
    cout << (mod + solve(0LL,0LL,true,dp,visit)-1 ) % mod << endl;
}



Measured memory_bytes: 127360
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define ub upper_bound
#define lb lower_bound
#define all(v) ((v).begin()),((v).end())
#define allr(v) ((v).rbegin()),((v).rend())
#define ff first
#define ss second
#define mp make_pair
#define pll pair<ll,ll> 
#define fo(i,n) for(ll i=0;i<n;i++)
#define foa(i,s,e) for(ll i=(s);i<e;i++)
#define fod(i,s,e) for(ll i= (s);i>=(e);i--)
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
#define sz(x) (ll)(x.size())
const ld pi = 3.14159265358979323846;
//ll MOD = 1e9 + 7;
ll MOD = 998244353;
const char nl = '\n';
const ll inf = 1e15;
ll mul(ll x,ll y){
    return (1ll* (x%MOD)*(y%MOD));
}
ll modpow(ll x,ll y){ll z=1;while(y>0){if(y%2)z=mul(z,x);x =mul(x,x) ;y/=2;}return z;}
ll power(ll x,ll y){ll z=1;while(y>0){if(y%2)z=z*x;x =x*x ;y/=2;}return z;}
ll gcd(ll a,ll b){if(a<b) return gcd(b,a);if(b==0) return a;return gcd(b,a%b);} 
ll min(ll a,ll b){if(a<b)return a;return b;}
ll max(ll a,ll b){if(a>b)return a;return b;}
ll sq(ll a){
    ll ans = (1ll*a*a);
    return ans;
}
ll tot = 1e15 + 1;
void solve(){
    ll n;
    cin>>n;
    if(n<=26){
        cout<<(char)('a' + n - 1)<<nl;
        return;
    }
    ll x = 26;
    ll cnt = 1; 
    while(n>x){
        x = 26 + x*26;
        //cout<<x<<nl;
        cnt++;
    }
    if(n == x){
        fo(i,cnt)cout<<'z';
    }
    else{
        string ans = "";
        ll p = n;
        while(p>0){
            ll h = p%26;
            if(h){
                ans += (char)('a' + h - 1);
                p/=26;
            }
            else ans += 'z',p/=26,p--;
            
        }
        reverse(all(ans));
        cout<<ans<<nl;

    }


}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("inputf.txt" , "r" , stdin) ;
    freopen("outputf.txt" , "w" , stdout) ;
    freopen("error.txt" , "w" , stderr) ;
    #endif
    ll t = 1;
    //cin>>t;
    while(t--){
        solve();
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";


}


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

using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf  1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)

vector<long long> dev;
vector<int> id;

void prime_factor(long long N){
	for(int i=2;(long long)i*i<=N;i++){
		int cnt = 0;
		while(N%i == 0){
			cnt++;
			N /= i;
		}
		if(cnt){
			dev.push_back(i);
			id.push_back(cnt);
		}
	}
	if(N != 1){
		dev.push_back(N);
		id.push_back(1);
	}
	return;
}


int main(){
    ll n,p;
    cin >> n >> p;
    if(n==1){
        cout << p << endl;
    }else{
        prime_factor(p);
        ll tmp = 1;
        for(int i=0;i<dev.size();i++){
            for(int j=0;j<(id[i]/n);j++){
                tmp *= dev[i];
            }
            
        }
        cout << tmp << endl;
    }

    return 0;
}

Measured memory_bytes: 256
##### 解けた #####

N=int(input()) # 問題の数
T=list(map(int,input().split(" "))) # 問題を解くのにかかる時間
M=int(input()) # ドリンクの数
Tsum=sum(T) # 何も飲まない場合の合計時間

# 各ドリンクについて
for _ in range(M):
    p,x=list(map(int,input().split(" ")))
    print(Tsum-(T[p-1]-x)) # 該当するドリンクを飲んだ場合の合計時間

Measured memory_bytes: 3060
import sys
import math
import copy
import queue
input = sys.stdin.readline
A = [list(map(int,input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
for i in b:
    for j in range(3):
        for k in range(3):
            if i == A[j][k]:
                A[j][k] = 0
                break
        else:
            continue
        break

ok = False
for h in range(3):
    if A[h][0] == 0 and A[h][1] == 0 and A[h][2] == 0:
        ok = True
        break

for v in range(3):
    if A[0][v] == 0 and A[1][v] == 0 and A[2][v] == 0:
        ok = True
        break

if A[0][0] == 0 and A[1][1] == 0 and A[2][2] ==0:
    ok = True

if A[0][2] == 0 and A[1][1] == 0 and A[2][0] ==0:
    ok = True

if ok:
    print ('Yes')
else:
    print ('No')


Measured memory_bytes: 40300
if __name__ == '__main__':
    
    A = set()
    B = set()
    C = []
    sw = False
    ans = []
    
    while True:
        try:
            line = input()
            if len(line) == 0:
                sw = True
            else:
                a,b = map(int,line.split(","))
                if sw:
                    B.add(a)
                else:
                    A.add(a)
                ans.append(a)
        except EOFError:
            break
            
    C = list(A & B)
    C.sort()

    for i in C:
        cnt = ans.count(i)
        print(i,cnt)



Measured memory_bytes: 5596
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  string model = "ATGC" ;
  int now = 0;
  int ans = 0 ;
  for ( int i=0 ; i < s.size() ; i++){
    bool is = false ;
    for ( int j = 0 ; j<4 ; j++){
      if ( model.at(j) == s.at(i)){
        is = true;
      }
    }
    if ( ! is ) {
      now = 0 ;
  }else  now++;
        ans = max ( ans , now) ;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3592
#include <stdio.h>

int main(void)
{
  int a, n, max = -1000000, min = 1000000, i;
  long long int sum = 0;

  scanf("%d", &n);

  for( i = 0 ; i < n ; i++ )
  {
    scanf("%d", &a);
    if( a < min )
      min = a;
    if( a > max )
      max = a;
    sum += a;
  }

  printf("%d %d %lld\n", min, max, sum);
}



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

using namespace std;

typedef long long ll;

template<typename T>
void _dump(const char* s, T&& head)
{
  cout << s << "=" << head << endl;
}

template<typename T, typename... Args>
void _dump(const char* s, T&& head, Args&&... tail)
{
  while (*s != ',')
    cout << *s++;
  cout << "=" << head << ",";
  _dump(s + 1, tail...);
}

template<typename T>
void _dumpv(const char* s, T&& v)
{
  cout << *s << "=";
  for (auto it = v.begin(); it != v.end(); it++) {
    cout << *it << " ";
  }
  cout << endl;
}

#define dump(...) _dump(#__VA_ARGS__, __VA_ARGS__)
#define dumpv(...) _dumpv(#__VA_ARGS__, __VA_ARGS__)
// #define dump(...)
// #define dumpv(...)

const ll MOD = 1000000007;

ll exchange(ll* r1, ll* r2, ll in, ll out)
{
  static int nest = 0;
  ll g, s, b;
  g = 0;
  s = 0;
  b = 0;
  nest++;
  dump(nest, in, out);
  if (in <= 0) {
    nest--;
    return out;
  }
  if (r1[0] < r2[0] && r1[0] <= in) {
    g = exchange(r1, r2, in - r1[0], out + r2[0]);
  }
  if (r1[1] < r2[1] && r1[1] <= in) {
    s = exchange(r1, r2, in - r1[1], out + r2[1]);
  }
  if (r1[2] < r2[2] && r1[2] <= in) {
    b = exchange(r1, r2, in - r1[2], out + r2[2]);
  }
  out += in; // min is do nothing
  if (g == 0 && s == 0 && b == 0) {
    nest--;
    return out;
  }
  out = max(out, g);
  out = max(out, s);
  out = max(out, b);
  dump(in, g, s, b, out);
  nest--;
  return out;
}

ll dp[5][5001 * 5001];
ll exchange2(ll* r1, ll* r2, ll in)
{
  ll i, a;
  // dump(in);
  for (i = 0; i < 4; i++) {
    for (a = 0; a <= in; a++) {
      dp[i][a] = 0;
    }
  }
  // for (i = 0; i < 4; i++) {
  //   for (a = 0; a <= in; a++) {
  //     cout << dp[i][a] << ' ';
  //   }
  //   cout << endl;
  // }
  for (i = 0; i < 3; i++) {
    for (a = 0; a <= in; a++) {
      ll rate = r2[i] - r1[i];
      ll cnt = a / r1[i];
      dp[i + 1][a] = dp[i][a];
      if (rate <= 0)
        continue;
      if (cnt == 0)
        continue;
      dp[i + 1][a] = max(dp[i + 1][a], dp[i + 1][a - r1[i]] + rate);
      // for (ll c = 1; c <= cnt; c++) {
      //   dp[i + 1][a] = max(dp[i][a], dp[i][a - r1[i] * c] + rate * c);
      // }
    }
  }
  // cout << endl;
  // for (i = 0; i < 4; i++) {
  //   for (a = 0; a <= in; a++) {
  //     cout << dp[i][a] << ' ';
  //   }
  //   cout << endl;
  // }
  return dp[3][in] + in;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  // freopen("d.4", "r", stdin);

  ll N;
  cin >> N;
  ll A[4];
  ll B[4];
  cin >> A[0] >> A[1] >> A[2];
  cin >> B[0] >> B[1] >> B[2];
  // dump(A[0], A[1], A[2]);
  // dump(B[0], B[1], B[2]);
  ll ans;
  ans = exchange2(A, B, N);
  ans = exchange2(B, A, ans);
  cout << ans << endl;
  return 0;
}


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

#define INF 114514810
#define MAX 100

int n, m, k;
int ti[MAX][MAX], co[MAX][MAX];

int main(){
    while(scanf("%d %d", &n, &m) != EOF){
        if(n == 0 && m == 0) break;

        int a, b, c, t;
        for(int i = 0; i < m; i++){
            for(int j = 0; j < m; j++){
                ti[i][j] = INF;
                co[i][j] = INF;
            }
        }

        for(int i = 0; i < n; i++){
            scanf("%d %d %d %d", &a, & b, &c, &t);
            a--; b--;

            ti[a][b] = ti[b][a] = t;
            co[a][b] = co[b][a] = c;
        }

        for(int k = 0; k < m; k++){
            for(int i = 0; i < m; i++){
                for(int j = 0; j < m; j++){
                    co[i][j] = std::min(co[i][j], co[i][k] + co[k][j]);
                    ti[i][j] = std::min(ti[i][j], ti[i][k] + ti[k][j]);
                }
            }
        }

        scanf("%d", &k);
        int p, q, r;
        for(int i = 0; i < k; i++){
            scanf("%d %d %d", &p, &q, &r);
            p--; q--;

            if(r == 0) printf("%d\n", co[p][q]);
            else if(r == 1) printf("%d\n", ti[p][q]);
        }
    }
    return 0;
}

Measured memory_bytes: 2632
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
while(true){
   var n=Arr.shift()-0;
   if(n==0)break;
   var p=Arr.shift().split(" ").map(Number);
   var j=Arr.shift().split(" ").map(Number);
   var sum=p.reduce(function(a,b){return a+b;});
   j.sort(function(a,b){return b-a;});
   var max=sum*n;
   while(true){
      if(j.length==0)break;
      n--;
      sum+=j.shift();
      max=Math.max(max,sum*n);
   }
   console.log(max);
}

Measured memory_bytes: 21132
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define mod 1000000007
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

using Graph = vector<vector<int>>; // グラフ

// トポロジカルソートする
void rec(int v, vector<vector<int>> const &G, vector<bool> &seen, vector<int> &order) {
  seen[v] = true;
  for (auto next : G[v]) {
    if (seen[next]) continue; // 既に訪問済みなら探索しない
    rec(next, G, seen, order);
  }
  order.push_back(v);
}

int main() {
  int v,e;
  cin >> v >> e;
  vector<vector<int>> g(v);
  rep(i, e) {
    int a,b;
    cin >> a >> b;
    g[a].push_back(b);
  }

  vector<bool> seen(v, 0);
  vector<int> order;
  rep(i, v) {
    if (seen[i]) continue;
    rec(i, g, seen, order);
  }

  reverse(order.begin(), order.end());

  for (auto itr : order) cout << itr << "\n";
  cout << flush;
}


Measured memory_bytes: 3712
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[] NAB = br.readLine().split(" ");

		int N = Integer.parseInt(NAB[0]);
		int A = Integer.parseInt(NAB[1]);
		int B = Integer.parseInt(NAB[2]);

		if (N * A > B) {
			System.out.println(B);
		}
		if (N * A < B) {
			System.out.println(N * A);
		}
		if (N * A == B) {
			System.out.println(B);
		}
	}

}


Measured memory_bytes: 22484
import java.util.*;
public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);

      String n = sc.nextLine();
      char c;
      int count = 0;

      for(int i = 0;i<4;i++){
        c = n.charAt(i);
        if(c=='+'){
          count++;
        }else{
          count--;
        }

      }
        System.out.println(count);

      }

  }


Measured memory_bytes: 21204
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;

// ref : https://kmjp.hatenablog.jp/entry/2016/10/10/0930

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

    int p = 0;
    ll ans = 0;

    rep(i, n){
        if (i == 0){
            ans += a[i] - 1;
            p = 1;
        }
        else if (a[i] == p + 1){
            p++;
        }
        else {
            ans += (a[i] - 1) / (p + 1);
        }
    }

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


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);


using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using mint = map<int, int>;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

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; }
template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	int len = v.size();
    s << '[';
	for (int i = 0; i < len; ++i) {
		s << v[i]; if (i < len-1) s << ", ";
	}
    s << ']';
	return s;
}

struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);
    };
}fastio;

int main(){

    int w, h, x, y;
	cin >> w >> h >> x >> y;

	cout << (double)w*(double)h/2 << sp << (x*2==w and y*2==h) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define INF_LL 1000000000000000000LL
#define INF 200000000
#define MOD 1000000007
#define ll long long
#define all(x) x.begin(), x.end()
#define REP(i, a, b) for(int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
// typedef float double;
// typedef priority_queue prique;
typedef pair<ll, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<ll> vl;
typedef vector<vi> matrix;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int sign[2] = {1, -1};
template <class T> bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}

ll modpow(ll a, ll b, ll m) {
    if(b == 0)
        return 1;
    ll t = modpow(a, b / 2, m);
    if(b & 1) {
        return (t * t % m) * a % m;
    } else {
        return t * t % m;
    }
}

struct edge {
    int to;
    ll cost;
    edge(int t, ll c) { to = t, cost = c; }
};

ll dp[3003][3003][4];

int main() {
    int r, c, k;
    cin >> r >> c >> k;
    vector<vector<ll>> a(r, vector<ll>(c));
    rep(i, k) {
        int d, b, v;
        cin >> d >> b >> v;
        a[d - 1][b - 1] = v;
    }
    dp[0][0][1] = a[0][0];
    rep(i, r) rep(j, c) {
        rep(k, 3) {
            if(i > 0) {
                chmax(dp[i][j][1], dp[i - 1][j][k] + a[i][j]);
                chmax(dp[i][j][0], dp[i - 1][j][k]);
            }
            if(j > 0) {
                chmax(dp[i][j][k + 1], dp[i][j - 1][k] + a[i][j]);
                chmax(dp[i][j][k], dp[i][j - 1][k]);
            }
        }
        if(i > 0) {
            chmax(dp[i][j][0], dp[i - 1][j][3]);
            chmax(dp[i][j][1], dp[i - 1][j][3] + a[i][j]);
        }
        if(j > 0) {
            chmax(dp[i][j][3], dp[i][j - 1][3]);
        }
    }
    ll ans = 0;
    rep(i, 4) { chmax(ans, dp[r - 1][c - 1][i]); }
    cout << ans << endl;
}


Measured memory_bytes: 355224
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
const ll T = 1e9+7;
int main(){
        vector<ll> t(4);
        ll w[4][4]={};
        ll a,b;
        for(int i=0;i<3;i++){
                cin >> a >> b;
                t[a-1]++;t[b-1]++;
        }
        sort(t.begin(),t.end());
        if(t[0]==1&&t[1]==1&&t[2]==2&&t[3]==2) cout << "YES";
        else cout << "NO";  
        return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FAST std::ios::sync_with_stdio(0);
#define FOUT freopen(".out", "w", stdout);
#define FIN freopen(".in", "r", stdin);
#define MOD 1000000007
#define KKK 1073741824
#define pb push_back
#define mp make_pair
#define PB pop_back
#define S second
#define SZ size
#define F first
using namespace std;
long long dp[3333][3333];
int n,i,j;
string s;
int main() {
    FAST;
    cin>>n;
    cin>>s;
    s=" "+s;
    dp[1][1]=1;
    for(i=2;i<=n;i++){
        for(j=1;j<=i;j++){
            if(s[i-1]=='<')
                dp[i][j]=(dp[i][j-1]+dp[i-1][j-1])%MOD;
            else
                dp[i][j]=(dp[i][j-1]+dp[i-1][i-1]-dp[i-1][j-1]+MOD)%MOD;
        }
    }
    cout<<dp[n][n]<<endl;

    return 0;
}

Measured memory_bytes: 78464
/*

*/
#include<iostream>
#include<iomanip>
#include<ios>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
#include<utility>
#include<math.h>
#include<cstdlib>
#define rep(i, n) for(int i=0;i<n;i++)
#define repb(i, a, b) for(int i=a;i<b;i++)
#define MAX_N 10000

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

const int INF = 1<<30;
const ll MOD = ll(1e9+7);

int main(){
  int n, r;cin>>n>>r;
  if(n>=10)cout<<r<<endl;
  else cout<<r+100*(10-n)<<endl;
  // system("read -n 1 -s -p \"Press any key to continue...\"");
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
int main() {
  double r, are, dia, pi = 3.141592653589;
  cin >> r;
  are = r * r * pi;
  dia = r * 2 * pi;

  cout << fixed << setprecision(6) << are << " " << dia << endl;
}


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

int main(){
    int n, m, i, p, q, sum=0;
    cin >> n >> m;
    int height[n], win[n], load[n];
    for(i=0;i<n;i++){
        cin >> height[i];
        win[i] = 0;
        load[i] = 0;
    }

    for(i=0;i<m;i++){
        cin >> p >> q;
        if(height[p-1] > height[q-1]){
            win[p-1]++;
        }else if(height[p-1] < height[q-1]){
            win[q-1]++;
        }
        load[p-1]++;
        load[q-1]++;
    }

    for(i=0;i<n;i++){
        if(win[i] == load[i]){
            sum++;
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 4808
#include<stdio.h>

int main(){

int k,s;

scanf("%d %d",&k,&s);



int a,b,c;

int ans=0;

for(a=0;a<=k;a++){

for(b=0;b<=k;b++){

if(a+b<=s&&s-a-b<=k)
 ans++;


}}



printf("%d\n",ans);



return 0;}

Measured memory_bytes: 128
#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 x, k, d;
  cin >> x >> k >> d;

  ll l = -x / d;
  ll ans;
  if (l < -k) {
    ans = abs(x - k * d);
  } else if (l > k) {
    ans = abs(x + k * d);
  } else {
    if (k % 2 == abs(l) % 2) {
      ll tmp = min(abs(x + (l - 2) * d), abs(x + (l + 2) * d));
      ans = min(abs(x + l * d), tmp);
    } else {
      ans = min(abs(x + (l + 1) * d), abs(x + (l - 1) * d));
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define ll long long int
#define F(i,j,k,in) for(ll i=j;i<k;i+=in)
#define DF(i,j,k,in) for(int i=j;i>=k;i-=in)
#define feach(it,l) for (auto it = l.begin(); it != l.end(); ++it)
#define fitr(it,it1,itr2) for(auto it=itr1;it!=itr2;++it)
#define fall(a) a.begin(),a.end()
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define eq equal_range
#define fs first
#define ss second
#define ins insert
#define mkp make_pair
#define PI 3.1415926535897932384626433832795
#define endl "\n"
using namespace std;
typedef vector<ll> vll;
typedef vector<int> vin;
typedef vector<char> vch;
typedef vector<string> vst;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll,ll>> vpll;
typedef set<ll> sll;
typedef set<int> sint;
typedef set<char> sch;
typedef set<string> sst;
typedef queue<ll> qll;
typedef priority_queue<ll> pqll;
typedef map<ll,ll> mll;
typedef pair<ll,ll> pll;
const ll MOD=1000000007;
ll pwr(ll b,ll p){ll res=1;while(p){if(p&1) {res*=b; p--;}else{b*=b; p>>=1;}}return res;}
const int maxn = 1e5+1;
ll cnt[maxn];
int main()
{
  ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL);
   ll n ,k;
   cin>>n>>k;
   F (i,0,n,1) {
     ll a,b;
     cin>>a>>b;
     cnt[a]+=b;
   }
   ll tot=0;
   F (i,1,maxn,1) {
     tot+=cnt[i];
     if (tot>=k) {cout<<i; break;}
   }

return 0;
}




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

int main() {
	string s;
	cin >> s;
	int l=s.length();
	for(int i=0; i<1000; i++){
		l-=2;
		int m=1;
		for(int i=0; i<l/2; i++){
			if(s[i]!=s[i+l/2]){
				m=0;
			}
		}
		
		if(m==0){continue;}
		else{
			cout << l << endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define pb push_back
#define N 200001
#define ll long long
#define int ll 
#define pi pair<int , int>
#define pip pair<pair ,int>
#define mp make_pair 
#define f first
#define s second
#define mod 998244353
ll Mod(ll x, ll y, int p) 
{ll res = 1; x = x % p;
while (y > 0) 
{if(y & 1) res = (res*x) % p; 
y = y>>1;x = (x*x) % p; 
}return res; 
}
int* getlps(string pattern){
 int len = pattern.length();
 int * lps = new int[len];
 lps[0] = 0;
 int i = 1 , j = 0;
 while(i < len){
  if(pattern[i] == pattern[j]){
	  lps[i] = j+1;
   i++;
   j++;
  }
  else{
		if(j != 0){
		 j = lps[j-1];
		}
		else{
		 lps[i] = 0;
		 i++;
		}
  }
 }
 return lps;
}
class Triplet{
 public:
 int x ;
 int y ;
 int gcd;
};
Triplet extendedEuclid(int a , int b){
 if(b == 0){Triplet ans; ans.gcd = a;ans.x = 1;ans.y = 0;return ans;}
 Triplet smallAns = extendedEuclid(b , a%b);
 Triplet ans;
 ans.gcd = smallAns.gcd;
 ans.x = smallAns.y;
 ans.y = smallAns.x - (a/b)*smallAns.y;
 return ans;
}
int mmInverse(int a , int m){
 Triplet ans = extendedEuclid(a , m);
 return (ans.x+m)%m;
}
int fact[N];
void calfac(int n ){
fact[0] = 1;
for(int i = 1 ; i <= n+2; i++){
 fact[i] = (((fact[i-1]%mod)*(i%mod))%mod + mod)%mod;
}
 }
int calc(int n , int r){
 if(r > n)return 0;
 if(r == n)return 1;
 int ans = 1;
 ans = ((ans%mod)*(fact[n])%mod + mod)%mod;
 ans = ((ans%mod)*(mmInverse(fact[n-r] , mod)%mod) + mod)%mod;
 ans = ((ans%mod)*(mmInverse(fact[r] , mod)%mod) + mod)%mod;
 return (ans+mod)%mod;
}
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
  long long a;
  cin>>a;
  int cnt = 0;
  int p = 100;
 while(p < a){
    p += (p/100);
    // same as p(1+r)^2.
    //  (p + p/100);
    //  ( p + p/100 + (p+p/100)/100);
    cnt++;
 }
 //cout<<100*(int)pow(1.01  , 3703)<<endl;
 cout<<cnt<<endl;
   
 
}


Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define check system("pause")
#define all(x) (x).begin(),(x).end()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
const ll mod = 1e9+7;
const int N = 1e6+20;
#define dep(i,a,b) for(int i=(a);i>=(b);i--)
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define mes(p,b) memset(p,b,sizeof(p))
#define sz(x) int(x.size())

int main()
{
  	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	string s,s1="ABC",s2="ARC";
	cin>>s;
	if(s==s1) cout<<s2;
	else cout<<s1;
  	return 0;
}



Measured memory_bytes: 3644
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;

void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    int sum = 0;
    rep(i,n){
        cin >> a[i];
        sum+=a[i];
    }
    rep(i,n){
        if(a[i]<sum-a[i]){
            continue;
        }
        else{
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define sutu (ll)1e18+10
#define ll long long
using namespace std;
#define  pi  3.141592653
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll t,n;
  cin>>t;
  cout<<(2*(pi*t))<<endl;
}


Measured memory_bytes: 3820
#include <iostream>

using namespace std;
typedef long long ll;

ll sign( ll a ) {
  return a > 0 ? 1 : a < 0 ? -1 : 0;
}

int main()
{
  ll a, b;
  cin >> a >> b;
  if ( sign(a) * sign(b) <= 0 )
  {
	cout << "Zero" << endl;
  }
  else if( sign(a) > 0 )
  {
	cout << "Positive" << endl;
  }
  else if ((b - a + 1) % 2 == 0)
  {
	cout << "Positive" << endl;
  }
  else
  {
	cout << "Negative" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1e5)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;

int main()
{
    ll N;
    cin >> N;
    vector<ll> a(N);
    vector<ll> b(N, 0);
    rep(i, N) { 
        cin >> a[i];
    }
    ll cnt = 0;
    for(ll i = N; i > 0; i--) {
        ll tmp = 0;
        ll j = 2;
        while(j * i <= N) {
            tmp += b[j*i - 1];
            j++;
        }
        if (a[i-1] != tmp % 2) {
            cnt++;
            b[i-1] = 1;
        }
    }
    print(cnt);
    rep(i, N) {
        if (b[i])
            cout << i+1 << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3968