akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pil = pair<int,ll>;
using pil = pair<int,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,v.size())i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,v.size())s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(v.size())o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
constexpr double eps = 1e-6;
constexpr ll LINF = 100200300400500600ll;
constexpr int INF = 2*((1<<30)-1)+1;
//--------------------------------------------------------
#define fastio cin.tie(nullptr); std::ios::sync_with_stdio(false);
#define myio ifstream iofi; if(argc>1){iofi.open(argv[1]); std::cin.rdbuf(iofi.rdbuf());}
#define myloopset int loop = 1; if(argc>2) loop =stoi(argv[2]); rep(i,loop)
//--------------------------------------------------------------
template <class T> T chmin(T &a,T b){if(a>b){a=b; return 1;}else return 0;}
template <class T> T chmax(T &a,T b){if(a<b){a=b; return 1;}else return 0;}
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {-1,0,1,0};
constexpr int mod = 1000000007;
#define Yes(ifeq) cout<<(( ifeq )? "Yes":"No")<<endl;

void Main(){
  int n; string s;
  cin>>s;
  bool f = false;;
  for(auto c:s){
    if(c=='7'){
      f = true;
    }
  }
  Yes(f);

} signed main(int argc,char** argv)
{fastio; myio; myloopset Main();}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;
const int INF = INT_MAX / 2;

int main(){
    int N, K; cin >> N >> K;
    vector<int> A(N);
    int min_pos;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        if(A[i]==1) min_pos = i;
    }
    int cnt = 0;
    cnt += (N - min_pos -1) / (K-1);
    cnt += min_pos / (K-1);
    cnt += ((N - min_pos -1) % (K-1) + min_pos % (K-1) + K -1 -1 )/(K-1);

    cout << cnt << endl;
    
}

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

int main() {

    int N;
    cin >> N ;

    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }
 
    int ans = 0;

    for (int i = 0; i < N; i++) {
        if((i+1)%2 != 0 && vec.at(i)%2 != 0){
            ans = ans + 1;
        }
        else{
            ans = ans;
        }

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

}





Measured memory_bytes: 3624
#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++)
  {
    cin>>a[i];  
  }
  int sum=0;
  for(int i=0;i<n-1;i++)
  {
    for(int j=i+1;j<n;j++)
    {
      sum+=a[i]*a[j];
    }
  }
  cout<<sum;
}

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

int main(){
  int N,M,C;cin>>N>>M>>C;
  int B[M];
  int A[N][M];
  rep(i,M) cin>>B[i];
  rep(i,N){
      rep(j,M){
          cin>>A[i][j];
      }
  }
  int ans=0;
  rep(i,N){
      int cnt=C;
      rep(j,M){
          cnt+=A[i][j]*B[j];
      }
      if(cnt>0) ans++;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
int main()
{
    string S, T;
    cin>> S>>T;

    int ans = 0;
    REP(i, 3){
        if(S[i] == T[i])  ans++;
    }

    cout << ans << endl;


   return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef double ld;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define PRECISION std::cout << std::fixed << std::setprecision(20);
  
using namespace std;
 
const ll inf = 1e18;
const ll N = 2e5+100;
const ll bits = 21;
const ll mod = 1e9+7;
const ld pi = 3.14159265358979323846;


int main(){
    FASTIO;
    PRECISION;

    string s;
    cin>>s;
    ll d;

    cin>>d;

    vector< vector<ll> >dp(d,vector<ll>(2));
    dp[0][1] = 1;

    for(int i=0;i<s.size();i++){
        vector< vector<ll> >ndp(d,vector<ll>(2));
        for(int sum=0;sum<d;sum++){
            for(int t=0;t<2;t++){
                int up = 9;
                if(t){
                    up = s[i]-'0';
                }
                for(int x=0;x<up;x++){
                    ndp[(sum+x)%d][0]+=dp[sum][t];
                    ndp[(sum+x)%d][0]%=mod;
                    
                }
                ndp[(sum+up)%d][t]+=dp[sum][t];
                ndp[(sum+up)%d][t]%=mod;
            }
        }

        // for(int i=0;i<d;i++){
        //     cout<<ndp[i][0]<<" "<<ndp[i][1]<<", ";
        // }
        // cout<<"\n";

        dp = ndp;
    }

    cout<<(dp[0][1]+dp[0][0]-1+mod)%mod<<"\n";
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:1048576")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble
#define rf(x) (x)=0;while(*p<48)p++;while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;
typedef tuple <int, int, int> t3;

int IT_MAX = 1 << 12;
const ll MOD = 1000000009;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 1234567890123456789ll;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<(n);i++)

int main() {
	int A, B, C, D;
	scanf("%d %d %d %d", &A, &B, &C, &D);

	int st = max(A, C);
	int en = min(B, D);
	return !printf("%d\n", max(0, en - st));
}


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

signed main() {
  int a,b;cin>>a>>b;
  int ans=0;
  a-=2;
  ans+=(a/11)*5;
  a=a%11;
  std::vector<int> v(11,0);
  for(int i=0;i<a;i++){
    v[(4+i*8)%11]++;
    v[(2+i*8)%11]++;
    v[(0+i*8)%11]++;
    v[(9+i*8)%11]++;
    v[(7+i*8)%11]++;
  }
  //cout<<a<<" "<<ans<<endl;
  //for(int i=0;i<11;i++)cout<<v[i]<<" ";cout<<endl;
  ans+=v[b];
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
//SにNが含まれている時、Sを含んでいなければならない　逆も然り
//SにWが含まれている時、Eを含んでいなければならない　逆も然り
//Sを含んでいるのにNがないとアウト、Nを含んでいるのにSがないとアウト

int main() {
  string S;
  cin >> S;
  bool flagS = false;
  bool flagN = false;//Nが含まれているか
  bool flagW = false;
  bool flagE = false;
  for(int i = 0;i<S.size();i++){
      if(S[i] == 'S'){
          flagS = true;
      }
      if(S[i] == 'N'){
          flagN = true;
      }
      if(S[i] == 'W'){
          flagW = true;
      }
      if(S[i] == 'E'){
          flagE = true;
      }
  }
  if((flagS && !flagN) || (flagN && !flagS) || (flagW && !flagE)
  || (flagE && !flagW)){
      cout << "No" <<endl;
  }
  else cout << "Yes" <<endl;

}

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

int dfs(string t, map<string, int> cost, map<string, vector<string>> recipe) {
    int res = 0;
    
    if (recipe.find(t)!=recipe.end()) {
        for (auto& qi : recipe[t]) {
            res += dfs(qi, cost, recipe);
        }
        
        return min(res, cost[t]);
    }
    else {
        return cost[t];
    }
}

signed main() {
    while (true) {
        int n;
        cin >> n;
        
        if (n==0) {
            break;
        }
        
        map<string, int> cost;
        
        for (int i=0; i<n; i++) {
            string si;
            int pi;
            cin >> si >> pi;
            cost[si] = pi;
        }
        
        int m;
        cin >> m;
        
        map<string, vector<string>> recipe;
        
        for (int i=0; i<m; i++) {
            string oi;
            int ki;
            cin >> oi >> ki;
            
            for (int j=0; j<ki; j++) {
                string qi;
                cin >> qi;
                recipe[oi].push_back(qi);
            }
        }
        
        string t;
        cin >> t;
        cout << dfs(t, cost, recipe) << endl;
    }
}


Measured memory_bytes: 3148
# solution

modulous=10**9+7
r=[[(j-i)*4%13 for i in range(10)]for j in range(13)]
d=[1]+[0]*12
for c in input():
  if c>"9":
    d=[(sum(d[i] for i in j))%modulous for j in r]
  else:
    d=[d[((j-int(c))*4%13)] for j in range(13)]
    
print(d[5])

Measured memory_bytes: 3188
#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)--)
#define ll long long

using namespace std;
const ll MOD = 1e9+7;

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

ll powmod(ll a, ll b){
    ll c = 1;
    ll ans = 1;
    while(c <= b){
        if(c & b){
            ans *= a;
            ans %= MOD;
        }
        c <<= 1;
        a *= a;
        a %= MOD;
    }
    return ans;
}

int main(){
    ll N, M;
    cin >> N >> M;
    if(abs(N-M) > 1){
        cout << 0 << endl;
        return 0;
    }
    ll ans = 1;
    rep(i,N){
        ans *= i+1;
        ans %= MOD;
    }
    rep(i,M){
        ans *= i+1;
        ans %= MOD;
    }
    if(N==M)
        ans = (ans*2)%MOD;

    cout << ans << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.buffer.readline
from collections import deque

def main():
    N,M,K = map(int,input().split())
    friend = [[] for _ in range(N)]
    for _ in range(M):
        a,b = map(int,input().split())
        friend[a-1].append(b-1)
        friend[b-1].append(a-1)
        
    brock = [[] for _ in range(N)]
    for _ in range(K):
        c,d = map(int,input().split())
        brock[c-1].append(d-1)
        brock[d-1].append(c-1)
        
    parent = [-1 for _ in range(N)]
    group = [0 for _ in range(N)]
    
    for i in range(N):
        put = []
        if parent[i] == -1:
            q = deque([i])
            parent[i] = i
            while q:
                now = q.pop()
                put.append(now)
                for fol in friend[now]:
                    if parent[fol] == -1:
                        parent[fol] = i
                        q.append(fol)
            l = len(put)
            for num in put:
                group[num] = l-1
                
        else:
            continue

    for i in range(N):
        group[i] -= len(friend[i])
        for dis in brock[i]:
            if parent[i] == parent[dis]:
                group[i] -= 1
    
    print(*group)
    
if __name__ == "__main__":
    main()

Measured memory_bytes: 47136
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
int main(){
  int a;
  cin >> a;
  cout << "Christmas";
  while(a<25){
    cout << " Eve";
    a++;
  }
}

Measured memory_bytes: 256
use std::collections::BTreeMap;

fn main() {
    let mut buf = String::new();
    let handle = std::io::stdin();
    handle.read_line(&mut buf).unwrap();
    let info: Vec<usize> = buf.trim().split_whitespace().map(|a| a.parse().unwrap()).collect();
    let n = info[0];
    let k = info[1];
    buf.clear();
    handle.read_line(&mut buf).unwrap();
    let mut ls: Vec<usize> = buf.trim().split_whitespace().map(|a| a.parse().unwrap()).collect();
    ls.sort();
    let mut total_len = 0;
    for l in ls.iter().rev().take(k) {
        total_len += *l;
    }
    println!("{}", total_len);
}


Measured memory_bytes: 4352
#include <stdio.h>
int main(void) {
	int a,b,c, cho = 0, hisi = 0;
	while(scanf("%d,%d,%d", &a, &b, &c) != EOF){
		if(a == b) hisi++;
		if(a*a+b*b == c*c) cho++;
	}
	printf("%d\n%d\n", cho, hisi);
	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

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>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);
    string s,t; cin >> s >> t;
    int slen = s.length();
    int tlen = t.length();
    if(slen != tlen-1){
        cout << "No" << endl;
    }else{
        if(t.substr(0,tlen-1) == s){
            cout << "Yes" << endl;
        }else{

        cout << "No" << endl;
        }
    }

}

Measured memory_bytes: 3612
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}


signed main(void) {
    int n,m;
    cin >> n >> m;
    vi a(m);
    rep(i,n){
        int p;
        cin >> p;
        while(p--){
            int t;
            cin >> t;
            t--;
            a[t]++;
        }
    }
    int ans = 0;
    rep(i,m)if(a[i] == n)ans++;
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template <class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iterator i=(c).begin();i!=(c).end();++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
const double EPS=1e-10;
const double PI=acos(-1.0);


typedef vector<double> vd;
typedef vector<vd> vvd;

struct sphere{
	double x,y,z,r;
	//sphere(double x,double y,double z,double r):x(x),y(y),z(z),r(r){}
};
double dist(const sphere &left, const sphere &right){
	double p=sqrt(pow(left.x-right.x,2)+pow(left.y-right.y,2)+pow(left.z-right.z,2));
	double d=p-left.r-right.r;
	if(d<EPS){
		return 0.000;
	}else{
		return d;
	}
}
#define MAX INT_MAX/10

int main(){
	int n;
	while(cin>>n,n){
		vector<sphere> s(n);
		REP(i,n){
			cin>>s[i].x>>s[i].y>>s[i].z>>s[i].r;
		}

		vvd d(n,vd(n,MAX));

		REP(i,n)REP(j,n){
			d[i][j]=dist(s[i],s[j]);
		}

		vi dones(n,0);
		dones[0]=1;

		double res=0;
		while(find(ALL(dones),0)!=dones.end()){
			double mindist=MAX;
			int minindex=-1;
			REP(i,n){
				if(dones[i]){
					REP(j,n){
						if(!dones[j]){
							if(mindist>d[i][j]){
								mindist=d[i][j];
								minindex=j;
							}
						}
					}
				}
			}
			assert(minindex!=-1);
			res+=mindist;
			dones[minindex]=1;
		}

		printf("%.3f\n",res);
	}
}

Measured memory_bytes: 1064
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define DEBUG
#define PI 3.141592653589793238462643383279

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define REPR(i, n) for(ll i = n; i >= 1; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
const ld INF = 1e9+123;
#define VEC(type,A,N) vector<type> A(N+10)
#define VECi(type,A,N,i) vector<type> A(N+10,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N+10,vector<type>(M+10))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N+10,vector<type>(M+10,i))
#define ALL(v) v.begin()+1, v.end()-9
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
vector<ll> yakusuu(ll N){
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}
int main(){
    ll N;
    cin>>N;
    vector<ll> A(N);
    FOR(i,0,N-1){
        cin>>A[i];
    }
    while(true){
        sort(A.begin(),A.end());
        if(A[A.size()-2]==0)break;
        //s(A[0])
        ll t=-1;
        FOR(i,0,N-1){
            if(t==-1&&A[i]!=0){
                t=A[i];
            }else{
                A[i]=A[i]%t;
                //s(A[i]);
            }
        }
        //sl();
    }
    cout<<A[A.size()-1];
    //cout<<fixed<<setprecision(15)<<m;
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


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

// boost
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
// #define mod (998244353ll)

const long long INF = 1LL << 60;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll a, b, c;
  cin >> a >> b >> c;

  cout << (a ^ b ^ c) << endl;

  return 0;
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int n, k; cin >> n >> k;
	vector<ll> a(n);
	ll mx = -1;
	for(int i=0; i<n; i++){
		cin >> a[i];
		mx = max(mx,a[i]);
	}
	ll l=1, h=1e9+7;
	while(l<h){
		ll cur_t = (h+l)/2;
		ll tot = 0;
		for(const ll& elem : a){
			tot += (elem+cur_t-1)/cur_t - 1;
		}
		if(tot <= k)
			h = cur_t;
		else
			l = cur_t+1;
	}
	cout << min(h, mx) << endl;
	return 0;
}

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

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl

bool nagomi(ll n){
    bool flag = false;
    bool flag3 = false;
    bool flag5 = false;
    bool flag7 = false;
    while(n!=0){
        if(n%10==3)flag3=true;
        else if(n%10==5)flag5=true;
        else if(n%10==7)flag7=true;
        n /= 10;
        if(flag3==1&&flag5==1&&flag7==1){
            flag = true;
            break;
        }
    }
    if(flag) return true;
    else return false;
}

int main(){
    int n;
    cin >> n;
    queue<ll> cho;
    for(int i=3;i<=7;i+=2){
        cho.push(i);
    }
    int count = 0;
    while(1){
        ll num = cho.front();
        cho.pop();
        if(nagomi(num)&&num<=n)count++;
        if(num>n) break;
        for(int i=3;i<=7;i+=2){
            ll b = num*10+i;
            cho.push(b);
        }
    }
    COUT(count);
    return 0;
} 


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

//定数
const long long MOD1=1000000007;
const long long MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};

//型名省略
#define ll long long
#define ull unsigned long long
#define ld long double
#define uld unsigned long double
#define pll pair<long long,long long>
#define tll(n) array<long long,(int)(n)>
#define pcc pair<char,char>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define vt(n) vector<array<long long,(int)(n)>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define Fi first
#define Se second
#define mp make_pair
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define bitrep(i,s,n) for(long long i=(s);i<(1LL<<(n));i++)
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define lin(s) getline(cin,(s))
#define Ssort(v) sort((v).begin(),(v).end(),[](auto &left,auto &right){return left.second<right.second;})

//Yes,No
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
//YES.NO
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a,long long b){return a/gcd(a,b)*b;}

//累乗
template<typename t>
constexpr t mypow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
        }
    return x;
}
#define pow mypow

//chmin,chmax
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;}

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

//main関数
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    vl a(3);
    rep(i,3)cin>>a[i];
    ll sum=0;
    rep(i,3)sum+=a[i];
    ll res=0;
    rep(i,3){
        chmax(res,a[i]*10+sum-a[i]);
    }
    cout<<res<<endl;
}

Measured memory_bytes: 3620
N = int(input())
A = [int(s) for s in input().split()]
B = [int(s) for s in input().split()]
C = [int(s) for s in input().split()]
A.sort()
B.sort()
C.sort()
def isOK(lis,index,key):
    if lis[index] > key:
        return True
    else:
        return False

def binary_search(lis,key):
    ng = -1
    ok = len(lis)

    while(abs(ok-ng)>1):
        mid = int((ok+ng)/2)
        if isOK(lis,mid,key):
            ok = mid
        else:
            ng = mid
    return ok

count = 0
count_lis = []
for b in B[::-1]:
    b_index = binary_search(C,b)
    if b_index != N:
        count += N - b_index
    count_lis.append(count)

count_lis = count_lis[::-1]
ans = 0
for a in A:
    a_index = binary_search(B,a)
    if a_index != N:
        ans += count_lis[a_index]
print(ans)



Measured memory_bytes: 23412
// AtCoder.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//


#define _USE_MATH_DEFINES
#include<math.h>

//#include<cmath>

#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>



//#include "Ants.h"
using namespace std;
typedef long long ll;
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i,n) for(int i=0;i<n;i++)
#define show(s) cout<<s<<endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define LINF (1000000000000000000ll)

typedef pair < int, int> P;
ll gcd(ll a, ll b) {//最大公約数を求める///最大公倍数a*b/gcd(a,b)
	if (b == 0) return a;
	return gcd(b, a % b);
}

ll lcd(ll a, ll b) {//最小公倍数を求める　b=0のときaを返す
	if (b == 0) return a;
	return (a / gcd(a, b)) * b;
}
int A, B;
int main()
{
	cin >> A >> B;
	cout << lcd(A, B) << endl;
	
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <unordered_map>
#include <string>

#define REP(i, a, b) for ( int i = (a); i < (b); i++ )
#define REVREP(i, a, b) for ( int i = (a); i >= (b); i--)
#define DEBUG_INT(var) printf("the value of "#var" is %d\n", var)
#define PRINT_ARRAY(name, i) printf("the value of "#name"[%d] is %d\n", (i), name[(i)])
#define DEBUG_ARRAY(name, begin, end) REP(i, begin, end) PRINT_ARRAY(name, i)

#define YES puts("YES")
#define NO  puts("NO")
#define Yes puts("Yes")
#define No  puts("No")

using namespace std;

typedef long long ll;

int N, M;
int ans = 0;
unordered_map<string, int> m;

int main(void) {
    scanf("%d", &N);
    REP(i, 0, N) {
    	string s;
    	cin >> s;
    	if (m.count(s) == 0) m[s] = 1;
    	else m[s] += 1;
    }

    scanf("%d", &M);

    REP(i, 0, M) {
    	string s;
    	cin >> s;
    	if (m.count(s) == 0) m[s] = -1;
    	else m[s] -= 1;
    }

    for ( unordered_map<string, int>::iterator itr = m.begin(); itr != m.end(); itr++) {
    	ans = max(ans, itr->second);
    }
  
    printf("%d\n", ans);

	return 0;
}


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

using namespace std;

//----------------------- Print Function ----------------------//

inline void print() {
    cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest) {
    cout << first << ' ';
    print(rest...);
}

template <typename T>
void print(const vector<T> &v) {
    for (auto e : v) cout << e << ' ';
    cout << endl;
}

//------------------------- Libraries -------------------------//

vector<long long> enum_divisors(long long N) {
    vector<long long> res;
    for (long long i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (N/i != i) res.push_back(N/i);
        }
    }
    // 小さい順に並び替える
    sort(res.begin(), res.end());
    return res;
}

//--------------------------- Solve ---------------------------//

void solve() {
    int N, M; cin >> N >> M;
    vector<long long> m = enum_divisors(M);
    int ans = 0;
    for (int i = 0; i < m.size(); i++) {
        if (M / m[i] >= N) ans = m[i];
        else break;
    }
    cout << ans << '\n';
}

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

    solve();

    return 0;
}

Measured memory_bytes: 3688
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <stdio.h>

using namespace std;

//typedefリスト
typedef vector<int> vint;
typedef vector<string> vstr;


int main(void) {
	int H, W,cou;
	cin >> H >> W;
	vstr S(H+2);
	for (int i = 0; i < W+2; i++) {
		S[0][i] = '.';
		S[H - 1][i] = '.';
	}
	for (int i = 1; i < H + 1; i++) {
		cin >> S[i];
		S[i].insert(0, ".");
		S[i].push_back('.');
	}
	for (int i = 1; i < H + 1; i++) {
		for (int j = 1; j < W + 1; j++) {
			if (S[i][j] == '#'){
			    if(j==W)cout << '#' << endl;
			    else cout<<'#';
			}
			else {
				cou = 0;
				if (S[i - 1][j - 1] == '#')cou++;
				if (S[i - 1][j] == '#')cou++;
				if (S[i - 1][j + 1] == '#')cou++;
				if (S[i][j - 1] == '#')cou++;
				if (S[i][j + 1] == '#')cou++;
				if (S[i + 1][j - 1] == '#')cou++;
				if (S[i + 1][j] == '#')cou++;
				if (S[i + 1][j + 1] == '#')cou++;
				if (j == W)cout << cou << endl;
				else cout << cou;
			}
		}
	}

}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
long double x[11];
string u[11];

int main(){
int n; cin>>n;
int i;
for(i=0;i<n;i++) cin>>x[i]>>u[i];

long double ans=0;

for(i=0;i<n;i++){
if(u[i]== "JPY") ans += x[i];
else ans += x[i]*380000.0;
}
cout << ans << endl;
}


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

int main(){
  int a, b, c, x;
  cin >> a >> b >> c >> x;
  int ans = 0;
  for(int i = 0; i <= a; i++){
    for(int j = 0; j <= b; j++){
      for(int k = 0; k <= c; k++){
        if(500 * i + 100 * j + 50 * k == x){
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define F first
#define S second
#define pss pair<string,string>
#define pcc pair<char,char>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define piii pair<int,pii>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define vs vector<string>
#define vl vector<ll>
#define vs vector<string>
#define vll vector<pll>
#define vss vector<pss>
#define vcc vector<pcc>
#define MP make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=n-1;i>=0;i--)
#define Very_fast std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const int N = 1e6+5;
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
inline ll gcd(ll a,ll b){if(b==0)return a;else return gcd(b,a%b);}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll lowbit(ll x){return (x&-x);}
bool has[N],ok=true,notprime[N],vis[N];int n,GCD,x;
vi prime,e[N];
void init()
{
	for(int i=2;i<=1e6;i++)
		if(!notprime[i])
		{
			e[i].pb(i);
			for(int j=i+i;j<=1e6;j+=i)
				notprime[j]=true,e[j].pb(i);
		}
}
int main()
{
	scanf("%d",&n);
	init();
	for(int i=0;i<n;i++)
	{
		scanf("%d",&x);
		GCD=__gcd(GCD,x);
		if(!ok||x==1)continue;
		if(has[x])ok=false;
		else{
			has[x]=true;
			for(int j=0;j<e[x].size();j++)
				if(vis[e[x][j]])
					ok=false;
				else
					vis[e[x][j]]=true;
		}
	}
	if(ok)printf("pairwise coprime\n");
	else if(GCD==1)printf("setwise coprime\n");
	else printf("not coprime\n");
	return 0;
}

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

int main (){
    int x;
    long long u=0;
    cin >> x;
    if (x/500!=0){
        u +=x/500*1000;
       
        if (x%500/5!=0){
            u+=x%500/5*5;
        }
    }else if (x/5!=0){
         u+=x/5*5;
        }
   cout << u << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
 
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
 
using namespace std;
 
typedef long long ll;

int main(int argc, char const *argv[])
{
  ll n,k;
  string s;
  cin >> n >> k >> s;
  ll res = 0;
  ll start = 0;
  ll next = 0;
  ll block = 0;
  ll minus_value = 0;
  vector<ll> minus = vector<ll>();
  for (int i = 0; i < s.length(); i++) {
    if (i == 0 && s[i] == '0')block++;
    if (i < s.length()-1 && s[i] != s[i+1]) {
      block++;
    }
    if (block == 2) {
      minus.push_back(i);
      block = 0;
    }
  }
  ll j = 0;
  block = 0;
  for (int i = 0; i < s.length(); i++) {
    if (i == 0 && s[i] == '0') {
      block++;
    }
    if (i < s.length()-1 && s[i] != s[i+1]) {
      block++;
    }
    if (block == k*2+1 || i == s.length()-1) {
      res = max(i+1-start, res);
      if (i != s.length() -1) {

      start = minus[j]+1;   
      j++;
      block = k*2+1-2;
      }
    }
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 1020
#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 n;
    cin >> n;
    vector<Int> a(n);
    for (Int i = 0; i < (Int)n; i++) {
        cin >> a[i];
    }
    Int sum = accumulate(all(a), 0LL);
    if (sum % (n * (n + 1) / 2) != 0) {
        print("NO");
        return 0;
    }
    Int m = sum / (n * (n + 1) / 2);
    Int cnt = 0;
    Int cnt2 = 0;
    for (Int i = 0; i < (Int)n; i++) {
        Int x = a[i];
        Int y = a[(i + 1) % n] - m;
        if (x < 0 or y < 0 or (x - y) % n != 0) {
            print("NO");
            return 0;
        }
        cnt += (x - y) / n;
        cnt2 += m - (x - y) / n;
    }
    print(cnt == m and cnt2 == (n - 1) * m ? "YES" : "NO");
    return 0;
}

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

using namespace std;

typedef long long ll;

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

	int n, m;
	cin >> n >> m;
	cout << (n - 1) * (m - 1) << endl;
}


Measured memory_bytes: 256
//
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
//
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

//
// solution 
//

#[allow(unused_mut)]
#[allow(non_snake_case)]
fn main() {
    input!{
        N: usize,
        Q: usize,
        S: chars,
        ind: [(usize1, usize1); Q],
    }

    let mut indexs = Vec::new();

    for i in 0..S.len()-1 {
        if S[i] == 'A' && S[i+1] == 'C' {
            indexs.push(i);
        }
    }

    for &(start, end) in ind.iter() {
        let end = end - 1;
        let start_ind = match indexs.binary_search(&start) {
            Ok(ind) => ind,
            Err(ind) => ind,
        };

        let end_ind = match indexs.binary_search(&end) {
            Ok(ind) => ind+1,
            Err(ind) => ind,
        };
        println!("{}", end_ind - start_ind);
    }
}


Measured memory_bytes: 6908
use std::collections::*;
use std::io::*;
use std::*;
// template {{{
macro_rules! get {
    ($($t:tt),*; $n:expr) => {
        {
            let stdin = std::io::stdin();
            let ret = std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
                let line = line.unwrap();
                let mut it = line.split_whitespace();
                _get!(it; $($t),*)
            }).collect::<Vec<_>>();
            ret
        }
    };
    ($($t:tt),*) => {
        {
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut it = line.split_whitespace();
            _get!(it; $($t),*)
        }
    };
}
macro_rules! _get {
    ($it:ident; [char]) => {
        _get!($it; String).chars().collect::<Vec<_>>()
    };
    ($it:ident; [u8]) => {
        _get!($it; String).bytes().collect::<Vec<_>>()
    };
    ($it:ident; usize1) => {
        $it.next().unwrap().parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
    };
    ($it:ident; [usize1]) => {
        $it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
    };
    ($it:ident; [$t:ty]) => {
        $it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
    };
    ($it:ident; $t:ty) => {
        $it.next().unwrap().parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
    };
    ($it:ident; $($t:tt),+) => {
        ($(_get!($it; $t)),*)
    };
}
// }}}

fn main() {
    let k = get!(i64);
    let mut m = 0;
    for i in 1..=k {
        m = m * 10 + 7;
        m %= k;
        if m == 0 {
            println!("{}", i);
            return;
        }
    }
    println!("{}", -1);
}


Measured memory_bytes: 2132
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
	int a, b, k;
	scanf("%d%d%d", &a, &b, &k);
	for (int i = a; i <= min(b, a + k - 1); i++)printf("%d\n", i);
	for (int i = max(b - k + 1, a + k); i <= b; i++)printf("%d\n", i);
}


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

int main() {
	long long a,b,i,j,ans=0,cur,res;
	cin >> a >> b;
	if(a>b) swap(a,b);
	while(b%a>0){
		b=b%a;
		swap(a,b);
	}
	
	vector<long long> prime;
	res=0;
	if(a<=2){
		cout << a; return 0;
	}
	
	cur=a; ans=1;
	for(i=2; i*i<=cur; i++){
		if(cur%i==0){
			while(cur%i==0){
				cur/=i;
			}
			ans++;
		}
	}
	if(cur>1) ans++;
	
	cout << ans;
}


Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {

            int[] iarray = Console.ReadLine().Split(' ').Select(z => int.Parse(z)).ToArray();
            int N = iarray[0];  
            int K = iarray[1];
            HashSet<int> A = new HashSet<int>();
           
            for(int i = 0; i < K; i++)
            {
                int d = int.Parse(Console.ReadLine());
                int[] da = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray();
                for (int j = 0; j < d; j++)
                    A.Add(da[j]);
            }
            Console.WriteLine(N-  A.Count);
        }
    }
}


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

// Contest: AtCoder Grand Contest 039 (https://atcoder.jp/contests/agc039)
// Problem: 

using namespace std;

using ll = int64_t;
using u64 = uint64_t;
using u32 = uint32_t;

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

    string s; ll k; cin >> s >> k;
    auto n = s.size();

    vector<pair<char, int>> blocks;
    blocks.emplace_back(s[0], 1);
    for (int i = 1; i < n; ++i) {
        if (s[i] == blocks.back().first)
            ++blocks.back().second;
        else
            blocks.emplace_back(s[i], 1);
    }

    if (blocks.size() == 1) {
        cout << (blocks[0].second * k / 2) << '\n';
        return 0;
    }

    ll res = 0;
    int start = 0, end = blocks.size();
    if (blocks[0].first == blocks.back().first) {
        res += blocks[0].second / 2;
        res += blocks.back().second / 2;
        res += ((blocks[0].second + blocks.back().second) / 2) * (k - 1);
        ++start;
        --end;
    }

    for (int i = start; i < end; ++i)
        res += (blocks[i].second / 2) * k;

    cout << res << '\n';
    return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * @author yoshizaki
 *
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int count = scanner.nextInt();
        int len = scanner.nextInt();
        List<String> moji = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            moji.add(scanner.next());
        }
        Collections.sort(moji);
        StringBuilder sb = new StringBuilder();
        for(int i = 0 ; i < count ; i++) {
            sb.append(moji.get(i));
        }
        System.out.println(sb.toString());
    }
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
    #define HAR BAR LAGTA HAI APUN HI J BHAGWAAN HAI!!
    #define UTSAV  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    #define ll long long int
    #define MAX 1e9
    #define MIN -1e9
    #define md 1000000007
    #define pb push_back
    #define all(x) (x).begin(), (x).end()
    #define debug(x) cerr<<#x<<'='<<(x)<<endl;
    #define output(x) cout << ( x ? "YES" : "NO" ) << '\n' ;
    #define mxn 200005
    using namespace std;
    int main()
    {
        UTSAV
        string s;
        cin>>s;
        if(s[s.size()-1]!='s') cout<<s<<"s"<<endl;
        else cout<<s<<"es"<<endl;
        
        return 0;
    }


Measured memory_bytes: 3660
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

long calc(int n, int k) {
    long[int] d;
    for (int i = 1; i <= n; i++) {
        d[i % k]++;
    }

    long ans = 0;
    for (int i = 1; i <= n; i++) {
        int a = i % k;
        int bc = (k - a) % k;
        if ((bc + bc) % k != 0) continue;

        ans += d[bc] ^^ 2;
    }
    return ans;
}

void main() {
    auto nk = readints;
    int n = nk[0], k = nk[1];
    writeln(calc(n, k));
}


Measured memory_bytes: 5756
"""def power(x, y): 
    res = 1
    x=x
    while (y > 0): 
        if ((y & 1) == 1) : 
            res = (res * x) 
        y = y >> 1
        x = (x * x)
    return res""" 
"""def fact(n):
    if(n==0):
        return 1
    if(n==1):
        return 1
    return fact(n-1)+fact(n-2)"""

import math
#import combinations


#t=int(input())
#for _ in range(t):
    #n=int(input())
    #s=input()
    #arr=list(map(int,input().split()))
    #b=list(map(int,input().split()))
    #d={}
    #flag=0
S,W=map(int,input().split())
    #count=0
if(W>=S):
    print("unsafe")
else:
    print("safe")


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

int dp[1000010];

int main() {
    int n, q;
    cin >> n;
    vector<int> a(n);
    dp[0] = 1;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        for (int j = 1000000; j >= a[i]; --j) {
            dp[j] |= dp[j - a[i]];
        }
    }
    cin >> q;
    for (int i = 0; i < q; ++i) {
        int m;
        cin >> m;
        cout << (dp[m] ? "yes\n" : "no\n");
    }
    return 0;
}

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

int main() {
	int a, b, x;
	cin >> a >> b >> x;
	if (x == a) {
        cout << "YES\n";
    }
	else if (x < a)
		cout << "NO\n";
	else if (abs(x -a) <= b)
		cout << "YES\n";
    else
        cout << "NO\n";
	return 0;

}


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

//aとbの最大公約数と最小公倍数を求める。
void Euclidean(const long a, const long b, long& divisor, long& multiple);

int main(void) {
    long a, b;
    long divisor, multiple;
    
    while(cin >> a >> b) {
        Euclidean(a, b, divisor, multiple);
        cout << divisor << ' ' << multiple << endl;
    }
}

void Euclidean(const long a, const long b, long& divisor, long& multiple) {
    long L, S, n;
    if(a > b) { L = a;   S = b; }
    else      { L = b;   S = a; }
    while((L % S) != 0) {
        n = L;
        L = S;
        S = n % S;
    }
    divisor = S;
    multiple = a * b / divisor;
}


Measured memory_bytes: 3072
#include <iostream>
#include <utility>
#include <vector>
#include <queue>
#include <stack>
#include <array>
#include <algorithm>
#include <numeric>
#include <limits>
#include <string>
#include <regex>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main()
{
    string w;
    cin >> w;
    int count[26] = {};
    for (int i = 0; i < w.length(); i++) {
        count[w[i] - 'a']++;
    }
    for (int i = 0; i < 26; i++) {
        if (count[i] % 2) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256