akhauriyash/Code-Regression huggingface dataset:
#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>
#define INF 2000000000
#define REP(i,b,n) for(int i = (b); i < n; i++)
#define rREP(i,b,n) for(int i = n; i >= b; i--)
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const string lowercase = "abcdefghijklmnopqrstuvwxyz";
const string uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int gcd(int a, int b){return b ? gcd(b, a % b): a;}

int main()
{
    int n, m;
    cin >> n >> m;
    vi d;
    for(int i=1; i*i<=m; i++){
        if(m%i==0){
            d.push_back(i);
            if(i>1 && i*i!=m) d.push_back(m/i);
        }
    }
    d.push_back(m);
    sort(d.begin(),d.end(), greater<int>());
    REP(i,0,d.size()){
        if(m/d[i] >= n){
            cout << d[i] << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define MAX 101
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n,V[MAX][MAX];
int color[MAX];
int time;
int d[MAX],f[MAX];

void Visit(int u){
  int v;

  color[u] = 1;
  d[u] = ++time;

  //  printf("time = %d\n",time);
  
  for(v=1;v<=n;v++){    
    if(V[u][v]==0)continue; //WHITE
    
    if(color[v]== 0){ //WHITE
      Visit(v);
    }
  }
  
  color[u] = 2; //BLACK
  f[u] = ++time;
};

void DFS(){
  int i;
  for(i=1;i<=n;i++){
    color[i] = 0; //WHITE
  }
  time = 0;
  
  for(i=1;i<=n;i++){
    if(color[i] == 0){ //WHITE
      Visit(i);     
    }
  }
  for(i=1;i<=n;i++){
    printf("%d %d %d\n",i,d[i],f[i]);
  }
};

int main(){
  int i,j;
  int id,k,v;

  scanf("%d",&n);
  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      V[i][j]=0;
    }
  }
    
  for(i=1;i<=n;i++){
    scanf("%d%d",&id,&k);
    for(j=1;j<=k;j++){
      scanf("%d",&v);
      V[id][v]=1;
    }
  }

  DFS();

  return 0;
}

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

int main() {
  int n;
  cin >> n;
  int highest = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    int h;
    cin >> h;
    if (h >= highest) {
      ans++;
      highest = h;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
S = input()
N = len(S)
if S != S[::-1]:
  print("No")
elif S[:(N-1)//2] != S[:(N-1)//2][::-1]:
  print("No")
elif S[(N+1)//2:] != S[(N+1)//2:][::-1]:
  print("No")
else:
  print("Yes")

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

// dp[i][j]: s の i 文字目, t の j 文字目までの最長共通部分列
// dp[0][_] = 0
// dp[_][0] = 0
// dp[i][j] = 
//   | s[i] == t[i] -> dp[i-1][j-1] + 1
//   | otherwise    -> max(dp[i][j-1], dp[i-1][j])

string s, t;
int dp[3001][3001];

void calc(int i, int j, string& str) {
    if(dp[i][j] == 0) return ;

    if(s[i-1] == t[j-1]) {
        calc(i-1, j-1, str);
        str.push_back(s[i-1]);
    }else if(dp[i][j-1] > dp[i-1][j]){
        calc(i, j-1, str);
    } else {
        calc(i-1, j, str);
    }

}

int main() {
    cin >> s >> t;

    size_t s_len = s.length();
    size_t t_len = t.length();

    for(int i = 1; i <= s_len; ++i) {
        for(int j = 1; j <= t_len; ++j) {
            if(s[i-1] == t[j-1]) dp[i][j] = dp[i-1][j-1] + 1;
            else dp[i][j] = max(dp[i][j-1], dp[i-1][j]);
        }
    }

    string ret;
    calc(s_len, t_len, ret);

    cout << ret << endl;
}


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


int main()
{
	int n, m;
	cin >> n >> m;

	map<int, int> mp;
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		if (mp.count(a) == 0) {
			mp[a] = 1;
		}
		else if (mp.count(a) == 1){
			mp[a] += 1;
		}

		if (mp.count(b) == 0) {
			mp[b] = 1;
		}
		else if (mp.count(b) == 1) {
			mp[b] += 1;
		}
	}

	for (int i = 1; i < n+1; i++) {
		if (mp.count(i) == 0) {
			cout << 0 << endl;
		}
		else if (mp.count(i) == 1) {
			cout << mp[i] << endl;
		}
	}

    return 0;
}

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

typedef long long ll;

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

    ll x,y;
    cin >> x >> y;
    if(x%y==0) cout << -1 << endl;
    else cout << x << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

void insertion_sort(int a[], int n)
{
    int i, tmp;
    for(i = 0; i < n-1; i++)
    	printf("%d " ,a[i]);
    printf("%d\n", a[n-1]);
    for (i = 1; i < n; i++){
        int j = i;
        while (j >= 1 && a[j - 1] > a[j]) {
            tmp = a[j-1];
            a[j-1] = a[j];
            a[j] = tmp;
            j--;
        }
        for (j = 0; j < n-1; j++)
            printf("%d " , a[j]);
        printf("%d\n", a[n-1]);
    }
}

int main(void)
{
    int n, i;
    
    scanf("%d", &n);
    int a[100];
    for (i = 0; i < n; i++)
        scanf("%d", &a[i]);
    
    insertion_sort(a, n);
    return 0;
}


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

int n,d,x,sum=0;
int arr[100];
int main(){
	cin>>n>>d>>x;
	for(int i=0;i<n;i++){
		cin>>arr[i];
		sum++;
		sum+=((d-1)/arr[i]);
	}
	sum+=x;
	cout<<sum;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
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;}

int ans;
void solve(int n,int k,int s){
	if(s<0||k<0||n<0) return;
	if(k==0&&s==0){
		ans++;
		return;
	}
	solve(n-1,k-1,s-n);
	solve(n-1,k,s);
}
int main(){
	int n,k,s;
	while(1){
		cin >> n >> k >> s;
		if(n==0&&k==0&&s==0) break;
		ans = 0;
		solve(n,k,s);
		cout << ans << endl;
	}
}

Measured memory_bytes: 1160
/*
   AUTHOR :- Gaurang_Kothiya
   
   Quote:-" Great things never come from comfort zones."                                                                                                                
*/
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#include <bitset>
#include <cstdint>
#include <initializer_list>
 
using namespace std;
using namespace __gnu_pbds;  
 
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> data_set; 
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long  
#define ld long double
#define f(i,x,n) for(ll i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(ll i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define b_s(a,b)   binary_search( all(a),b)
#define lb(v,n)  lower_bound(all(v) ,n )
#define ub(v,n)  upper_bound( all(v) , n)
#define gcd(a,b) __gcd(a,b)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846
#define MOD 1000000007


void Solve()
{
	ll k,n;
	cin>>k>>n;
	
	v(ll) vec(n);
	fe(x,vec) cin>>x;
	
	ll mn=-1,tmp;
	
	f(i,1,n-1)
	{
		tmp= abs(vec[i]-vec[i-1]);
		if(tmp>k/2) tmp= k=tmp;
		mn=max(mn,tmp);
	}
	tmp=abs(vec[0]-vec[n-1]);
	if(tmp>k/2) tmp=k-tmp;
	mn=max(mn,tmp);
	cout<<k-mn;	
}


signed main() 
{
	speed	
		
	ll q=1;	
	//cin>>q;	
	
	while(q--)	
	Solve();	
	
	//cout << "\n\n"<<"Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds.\n";
	return 0;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int INF=1001001001;
const int INFLL=1001001001001001001ll;
const int mod=1000000007;
inline void am(int &a,int b){
    a+=b;
    if(a>=mod)a-=mod;
}

bitset<222222>A,B;

signed main(){
    int N,M;
    cin>>N>>M;
    rep(i,M){
        int a,b;
        cin>>a>>b;
        a--;b--;
        if(a==0)A[b]=1;
        if(a==N-1)B[b]=1;

        if(b==0)A[a]=1;
        if(b==N-1)B[a]=1;
    }

    A&=B;
    rep(i,N)if(A[i]){
    cout<<"POSSIBLE"<<endl;
    return 0;}

    cout<<"IMPOSSIBLE"<<endl;
    return 0;
}


Measured memory_bytes: 256
n = int(input())
A = list(map(int,input().split()))
q = int(input())
total = sum(A)

l = [0 for i in range(10**5+1)]
for _ in range(n):
    l[A[_]] += 1

for i in range(q):
    b, c = map(int,input().split())
    total += (c * l[b])
    total -= (b * l[b])
    print(total)
    l[c] += l[b]
    l[b] = 0


Measured memory_bytes: 21072
#include <iostream>
#include <vector>
#include <string>
#define input std::cin

using vector = std::vector<int>;
using lint = long long int;
using string = std::string;

int main() {
  int n; input >> n;
  int cnt = 0;
  bool ans = false;
  for (int i=0; i<n; i++) {
	int d1, d2; input >> d1 >> d2;
	if (d1 == d2)
	  cnt ++;
	else
	  cnt = 0;
	if (cnt == 3)
	  ans = true;
  }
  if (ans)
	std::cout << "Yes" << std::endl;
  else
	std::cout << "No" << std::endl;
}



Measured memory_bytes: 3616
N = int(input())
A = [int(x) for x in input().split(' ')]
B = [int(x) for x in input().split(' ')]
C = [int(x) for x in input().split(' ')]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

M = [0] * N
index = -1
for i in range(N):
    if i != 0:
        M[i] += M[i - 1]

    inc = 0
    for j in range(index, N - 1):
        if C[j + 1] <= B[i]:
            break
        inc += 1
    M[i] += inc
    index += inc

T = [0] * N
index = -1
for i in range(N):
    if i != 0:
        T[i] += T[i - 1]
    inc = 0
    for j in range(index, N - 1):
        if B[j + 1] <= A[i]:
            break
        inc += 1
    T[i] += sum(M[index + 1: index + inc + 1])
    index += inc
print(sum(T))


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

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

signed main() {
	int n, ans = 0;
	cin >> n;
	vector<int>vec(n);
	rep(i, n) {
		vec[i] = 1;
	}
	rep(i, n) {
		int a;
		cin >> a;
		a *= -1;
		*upper_bound(vec.begin(), vec.end(), a) = a;
	}
	rep(i, n) {
		if (vec[i] != 1) {
			ans++;
		}
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1024
// Template
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;
const int MOD = 1000000007;

#define v_exists(elem, v) find(v.begin(),v.end(),elem)!=v.end()
#define s_exists(elem, s) s.find(elem)!=s.end()
#define mod_mul(x, y) x*y%MOD
#define mod_add(x, y) (x+y)%MOD
#define mod_sub(x, y) (x-y)%MOD
#define INF_INT 2147483647

typedef std::vector<std::vector<int>> Matrix;

long gcd(long a, long b) {
    return b == 0 ? a : gcd(b, a % b);
}

long lcm( long m, long n ){
    if ( ( 0 == m ) || ( 0 == n ) )
        return 0;

    return ((m / gcd(m, n)) * n);
}


long nCr(long n, long r){
    if(n==r || r==0){
        return 1;
    } else {
        return mod_add(nCr(n-1,r),nCr(n-1,r-1));
    }
}

int main(){
    long long N; cin >> N;

    bool first = false;
    for (long long i = 0; i < N; i++) {
        long long a; cin >> a;
        if(a%2==1){
            first = true;
        }
    }

    if(first){
        cout << "first" << endl;
    } else {
        cout << "second" << endl;
    }


    return 0;

}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <tuple>
#include <unordered_set>
#include <unordered_map>

using namespace std;

const int limit = 50;

int n, m;
int a[limit], b[limit];
bool graph[limit][limit];
bool visited[limit];

void dfs(int v) {
  visited[v] = true;
  for (int v2 = 0; v2 < n; v2++) {
    if (!graph[v][v2])
      continue;
    if (visited[v2])
      continue;
    dfs(v2);
  }
}

int main(void) {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    a[i]--;
    b[i]--;
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
  }

  int ans = 0;
  for (int i = 0; i < m; i++) {
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = false;
    for (int j = 0; j < n; j++) visited[j] = false;
    dfs(0);

    bool bridge = false;
    for (int j = 0; j < n; j++)
      if (!visited[j])
        bridge = true;
    if (bridge)
      ans += 1;

    graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
  }
  cout << ans << endl;
}


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

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

using namespace std;

int main(){
  ll n;cin>>n;
  vector<ll> a(n);
  rep(i, n)cin>>a[i];
  sort(a.begin(), a.end());

  vector<ll> c(n);
  rep(i,n) c[i]=2*(i%2 ? -1 : 1);
  c[0]/=2;
  c[n-1]/=2;

  sort(c.begin(), c.end());
  ll r1=0;
  rep(i,n) r1 += a[i]*c[i];

  rep(i,n)c[i]*=-1;
  sort(c.begin(), c.end());

  ll r2=0;
  rep(i,n)r2 += a[i]*c[i];

  cout<<max(r1, r2);

  return 0;
}

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

int main() {
  int N,counter;
  cin >> N;
  for(int i=0;i<N;i++){
    int l,r;
    cin >> l >> r;
    for(int j=0;j<r-l+1;j++) counter++;
  }
  cout << counter << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn=2e5+10;
const int mod=1e9+7;
main(){
    int n;
    cin>>n;
    int a[85];
    for(int i=1;i<=n;++i)cin>>a[i];
    int mon[85];
    int s=0,m=1000;
    for(int i=1;i<=n-1;++i){
        //cout<<a[i+1]<<" "<<a[i]<<endl;
        if(a[i+1]>a[i]){
            s+=m/a[i];
            m-=a[i]*(m/a[i]);
            m+=a[i+1]*s;
            s=0;
        }else{
            //cout<<"*"<<endl;
            m+=s*a[i];
            s=0;
            s+=m/a[i+1];
            m-=s*a[i+1];
        }
        //cout<<m<<" "<<s<<endl;
    }
    cout<<m+s*a[n]<<endl;;
}


Measured memory_bytes: 3632
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

using namespace std;
const int MOD = 1000000007;
const int MAX = 10000;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}


long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(void)
{
    COMinit();
    int n,k;
    cin >>n >>k;


    for(int i = 0; i < k; i++){
        long long c1 = COM(k-1, i);
        long long c2 = COM(n-k+1, i+1);

        printf("%lld\n", c1*c2 % MOD);
    }


    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n){
    cin >>a[i];
  }
  map<int, int> mp;
  ll ans=0;
  repo(i, n-1){
    mp[i-1+a[i-1]]++;
    int nma=i-a[i];
    ans+=mp[nma];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 21044
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
const int mod=998244353;
int n,m,a[310][310];
int od[310],ev[310],bit[310],xxj[310];
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			cin>>a[i][j],a[i][j]&=1;
	if(n<m)
	{
		for(int i=1;i<=n;i++)
			for(int j=i+1;j<=m;j++)
				swap(a[i][j],a[j][i]);
		swap(n,m);
	}

	int u=max(n,m);
	od[1]=1;ev[1]=3;
	for(int i=2;i<=u;i++)
	{
		od[i]=(ev[i-1]+3ll*od[i-1]%mod)%mod;
		ev[i]=(od[i-1]+3ll*ev[i-1]%mod)%mod;
	}
	int cnt=0;
/*	for(int i=1;i<=u;i++)
	{
		int p=i;
		for(int j=i+1;j<=u;j++)
			if(a[i][i]<a[j][i]) p=j;
		if(p!=i) swap(a[p],a[i]);
		if(!a[i][i]) continue;
		cnt++;
		for(int j=i+1;j<=u;j++)
			if(a[j][i])
				for(int k=i;k<=u;k++)
					a[j][k]^=a[i][k];
	}
*/
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
			if(a[i][j])
			{
				if(xxj[j])
					for(int k=j;k<=m;k++)
						a[i][k]^=a[xxj[j]][k];
				else {xxj[j]=i;cnt++;break;}
			}
	}
	bit[0]=1;
	for(int i=1;i<=u;i++) bit[i]=2ll*bit[i-1]%mod;
	int bs=1ll*bit[n-cnt]*bit[m-cnt]%mod;
	printf("%lld\n",1ll*od[cnt]*bs%mod);
}


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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = (int)(n); i >= 0; i--)
#define repm(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define repmr(i, m, n) for(int i = (int)(n); i >= (int)(m); i--)
#define all(x) (x).begin(),(x).end()
#define inf 2e9

using namespace std;
typedef long long int lli;
typedef long long ll;

int n,q;
vector<vector<int>> tree(200000, vector<int>());

int main() {
    int a,b;
    cin >> a >> b;

    int ans = a+b;
    if(ans > 23) ans -= 24;

    cout << ans << endl;
}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;


int main(){
    fast_io

    int x, a, b;
    cin>>x>>a>>b;
    x-=a;
    cout<<x%b<<endl;
    
    return 0;
}


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

int main() {
    double x1, x2, y1, y2, d;
    cin >> x1 >> y1 >> x2 >> y2;
    d = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
    printf("%.5lf\n", d);
    return 0;
}

Measured memory_bytes: 1236
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

using namespace std;

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

    string s, t;
    cin >> s;
    cin >> t;

    for (int i = s.length() - 1; i >= 0; i--) {
        if (s[i] == t[0] or s[i] == '?') {
            bool match = true;
            for (int j = 0; j < t.length() and match; j++) {
                if(!(s[i + j] == t[j] or s[i + j] == '?')){
                    match = false;
                }
            }

            if(match){
                for(int j=0; j<t.length(); j++){
                    s[i + j] = t[j];
                }

                for(int j=0; j<s.length(); j++){
                    if(s[j] == '?') s[j] = 'a';
                }
                cout << s << "\n";
                return 0;
            }
        }
    }

    cout << "UNRESTORABLE\n";
    return 0;
}


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

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


Measured memory_bytes: 256
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")
// -------------------</optimizations>--------------------
#include <iostream>
#include <bitset>
#include <algorithm>        // sort()
#include <vector>           // for vectors
#include <map>              // for ordered map
#include <unordered_map>
#include <list>             // for list
#include <iomanip>          // for setprecision()
#include <cmath>            // for pow(), sqrt(), log(), log10(), ....
#include <cstring>          // for memset()
#include <unordered_set>    // for unordered_set
#include <climits>          // for INT_MAX & INT_MIN
#include <set>              // for ordered set

#define C ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
#define INF INT_MAX
#define NINF INT_MIN
#define MOD 1000000007
const double pi=acos(-1); // value of pi


bool isVowel(char ch) {
    if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') {
        return 1;
    }
    return 0;
}

bool compare(pair<ll, ll> a, pair<ll, ll> b) {
    return a.second<b.second;
}


bool isPrime(ll n) {
    for(ll i=3; i*i<=n; i+=2) {
        if(n%i==0) {
            return false;
        }
    }
    return true;
}

ll binary_exp(ll x, ll n, ll mod)
{
    if (n == 0) {
        return 1;
    } else if (n == 1) {
        return x % mod;
    } else {
        ll temp = binary_exp(x, n / 2, mod);
        temp = (temp * temp) % mod;

        if (n % 2 == 0) {
            return temp;
        } else {
            return ((x % mod) * temp) % mod;
        }
    }
}

map<ll, list<ll>> m;
// map<ll, ll> m;

int main() {
    C
//     freopen("input.txt","r",stdin);
// 	freopen("output.txt","w",stdout);
    int t=1;
    // cin >> t;
    while(t--) {
        ll n;
        cin >> n;
        ll x=n%1000;
        if(x!=0) {
            x=1000-x;
        }
        cout << x << endl;
    }
}


Measured memory_bytes: 3168
#include<iostream>
using namespace std;
int main(){
	int N;
	cin>>N;
	int x=N*800;
	int y;
	y=200;
 if(N>=15){
	y*=(N/15);
	cout<<x-y;
		}
	else if(N<15){
	cout<<x;	}
	return 0;
}

Measured memory_bytes: 256
import math

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

for i in range(1101):
    ans = i
    if i == 1100:
        print('-1')
        break
    elif math.floor(ans * 0.08) == A and math.floor(ans * 0.1) == B:
        print(i)
        break
    else:
        continue



Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <string>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };


int main(void) {
    int i, j;
    string s;
    
    cin >> s;
    i = 0;
    while (s[i])
    {
        j = i + 1;
        while (s[j])
        {
            if (s[i] == s[j])
            {
                printf("no\n");
                return (0);
            }
            j++;
        }
        i++;
    }

    printf("yes\n");

    return 0;
}

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

using namespace std;

#define ll long long
ll arr[1000][1000];

ll co(ll p){
    for(ll i = 1; i<=p; i++){
        if((i*(i+1)/2) == p)return i;
    }
    return -1;
}

int main()
{
    ll n;
    cin >> n;
    ll k = co(n);
    if(k == -1){
        cout << "No\n";
        return 0;
    }
    else{
        int nw = 1;
        for(int i = 1; i<=k+1; i++){
            if(i==1){
                for(int j = 1; j<=k; j++){
                    arr[i][j] = nw++;
                }
            }
            else{
                int j = 1;
                for(int p = 1; p<i; p++){
                    arr[i][j++] = arr[p][i-1];
                }
                for(; j<=k;){
                    arr[i][j++] = nw++;
                }
            }
        }
    }
    printf("Yes\n");
    printf("%lld\n",k+1);
    for(int i = 1; i<=k+1; i++){
        printf("%lld ",k);
        for(int j = 1; j<=k; j++){
            printf("%lld ",arr[i][j]);
        }
        printf("\n");
    }
}


Measured memory_bytes: 5376
#include <stdio.h>
#include <stdlib.h>

int comp(const void * elem1, const void * elem2)
{
  int f = *((int *)elem1);
  int s = *((int *)elem2);
  if (f > s) return 1;
  if (f < s) return -1;
  return 0;
}

int main(int argc, char *argv[])
{
  int array[3] = {};
  int n = 0;
  int m = 0;
  int x = 0;
  int y = 0;

  scanf("%d %d %d %d", &n, &m, &x, &y);

  int *arr_x = (int *) calloc(n, sizeof(int));
  int *arr_y = (int *) calloc(m, sizeof(int));

  int i = 0;
  char tmp;
  do {
    scanf("%d%c", &arr_x[i], &tmp);
    i++;
  } while (i != n);
  
  int j = 0;
  do {
    scanf("%d%c", &arr_y[j], &tmp);
    j++;
  } while (j != m);
  qsort(arr_x, n, sizeof(int), comp);
  qsort(arr_y, m, sizeof(int), comp);

  if (arr_x[n-1] < arr_y[0] && arr_x[n-1] > x && arr_y[0] < y) {
    printf("No War\n");
  } else {
    printf("War\n");
  }
  return 0;
}


Measured memory_bytes: 128
#include<string>
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<map>
using namespace std;
typedef long long int llint;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
const llint mod=100000007;
const llint big=1e9;
const llint red=0xE869120;
const llint pro=1002001;
int main(void){
	int a,i,j,n,ansa=0,ansb=0;cin>>n;
	vector<int> vec(n);
	bool col[8]={false};
	for(i=0;i<n;i++){cin>>vec[i];}
	sort(vec.begin(),vec.end());
	for(i=0;i<n;i++){
		if(vec[i]<3200){col[vec[i]/400]=true;}
		else{ansb++;}
	}
	for(i=0;i<8;i++){if(col[i]){ansa++;}}
	cout<<max(1,ansa)<<" "<<ansa+ansb<<endl;
	return 0;
}

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

class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split();
        int N = int.Parse(input[0]);
        int L = int.Parse(input[1]);
        int sum = 0;
        if (L>= 0)
        {
            for(int i = 0; i < N - 1; i++)
            {
                sum += L + 1 + i;
            }
        }
        else if(L + N - 1 >= 0)
        {
            for (int i = 0; i < N; i++)
            {
                sum += L + i;
            }
        }
        else
        {
            for (int i = 0; i < N - 1; i++)
            {
                sum += L + i;
            }
        }
        Console.WriteLine(sum);
    }
   
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define Flash ios_base::sync_with_stdio(false); cin.tie(NULL)
#define all(v) v.begin(),v.end()
#define rev(v) reverse(all(v))
#define sot(v) sort(all(v))
#define printa(a,L,R) for(int i=L;i<R;i++) cout<<a[i]<<(i==R-1?'\n':' ')
#define printv(a) printa(a,0,a.size())
#define print2d(a,end,c) for(int i=0;i<end;i++) for(int j=0;j<c;j++) cout<<a[i][j]<<(j==c-1?'\n':' ')
#define mem(a,x) memset(a,x,sizeof(a))

const int N = (int) 1e5 + 7;
const int MOD = (int) 1e9 + 7;
const ll INF = (ll) 1e18;

using namespace std;

int main() {
    int n;
    ll x;
    cin >> n;
    vector <vector<int>> A(2, vector<int>(61));
    while(n--) {
        cin >> x;
        for(int i = 0; i < 61; i++) {
            A[(x&(1ll<<i))>0][i]++;
            A[(x&(1ll<<i))>0][i] %= MOD;
        }
    }
    ll res = 0;
    for(int i = 0; i < 61; i++) {
        res += ((((ll) A[0][i] * A[1][i])%MOD) * ((1ll<<i)%MOD))%MOD;
        res %= MOD;
    }
    cout << res;
    return 0;
}


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

typedef long long W;

const W INF = 1LL << 50;

struct edge {
	int to;
	W cost;
};
typedef pair<W, int> P;
typedef vector<vector <edge > > Graph;

vector<W> dijkstra(int s, const Graph& G) {
	vector<W> d(G.size());
	priority_queue< P, vector<P>, greater<P> > que;
	fill(d.begin(), d.end(), INF);
	d[s] = 0;
	que.push(P(0, s));
	while(!que.empty()) {
		P p = que.top();
		que.pop();
		int v = p.second;
		if(d[v] < p.first) continue;
		for(int i = 0; i < G[v].size(); i++) {
			edge e = G[v][i];
			if(d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
	return d;
}

template <class T>
struct BIT {
	int n;
	vector<T> x;
	BIT(int n_ = 0) : n(n_), x(n + 1, 0) {}
	int size() const { return n; }
	T sum(int r) const {
		T S = 0;
		for(r = r - 1; r >= 0; r = (r & (r + 1)) - 1) S += x[r];
		return S;
	}
	T sum(int l, int r) const { return sum(r) - sum(l); }
	void add(int k, const T &a) {
		for(; k < n; k |= k + 1) x[k] += a;
	}
	void set(int k, const T &a) { add(k, a - sum(k, k + 1)); }
	int lower_bound(T x) {
		int ng = -1, ok = n - 1;
		while(abs(ng - ok) > 1) {
			int mid = (ng + ok) / 2;
			if(sum(0, mid + 1) >= x) ok = mid;
			else ng = mid;
		}
		return ok;
	}
};

struct Q {
	ll fs, fg;
	int id;
	bool operator <(const Q& x) const {
		return fs < x.fs;
	}
};

typedef pair<ll, ll> Pll;

int ans[100000];

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

	int n, m;
	cin >> n >> m;

	Graph G(n);
	for(int i = 0; i < m; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		G[a].push_back({ b, c });
		G[b].push_back({ a, c });
	}

	vector<W> ds = dijkstra(0, G);
	vector<W> dg = dijkstra(n - 1, G);
	vector<Pll> dd(n);
	map<W, int> dg_map;
	for(int i = 0; i < dg.size(); i++) {
		dg_map[dg[i]] = -1;
		dd[i] = { ds[i], dg[i] };
	}
	sort(dd.begin(), dd.end());
	int cnt = 0;
	for(auto v : dg_map) {
		dg_map[v.first] = cnt++;
	}

	int qn;
	cin >> qn;
	vector<Q> qs(qn);
	for(int i = 0; i < qn; i++) {
		cin >> qs[i].fs >> qs[i].fg;
		qs[i].id = i;
	}
	sort(qs.begin(), qs.end());

	BIT<ll> b(cnt);
	int di = 0;
	for(auto q : qs) {
		while(di < n && dd[di].first <= q.fs) {
			int idx = dg_map[dd[di].second];
			b.add(idx, 1);
			di++;
		}
		auto it = dg_map.lower_bound(q.fg);
		if(it == dg_map.end()) continue;
		ans[q.id] = b.sum(it->second, cnt);
	}

	for(int i = 0; i < qn; i++) {
		cout << ans[i] << endl;
	}
}

Measured memory_bytes: 22704
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<stack>
using namespace std;

#define REP(i,n) for(int i=0;(i)<(n);(i)++)
#define ll long long

int A, B;
int ans;

signed main() {
	cin >> A >> B;

	int tmp = 1;
	REP(i, A) {
		tmp *= 100;
	}

	if(B<100) ans = tmp*B;
	else ans = tmp*(B + 1);


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

Measured memory_bytes: 256
// input に入力データが全部入る
function Main(input) {
    // // 1行目がinput[0], 2行目がinput[1], …に入る
    // input = input.split("\n"); //複数行入力がある場合に使用
    // tmp = input[1].split(" "); 

    // // 文字列から10進数に変換するときはparseIntを使います
    // var a = parseInt(input[0], 10);
    // var b = parseInt(tmp[0], 10);
    // var c = parseInt(tmp[1], 10);
    // var s = input[2];

    // // 出力
    // console.log('%d %s', a+b+c, s);

input = input.split(" ");
var a = parseInt(input[0]);
var b = parseInt(input[1]);
var menseki = a*b;
var shu = a+b+a+b;
console.log(menseki+" "+shu);

}

// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug() {
    var input = document.getElementById("input").value;
    Main(input);
}

//* この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
 Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 15124
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

internal static class CR
{
    public static string GetText() { return Console.ReadLine(); }
    public static List<string> GetTexts() { return Console.ReadLine().Split(' ').ToList(); }
    public static long GetLong() { return long.Parse(Console.ReadLine()); }
    public static List<long> GetLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }
}

namespace AtCoder.C
{
    public class Program
    {
        public static long N { get; private set; }
        public static List<string> S { get; private set; }

        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            N = CR.GetLong();
            //S = new List<string>();
            //for (int i = 0; i < N; i++)
            //{
            //    S.Add(CR.GetText());
            //}

            //var countDic = new Dictionary<string, int>();
            //foreach (var item in S)
            //{
            //    if (countDic.ContainsKey(item))
            //    {
            //        countDic[item]++;
            //    }
            //    else
            //    {
            //        countDic.Add(item, 1);
            //    }
            //}

            var countDic = new Dictionary<string, int>();
            for (int i = 0; i < N; i++)
            {
                var item = CR.GetText();
                if (countDic.ContainsKey(item))
                {
                    countDic[item]++;
                }
                else
                {
                    countDic.Add(item, 1);
                }
            }

            var maxCount = countDic.Max(x => x.Value);

            var sb = new StringBuilder();
            var arr = countDic.Where(x => x.Value == maxCount).Select(x=>x.Key).ToArray();
            Array.Sort(arr, StringComparer.Ordinal);
            foreach (var item in arr)
            {
                sb.AppendLine(item);
            }

            return sb.ToString();
        }
    }
}


Measured memory_bytes: 45176
#include<iostream>
#include<vector>
#include<string>
#include<deque>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<cmath>
using namespace std;

typedef long long LL;

LL solve(){
    vector<string> strs= { "SUN", "MON", "TUE", "WED", "THU", "FRI","SAT"};
    unordered_map<string,int> idx;
    for(int i  = 0;i<7;i++){
        idx[strs[i]] = i;
    }
    string str;
    cin>>str;
    return 7-idx[str];
}

int main(){
    int T = 1;
    while(T--){
        long long res = solve();
        cout<<res<<endl;
    }
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <limits>

using namespace std;

#define ll long long

#define in(x) cin >> x
#define out(x) cout << x << endl

#define PI acos(-1)
#define pp push_back

#define Yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define No cout << "No" << endl
#define NO cout << "NO" << endl

#define vec2(type) vector<vector<type>>
#define vec3(type) vector<vector<vector<type>>>

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

template<typename T> void input(T *data, int n){
	For(i, n){
		cin >> data[i];
	}
}

template<typename T> void input(vector<T> &vec, int n){
	T temp;
	For(i, n){
		cin >> temp;
		vec.push_back(temp);
	}
}

template<typename T> void sort(vector<T> &ary){
	sort(ary.begin(), ary.end());
}

template<typename T> void rsort(vector<T> &ary){
	sort(ary.rbegin(), ary.rend());
}

void rstring(string &str){
	string temp = str;

	For(i, (int)str.size()){
		str[i] = temp[(str.size() - 1) - i];
	}
}

struct Vec{
	int x, y;
	Vec():
	x(0), y(0){}
	Vec(int _x, int _y):
	x(_x), y(_y){}
};

template<typename T> void print(T *x, int n){
	For(i, n){
		cout << x[i] << " ";
	}
	cout << endl;
}

template<typename T> void print(vector<T> &x){
	For(i, (int)x.size()){
		cout << x[i] << " ";
	}
	cout << endl;
}

int gcd(int n, int m){
	if(n % m == 0){
		return m;
	}
	else{
		return gcd(m, n % m);
	}
}

int main(){

	int n, m, c;
	int b[20];
	int a[20];
 
	cin >> n >> m >> c;
	input(b, m);
 
	int count = 0;
	int sum;
 
	For(i, n){
		sum = 0;
		input(a, m);
		For(j, m){
			sum += a[j] * b[j];
		}
		sum += c;
		if(sum > 0){
			count++;
		}
 
	}
 
	out(count);

	return 0;

}

Measured memory_bytes: 256
import java.io.*;
import java.math.BigInteger;
import java.util.*;


public class Main {

  void solve() throws IOException {
    int h = nextInt();
    int a = nextInt();
    out.println((h - 1) / a + 1);
  }

  public static void main(String[] args) throws IOException {
    new Main().run();
  }

  void run() throws IOException {
    reader = new BufferedReader(new InputStreamReader(System.in));
//		reader = new BufferedReader(new FileReader("input.txt"));
    tokenizer = null;
    out = new PrintWriter(new OutputStreamWriter(System.out));
//		out = new PrintWriter(new FileWriter("output.txt"));
    solve();
    reader.close();
    out.flush();

  }

  BufferedReader reader;
  StringTokenizer tokenizer;
  PrintWriter out;

  int nextInt() throws IOException {
    return Integer.parseInt(nextToken());
  }

  long nextLong() throws IOException {
    return Long.parseLong(nextToken());
  }

  double nextDouble() throws IOException {
    return Double.parseDouble(nextToken());
  }

  String nextToken() throws IOException {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine());
    }
    return tokenizer.nextToken();
  }
}


Measured memory_bytes: 21076
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 8080
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD=1e9+7;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

int main(){
	string str;
	cin>>str;
	int w;
	cin>>w;
	for(int i=0;i<str.size();i++){
		if(i%w==0)cout<<str[i];
	}
	cout<<endl;
}

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

int main(void) {

    int n, a, b ;
    cin >> n >> a >> b ;

    int train = n * a ;
    int taxi = b ;

    if (train < taxi) 
        cout << train << endl ;
    else
        cout << taxi << endl ;

    return 0 ;
}

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

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
  scanf("%d %d %d", a1, a2, a3);
  return 0;
}

#define NUM_MAX 500

struct train {
    int duration;
    int start;
    int interval;
};

int main(void) {
    int num = get_int();

    static struct train trains[NUM_MAX];
    int i;
    for(i = 0; i < num-1; i++) {
        int c, s, f;
        get_int3(&c, &s, &f);
        trains[i] = (struct train){c, s, f};
    }

    static int ans[NUM_MAX];
    int start;
    for(start = num-2; start >= 0; start--) {
        int elapse = 0;
        for(i = start; i < num-1; i++) {
            struct train t = trains[i];
            if(elapse <= t.start) {
                elapse = t.start;
            } else {
                if(elapse%t.interval) {
                    elapse = (elapse/t.interval+1)*t.interval;
                }
            }
            elapse += t.duration;
#ifdef DEBUG
            printf("start: %d -> %d\n", start, elapse);
#endif
        }
        ans[start] = elapse;
    }

    for(i = 0; i < num; i++) {
        printf("%d\n", ans[i]);
    }
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a, b) ((a < b) ? a : b)
#define _max(a, b) ((a < b) ? b : a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a) ? 1 : -1)
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380

int main() {
    cout << fixed << setprecision(10);
    int X;
    cin >> X;
    int m = X / 100;
    X %= 100;

    if((X - 1) / 5 + 1 <= m) {
        cout << 1;
    } else {
        cout << 0;
    }

    return 0;
}
/*
100a+101b+102c

100*(a+b+c+d+e+f)+b+2c+3d+4e+5f


0-5     1
6-10    2
11-15   3



*/

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := NewScanner()
	A, B, K := sc.NextInt(), sc.NextInt(), sc.NextInt()

	a := min(A, K)
	A -= a
	K -= a

	B -= min(B, K)

	fmt.Println(A, B)
}

func min(a int, b int) int {
	if a < b {
		return a
	}
	return b
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


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


def solve(N, A, fromR=True):
    res = 0
    L, R = None, None

    while A:
        fromR = 1 - fromR

        if L is None:
            L = A.pop() if fromR else A.popleft()
            R = L
            continue

        if len(A) > 1:
            if fromR:
                x = A.pop()
                y = A.pop()
            else:
                x = A.popleft()
                y = A.popleft()
            res += abs((R + L) - (x + y))
            R, L = x, y
            continue

        if len(A) == 1:
            x = A.pop()
            res += max(abs(R - x), abs(L - x))
            continue

    return res


if __name__ == "__main__":
    N = int(input())
    A = sorted([int(input()) for _ in range(N)])
    B = deque(A[::])
    A = deque(A)
    

    ans1 = solve(N, A, 0)
    ans2 = solve(N, B, 1)
    ans = max(ans1, ans2)
    print(ans)


Measured memory_bytes: 8872
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <map>
#include <vector>
//#include <unordered_map>
//#include <unordered_set>
#include <stack>
#include <set>
#include <queue>
#include <list>
#define LL long long
#define N 100100
#define M 110
#define MOD 1000000007
#define FOR(i,l,r) for (int i = (l); i <= (r); i ++)
#define CLR(a,x) memset(a,x,sizeof(a))
#define INF 0x3f3f3f3f
#define ALL(x) x.begin(),x.end()
#define pb push_back
#define X first
#define Y second
using namespace std;
const int maxn=100005;
int main()
{
    int n;
    cin>>n;
    if(n%10==9||9==n/10) puts("Yes");
    else puts("No");
	return 0;
}


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

int main()
{
	int n, k;
  	cin >> n >> k;
  	int have[n];
  	for(int i = 0; i < n; i++)
    {
    	have[i] = 0;
    }
  	for(int i = 0; i < k; i++)
    {
    	int d;
      	cin >> d;
      	for(int j = 0; j < d; j++)
        {
        	int l;
          	cin >> l;
          	have[l-1]++;
        }
    }
  	int cnt = 0;
  	for(int i = 0; i < n; i++)
    {
    	if(have[i] == 0)
        {
        	cnt++;
        }
    }
  	cout << cnt << endl;
}


Measured memory_bytes: 3592
import sys
input=sys.stdin.readline
n=int(input())
l=list(map(int,input().split()))
l.sort()
import bisect
ans=0
for i in range(n):
    for j in range(i+1,n):
        x=bisect.bisect_left(l,l[i]+l[j],lo=j+1)
        ans+=x-j-1
print(ans)


    



Measured memory_bytes: 45348
object Main {
  def main(args: Array[String]): Unit = {
    val s = io.StdIn.readLine()

    var c, f = false

    for (ch <- s) {
      if (ch == 'C') c = true
      if (ch == 'F' && c) f = true
    }

    println(if (c && f) "Yes" else "No")
  }
}


Measured memory_bytes: 21556