akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#define popcount __builtin_popcount
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD=1e9+7;
ll powmod(ll a, ll k){
    ll ap=a, ans=1;
    while(k){
        if(k&1){
            ans*=ap;
            ans%=MOD;
        }
        ap=ap*ap;
        ap%=MOD;
        k>>=1;
    }
    return ans;
}
ll inv(ll a){
    return powmod(a, MOD-2);
}
ll f[1000010], invf[1000010];
void fac(int n){
    f[0]=1;
    for(ll i=1; i<=n; i++) f[i]=f[i-1]*i%MOD;
    invf[n]=inv(f[n]);
    for(ll i=n-1; i>=0; i--) invf[i]=invf[i+1]*(i+1)%MOD;
}
ll comb(int x, int y){
    if(!(0<=y && y<=x)) return 0;
    return f[x]*invf[y]%MOD*invf[x-y]%MOD;
}
int main()
{
    int n; cin>>n;
    ll s=0, ans=0;
    for(int i=0; i<n; i++){
        ll a; cin>>a;
        (ans+=s*a)%=MOD;
        (s+=a)%=MOD;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string S,T;
  cin >> N >> S >> T;
  string ans;
   
  for(int i=0;i<N;i++){
    ans += S.at(i);
    ans += T.at(i);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env pypy3

import bisect
import itertools


def in_place_count_stages(n, xs, ys, zs):
    xs.sort()
    ys.sort()
    zs.sort()
    y_to_z_num = [n - bisect.bisect(zs, y) for y in ys]
    acc_y_to_z_num = list(itertools.accumulate(y_to_z_num))
    x_to_y_idxs = [bisect.bisect(ys, x) for x in xs]
    g = acc_y_to_z_num
    x_to_res = [g[-1] - (g[i - 1] if i > 0 else 0) for i in x_to_y_idxs]
    return sum(x_to_res)


def main():
    n = int(input())
    xs = [int(x) for x in input().split()]
    ys = [int(x) for x in input().split()]
    zs = [int(x) for x in input().split()]
    res = in_place_count_stages(n, xs, ys, zs)
    print(res)


if __name__ == '__main__':
    main()


Measured memory_bytes: 118628
n = int(input())
a_ls = list(map(int, input().split()))
b_ls = list(map(int, input().split()))
times_add = 0
diff_to_pad = 0
for i in range(n):
    diff = b_ls[i] - a_ls[i]
    if diff > 0:
        times_add += -(-diff//2) 
        if diff % 2 == 1:
            diff_to_pad += 1
    elif diff < 0:
        diff_to_pad += -diff
if diff_to_pad > times_add:
    res = 'No'
else:
    res = 'Yes'
print(res)



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

int main(){
	int n;
	string s;
	cin >> n;
	cin >> s;
	
	vector<int> ints(n);
	rep(i,n) ints[i] = s[i] - '0';
	
	vector<vector<int>> idx(10);
	rep(i,n) idx[ints[i]].push_back(i);
	
	
	/*
	123123
	1:0,3
	2:1,4
	3:2,5
	*/
	
	
	int res = 0;
	rep(i,10){
		rep(j,10){
			rep(k,10){
				// "kji"が作りたいとする
				if(idx[i].size() == 0) continue;
				if(idx[j].size() == 0) continue;
				if(idx[k].size() == 0) continue;
				// 最初のk
				int now = idx[k][0];
				
				// 最初のk+1から最初のj
				auto jitr = upper_bound(idx[j].begin(), idx[j].end(), now);
				if(jitr == idx[j].end()) continue;
				now = *(jitr);
				
				// 最初のj+1から最初のi
				auto iitr = upper_bound(idx[i].begin(), idx[i].end(), now);
				if(iitr == idx[i].end()) continue;
				res++;			
			}
		}
	}
	
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF 2 << 29
#define MOD 1000000007
#define Yes(f) puts((f)? "Yes" : "No")
#define YES(f) puts((f)? "YES" : "NO")
int gcd(int a, int b) {
	if (b != 0)return gcd(b, a % b);
	return a;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}

using Graph = vector<vector<int>>;

int main(){
	 int n; cin >> n;
	 for(int i = n; ; i++){
		 bool f = true;
		 for(int j = 2; j < i; j++){
			 if(i % j == 0) f = false;	
		 }
		 if(f) {
			 cout << i << endl;
			 return 0;
		 }
	 }
}

Measured memory_bytes: 256
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))

a = sorted(a, key=lambda x: x[0])
purchase_price = 0


for price, count in a:
    if count < m:
        purchase_price += price * count
        m -= count

    else:
        purchase_price += price * m
        m = 0

print(purchase_price)


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

#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;

struct Pyramid{
    ll x,y,h;
};

int main() {
    ll N; cin >> N;
    vector<Pyramid> pyramid;
    REP(i,N){
        Pyramid p;
        cin >> p.x >> p.y >> p.h;
        if(p.h == 0)continue;
        pyramid.push_back(p);
    }

    if(pyramid.size() == 1){
        cout << pyramid[0].x << " " << pyramid[0].y << " " << pyramid[0].h << endl;
        return 0;
    }

    REP(x, 101){
        REP(y,101){
            ll H = pyramid[0].h + abs(x-pyramid[0].x) + abs(y-pyramid[0].y);
            bool ok = true;
            FOR(i,1,pyramid.size()){
                if(H != pyramid[i].h + abs(x-pyramid[i].x) + abs(y-pyramid[i].y)){
                    ok = false; 
                    break;
                }
            }
            if(ok){
                cout << x << " " << y << " " << H << endl;
                return 0;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
#define mxn 1000010
#define LL long long
#define pb push_back
#define pf push_front
#define pii pair<int,int> 
#define mp make_pair
#define fr first
#define sc second
using namespace std;
int n,L,M,sl,fh,a[mxn];
LL sum;
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
int main()
{
	n=rd();L=rd();M=1e9;
	for(int i=1;i<=n;++i)
	{
		a[i]=L+i-1,sum+=a[i];
		if(abs(a[i])<abs(M)) M=a[i];
	}
	printf("%lld\n",sum-M);
	return 0;
}

Measured memory_bytes: 256
n=int(input()) 
member=input()

left_w=[0]*n
right_e=[0]*n
for i in range(1,n):
    left_w[i]=left_w[i-1]
    if member[i-1]=="W":
        left_w[i]+=1
    
    right_e[n-i-1]=right_e[n-i]
    if member[n-i]=="E":
        right_e[n-i-1]+=1
    
min_num=n
for i in range(n):
    # 左側のWの数と右のEの数が向きを変える
    min_num=min(min_num,left_w[i]+right_e[i])
print(min_num)

Measured memory_bytes: 17640
#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  bool f = false;
  for (int j = a.size(); j >=0; j-=2) {
    if (j%2 == 1 && f == false) {
      f = true;
      a.pop_back();
    }
    if (a.substr(0, a.size()/2) == a.substr(a.size()/2, a.size()-1) && f) {
      cout << j << endl;
      break;
    }
    a.pop_back();
    a.pop_back();
    f = true;
  }
}

Measured memory_bytes: 3616
#include <cstdio>
#include <string>
#include <iostream>
#include <cmath>
#include <vector>
#include <stack>
#include <algorithm>


using namespace std;
typedef long long LL;

int main(void) {

	int N, i = 0, cnt = 0, max = 0;

	vector <int> nums{ 0 };

	cin >> N;

	nums.resize(N);

	while (i < N) {
		cin >> nums[i];
		i++;
	}

	for (i = 0; i < N; i++) {
		while (nums[i] % 2 == 0) {
			nums[i] /= 2;
			cnt++;
		}

		if (cnt >= max) {
			max = cnt;
		}
	}

	cout << max << endl;

	return 0;
}


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

//dp ? いや貪欲法

int main(){

    string s; cin >> s;
    int n = (int)s.size();
    int ans = 0;
    int power = 0;
    for(int i = 0; i < n; i++){
        if(s[i] == 'p'){
            if(power == 0){
                ans--;
                power++;
            }else{
                power--;
            }
        }else{
            if(power == 0){
                power++;
            }else{
                ans++;
                power--;
            }
        }
    }

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

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define re register
#define gc getchar
#define pc putchar
#define cs const

inline
ll getint(){
	re ll num=0;
	re char c;
	while(!isdigit(c=gc()));
	while(isdigit(c))num=(num<<1)+(num<<3)+(c^48),c=gc();
	return num;
}

inline
void outint(ll a){
	static char ch[23];
	if(a==0)pc('0');
	while(a)ch[++ch[0]]=(a-a/10*10)^48,a/=10;
	while(ch[0])pc(ch[ch[0]--]);
}

int n;
int x[100006];

inline
int gcd(int a,int b){
	return b?gcd(b,a%b):a;
}

int main(){
	n=getint();
	x[0]=getint();
	for(int re i=1;i<=n;++i){
		x[i]=getint();
	}
	sort(x,x+n+1);
	int g=x[1]-x[0];
	for(int re i=1;i<n;++i){
		g=gcd(g,x[i+1]-x[i]);
	}
	cout<<g;
	return 0;
}

Measured memory_bytes: 640
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
A_low =A
A_high =A
B_low = B
B_high=B
A_low=A_low-(V*T)
A_high=A_high+(V*T)
B_low=B_low-(W*T)
B_high=B_high+(W*T)
if((B_low>=A_low) and (B_high<=A_high)):
    print("YES")
    exit()
    
print("NO")

Measured memory_bytes: 61664
#include <iostream>

 

using namespace std;

 

int main()
{
   int i, h, m, s;
   cin >> i;
   h = i / 3600;
   m = (i-h*3600) / 60;
   s = i-h*3600-m*60;
   cout << h << ":" << m << ":" << s << endl;

 

   
   return 0;
}


Measured memory_bytes: 3120
//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>

using namespace std;

typedef pair<long long, long long> pl;

long long N, M, K,a,b,c,d,e,H,W;
long long A[2000] = {};
//long long t[200001] = {};
bool f[1000][1000] = {};
string S[2000];
set <long long>sll;
pl buf;
vector <pl>vpl;


int main() {
	cin >> N;

	if (N < 1200) {
		cout << "ABC" << endl;
	}
	else if (N < 2800) {
		cout << "ARC" << endl;
	}
	else {
		cout << "AGC" << endl;
	}

	return 0;
}

Measured memory_bytes: 888
'use strict'
const main = arg => {
	const input = arg.trim().split("\n");
	let N = Number(input[0].split(' ')[0])
	let x = Number(input[0].split(' ')[1])
	let As = input[1].split(' ').map(n => Number(n))
	let manip = 0
	
	// 単体でxを超えていたら減らす O(n)
	for(let i = 0; i < N ; i++) {
		let exceed = As[i] - x
		if(exceed > 0) {
			As[i] = x
			manip += exceed
		}
	}

	// 左と足しても右と足してもxを超えていたら、左と足しても超えないように減らす O(n)
	for(let i = 1; i < N - 1 ; i++) {
		let left = As[i - 1]
		let current = As[i]
		let right = As[i + 1]
		if(left + current > x && current + right > x) {
			As[i] = x - left
			manip += current - (x - left)
		}
	}
	// 右と足して超えていたら減らす O(n)
	for(let i = 0; i < N - 1 ; i++) {
		let current = As[i]
		let right = As[i + 1]
		if(current + right > x) {
			As[i] = x - right
			manip += current - (x - right)
		}
	}
	console.log(manip)
}   
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29720
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
  bool b=false;
  cin>>s;
  int l=s.length();
  int i;
  for(i=0;i<l;i++)
  {
	if(s[i]==s[i+1] && s[i+1]==s[i+2] && s[i]==s[i+2])
    {
      b=true;
      break;
    }
   // cout<<b<<" ";
  }
  if(b)cout<<"Yes";
  else cout<<"No";
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
    // freopen("a.in","r",stdin);
    // freopen("k.out","w",stdout);
    string str;
    cin  >> str;
    if(str == "Sunny") cout << "Cloudy" << endl;
    else if(str == "Cloudy") cout <<"Rainy";
    else cout << "Sunny";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int N,K;
    cin >> N >> K;
    if (N < K)
     cout << 1 << endl;
    else{
        int i;
        i = N/K;
        int count = 2;
        while(i >= K){
            count++;
            i = i/K;
        }
        cout << count << endl;
    }
}


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

using namespace std;
int main()
{
	int n,h,w;
	
	cin>>n>>h>>w;
	
	if(n-w==0)
	cout<<n-h+1<<endl;
	else if(n-h==0)
	cout<<n-w+1<<endl;
	else
	cout<<(n-h+1)*(n-w+1)<<endl;
}


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

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

typedef long long LL;

int main(){
  int a,b;
  cin >> a >> b;
  if(a+b==15) cout << '+' << endl;
  else if(a*b==15) cout << '*' << endl;
  else cout << 'x' << endl;
  return 0;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define IOS ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define AfterDecimal(n) cout << fixed << setprecision(n);
#define ll long long int
#define ld long double
#define all(a) a.begin(), a.end()
#define pii pair<int, int>
#define pll pair<ll, ll>
#define bits(x) __builtin_popcount(x)

using namespace __gnu_pbds;
using namespace std;

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")

//template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

#ifdef LOCAL
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << "# "<< name << " = " << arg1 << '\n';
}
template<typename Arg1, typename... Args>
void __f(const char* names, Arg1 && arg1, Args &&... args){
        const char* comma = strchr(names + 1 ,',');
        cout << "# ";
        cout.write(names, comma - names)<< " = " << arg1 << " | ";
        __f(comma + 1, args...);
}
#else
#define debug(...) 36
#endif


std::mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int ri(int a, int b) {
    return uniform_int_distribution<int>(a, b)(rng);
}

ll power(ll x, ll y, ll p){
   ll res = 1;
   x = x % p;
   while (y > 0) {
      if (y & 1)
         res = (res * x) % p;
      y = y >> 1;
      x = (x * x) % p;
   }
   return res;
}

const ll INF = (ll)(8e18);
const ll MOD = (ll)(1e9 + 7);
const ll HMOD = (ll)4222234727;
const ll Hashprime = (ll)31;

const int maxn = 100100;

std::vector<pii> g[maxn];
bool vis[maxn];
int val = 0;

void dfs(int v){
  bool flaga = false, flagb = false;
  for(auto i : g[v]){
     if(i.second) flaga = true;
     else flagb = true;
  }
  if(flaga && flagb) val += 1;
   for(auto i : g[v]){
      if(vis[i.first]) continue;
      vis[i.first] = true;
      dfs(i.first);
   }
}

int32_t main(){
    IOS;
    #ifndef ONLINE_JUDGE
    //  freopen("input.txt", "r", stdin);
    //  freopen("output.txt", "w", stdout);
    #endif
    int t = 1; // cin >> t;
    while(t--){
       int n,m; cin >> n >> m;
       for(int i = 1; i <= m; i++){
          int x,y,z; cin >> x >> y >> z;
          g[x].push_back({y, !(z % 2 == 0)});
          g[y].push_back({x, !(z % 2 == 0)});
       }
       int ans = 0;
       for(int i = 1; i <= n; i++){
          if(!vis[i]){
             vis[i] = true;
             val = 0;
             dfs(i);
             ans += 1;
          }
       }
       cout << ans << '\n';
    }
    #ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
}
//g++ -DLOCAL -std=c++17 -Wshadow -Wall -o "c" "comp.cpp" -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG -g


Measured memory_bytes: 12268
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Integer> list = new HashMap<>();
        String[] lines = sc.nextLine().split(" ");
        int max = 0;
        int maxLength = 0;
        String maxStr = "";
        for (String s : lines) {
            if (list.containsKey(s)) {
                int count = list.get(s) + 1;
                list.put(s, count);
                max = Math.max(max, count);
            } else {
                list.put(s, 0);
                if (s.length() > maxLength) {
                    maxLength = s.length();
                    maxStr = s;
                }
            }
        }
        for (Map.Entry<String, Integer> entry : list.entrySet()) {
            if (entry.getValue() == max) {
                System.out.print(entry.getKey() + " ");
                break;
            }
        }
        System.out.println(maxStr);
    }
}


Measured memory_bytes: 25716
/*
 * Author : Andrew J
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void in(ll &x);
#define fi first
#define se second
#define pb push_back
typedef pair <ll , ll> ii;
// const ll N = ;
ll n,k;

int main() {
   in(n); in(k);
   ll _mod = n % k;
   ll ans = min(_mod , abs(k - _mod));
   printf("%lld\n" , ans);
   return 0;
}

void in(ll &x){
	bool neg = false;
	register ll c;
	x = 0;
	c = getchar();
	if(c == '-'){
		neg = true;
		c = getchar();
	}
	for (; c > 47 && c < 58; c = getchar())
	x = (x << 1) + (x << 3) + c - 48;
	if (neg) x *= -1;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N,M; cin >> N >> M;
  vector<vector<int>> road(M, vector<int>(2));
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> road.at(i).at(j);
    }
  }
  for(int i=1;i<N+1;i++){
    int count = 0;
    for(int j=0;j<M;j++){
      for(int k=0;k<2;k++){
        if(road.at(j).at(k) == i)
          count++;
      }
    }
    cout << count << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

N, T = map(int, input().split())
A = list(map(int, input().split()))

d = 0
ans = 1
l = A[0]
for a in A[1:]:
    l = min(l, a)
    r = a
    if r - l == d:
        ans += 1
    elif r - l > d:
        ans = 1
        d = r - l

print(ans)


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

#define FO(i,a,b) for (int i = (a); i < (b); i++)
#define sz(v) int(v.size())

using namespace std;

typedef long long ll;

int n, m; ll t;
int s[300005]; int d[300005];
pair<int,int> o[300005];
int res[300005];

int main() {
    scanf("%d%d%lld", &n, &m, &t);
    FO(i,0,n) scanf("%d %d", s+i, d+i);
    FO(i,0,n) o[i] = make_pair(s[i],i);
    sort(o,o+n);
    vector<ll> p;
    ll nc = 0;
    FO(i,0,n) {
        int dir = (d[i] == 1 ? 1 : -1);
        ll pos = s[i] + dir * t;
        ll fp = ((pos%m)+m)%m;
        ll g = pos > 0 ? pos / m : (pos-m+1) / m;
        nc += g;
        p.push_back(fp);
    }
    nc = ((nc%n)+n)%n;
    sort(p.begin(),p.end());
    FO(i,0,n) res[o[i].second] = p[(i+nc)%n];
    FO(i,0,n) printf("%d\n", res[i]);
}


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

int main() {
  int n;
  cin >> n;
  bool odd = true;
  int ans = 0;
  rep(i, n) {
    int a;
    cin >> a;
    if (a % 2 && odd) ans++;
    odd = !odd;
  }

  cout << ans << endl;

  return 0;
}
/*
*/


Measured memory_bytes: 3644
/*Remember: The Struggle is Important*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

#include<bits/stdc++.h>
using namespace std;

#define     int          long long int
#define     ld           long double
#define     fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)       x.begin(),x.end()
#define     mem(a,b)     memset(a,b,sizeof(a))
#define     gcd(a,b)     (__gcd((a),(b)))
#define     lcm(a,b)     (((a)*(b))/gcd((a),(b)))
#define     pb           push_back
#define     ins          insert
#define     pii          pair<int,int>
#define     F            first
#define     S            second
#define     makep        make_pair
#define     maket        make_tuple
#define     show(x)      for(auto c:x)cout<<c<<" ";cout<<"\n";
#define     show2(x)     for(auto c:x)cout<<c.F<<" "<<c.S<<"\n";

const int inf=1e18,M=1e9+7;
const int N=1e4;

void solve()
{
    int a,b;
    cin>>a>>b;

    int x,y;
    for(int i=1;i<=N;++i)
    {
        x=i*0.08;
        y=i*0.1;

        if(x==a && y==b)
        {
            cout<<i;
            return;
        }
    }

    cout<<-1;
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}




Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = new int[N];
		for(int i=0;i<N;i++) array[i] = sc.nextInt();
		Arrays.sort(array);
		int count=1;
		for(int i=1;i<N;i++) {
			if(array[i]!=array[i-1]) count++;
		}
		System.out.println(count);
	}
}

Measured memory_bytes: 23252
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        n: usize,
        a: [i64; n],
    }
    let m = n as i64;
    let s = a.iter().fold(0, |s, a| s + *a);
    if s % (m * (m + 1) / 2) != 0 {
        println!("NO");
        return;
    }
    let c = s / (m * (m + 1) / 2);
    let mut b = vec![a[0] - a[n - 1] - c];
    for i in 1..n {
        b.push(a[i] - a[i - 1] - c);
    }
    if b.iter().all(|b| *b <= 0 && (-*b) % m == 0) {
        println!("YES");
    } else {
        println!("NO");
    }
}

fn main() {
    run();
}


Measured memory_bytes: 8444
//自称高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int main() {
    ll ans = 1000000000001;
    int tmp;

    //エラトステネスの篩でP_max以下の素数vector primeをつくる
	bool *pr;
    int P_max = 1000000; //10^6くらいまでが現実的か
    pr = (bool*)malloc(sizeof(bool) * P_max);
    REP(i, P_max) {
        pr[i] = i;
	}
    REP(i, P_max + 1) pr[i] = true;
    pr[0] = false;
    pr[1] = false;
	for(int i = 2; i * i <= P_max; i++){ 
        if(pr[i] == true){
			for(int j = 2 * i; j <= P_max; j+=i){
				pr[j] = false;
			}
		}
    }
	vector<ll> prime;
	for(int i = 2; i <= P_max; i++){
		if(pr[i]) prime.push_back((ll)i);
	}
	//
    ll n;
    ll sho = 1, jo = 1;
    cin >> n;
	vector<int64_t> hog = divisor(n);
	REP(i, hog.size()){
		sho = hog[i];
		jo = n / hog[i];
		ans = min (ans, jo + sho -2);
	}

    cout << ans << endl;
}

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

using ll = long long int;
vector<vector<ll>> v;
ll n;
ll DP[100000][3];

ll backtrack(ll pos, char choice) {

	if(pos == n) return 0LL;

	vector<ll>b ;

	for (ll i = 0; i < 3; i++) {

		char ch = (char)(i + 'a');

		if(choice != ch && DP[pos][i] != -1) { 
			b.push_back(DP[pos][i]);
		}
	}

	if(b.size() == 2) return max(b[0], b[1]);


	ll answer = 0;

	for (ll i = 0; i < 3; i++) {

		char ch = (char)(i + 'a');

		if(choice != ch) {
			DP[pos][i] = v[pos][ch - 'a'] + backtrack(pos+1, ch);
			answer = max(answer, DP[pos][i]);

		}
	}
	 return answer;
} 

int main() {
	
	cin>>n;

	for (ll i = 0; i < n; i++) {

		ll a, b, c;
		cin>>a>>b>>c;
		v.push_back({a, b, c});
	}	

	memset(DP, -1, sizeof(DP));
	cout<<backtrack(0, '.');

	return 0;
}

Measured memory_bytes: 18096
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){

    int a,b,c;

    cin >> a >> b >> c;

    if((a + b) >= c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

typedef unsigned long ul;
typedef long long ll;
typedef pair<ul, ul> P;
map<int, int> dp;
#define REP(i, n) for (int i = 0; i < n; i++)

bool in(int target, int max) { return 0 <= target && target < max - 1; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> a(5, 0);
  int H, W;
  cin >> H >> W;
  vector<vector<bool>> A(H, vector<bool>(W, true));
  char tmp;
  deque<pair<int, int>> que(1000001, make_pair(0, 0));
  deque<pair<int, int>> que_next(1000001, make_pair(0, 0));
  que.clear();
  que_next.clear();
  REP(i, H) {
    REP(j, W) {
      cin >> tmp;
      A[i][j] = (tmp == '#' ? false : true);
      if (!A[i][j]) que.emplace_back(make_pair(i, j));
    }
  }
  int cnt = 0;
  int boxes = H * W - que.size();
  while (true) {
    if (boxes == 0) {
      break;
    }
    que_next.clear();
    for (auto& tmp : que) {
      auto x = tmp.first;
      auto y = tmp.second;
      if (x != H - 1) {
        if (A[x + 1][y]) {
          que_next.emplace_back(x + 1, y);
        }
        A[x + 1][y] = false;
      }
      if (x != 0) {
        if (A[x - 1][y]) {
          que_next.emplace_back(x - 1, y);
        }
        A[x - 1][y] = false;
      }
      if (y != W - 1) {
        if (A[x][y + 1]) {
          que_next.emplace_back(x, y + 1);
        }
        A[x][y + 1] = false;
      }
      if (y != 0) {
        if (A[x][y - 1]) {
          que_next.emplace_back(x, y - 1);
        }
        A[x][y - 1] = false;
      }
    }
    que = que_next;
    ++cnt;
    boxes -= que.size();
  }

  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 16760
#include<iostream>
#include<string>
#include<algorithm>
#include<stdio.h>

using namespace std;

const int MAX=50;
int a[MAX],b[MAX],c[MAX],d[MAX];

int main(){
    int n,m;
    cin>>n>>m;
    for(int i=0; i<n; i++){
        cin>>a[i]>>b[i];
    }
    for(int i=0; i<m; i++){
        cin>>c[i]>>d[i];
    }

    for(int i=0; i<n;i++){
        int min_dist=abs(a[i]-c[0])+abs(b[i]-d[0]);
        int checkpoint=1;

        for(int j=1; j<m; j++){
            int cur_dist=abs(a[i]-c[j])+abs(b[i]-d[j]);
            if(min_dist>cur_dist){
                min_dist=cur_dist;
                checkpoint=j+1;
            }
        }
        cout<<checkpoint<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
//		package Dynamic;
import java.io.*;
import java.util.*;
class Main
{
    static public void main(String[] args) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//        int t=Integer.parseInt(br.readLine());
//        while(t-->0)
//        {
//        	int n=Integer.parseInt(br.readLine());
//        	int ar[]=new int[n];
        	StringTokenizer st=new StringTokenizer(br.readLine());
        	int a=Integer.parseInt(st.nextToken());
        	//int b=Integer.parseInt(st.nextToken());
        	//int c=Integer.parseInt(st.nextToken());
//        	for(int x=0;x<n;x++)
//        	{
//        		ar[x]=Integer.parseInt(st.nextToken());
//        	}
        	System.out.println(3*a*a);
        //}
    }
}

Measured memory_bytes: 24916
package main

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

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	v, _ := strconv.Atoi(sc.Text())
	return v
}
func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	N := nextInt(sc)
	m := make(map[string]int)
	maxs := 0
	for i := 0; i < N; i++ {
		s := nextString(sc)
		m[s]++
		maxs = max(maxs, m[s])
	}
	ss := make([]string, 0)
	for k, v := range m {
		if v == maxs {
			ss = append(ss, k)
		}
	}
	sort.Strings(ss)
	// fmt.Println("---")
	for i := 0; i < len(ss); i++ {
		fmt.Println(ss[i])
	}
}


Measured memory_bytes: 31248
# include <iostream>

using namespace std;

int main()
{
    int n, x;
    cin >> n >> x;
    int l[n + 1] = {};
    int d[n + 1] = {};
    
    for (int i = 1; i <= n; i++)
    {
        cin >> l[i];    
    }    
    
    d[1] = 0;
    int count = 0;
    int i = 1;
    
    while (d[i] <= x)
    {   
        d[i + 1] = d[i] + l[i];
        count++;   
        i++; 

    }    
        
    printf("%d\n", count);
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int S;

	scanf("%d", &S);
	
	if (0 <= S || S < 86400)
	{
		printf("%d:%d:%d\n", S / 3600, (S % 3600) / 60, ((S%3600)%60)%60);
	}
	return 0;
}


Measured memory_bytes: 2124
n,k = list(map(int,input().split()))
if n%k==0:
    print(0)
else:
    l = [n]
    p = n//k
    c = n - (k*p)
    half = k//2
    while c > half:
        c = abs(c-k)
    l.append(c)
    print(min(l))


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

int main(void)
{
    int k, x;
    cin >> k >> x;

    for (int i = -k + 1; i < k; i++) {
        cout << x + i << endl;
    }
}



Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 20)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する


int main() {
    int N;
    cin >> N;
    vector<int> C,S,F;
    rep(i,1,N){
        int c,s,f;
        cin >> c >> s >> f;
        C.push_back(c);
        S.push_back(s);
        F.push_back(f);
    }

    rep(i,0,N){
        if(i == N-1){
            cout << 0 << endl;
            break;
        }
        int t = S[i];
        t += C[i];
        rep(j,i+1,N-1){
            if(t < S[j]){
                t = S[j];
            }else{
                if(t % F[j]) t = F[j] * (t/F[j]+1);
            }
            t += C[j];
        }
        cout << t << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define Roc ios_base::sync_with_stdio(false), cin.tie(NULL)
#define ll long long
#define NAX 3009
using namespace std;
ll n, dp[ NAX ][NAX];
int main()
{
    Roc;
    cin >> n;
    for(int i = 1 ; i <= n ; ++i)
        cin >> dp[ i ] [ i ];
    for(int i = n - 1; i >= 1; --i)
    {

        for(int j = i  + 1; j <= n; ++j)
            {
                dp[i][j] = max(dp[j][j] - dp[i][j -1], dp[i][i] - dp[i+1][j]);
                //cout << dp[i][j] << ' ';
            }
        //cout << '\n';

    }
    cout << dp[1][n];
    return 0;
}


Measured memory_bytes: 70016
#include<bits/stdc++.h>
using namespace std;
const int N=5e5+1;
int n,q;
typedef long long ll;
#define int ll
int bit[N];
void update(int x,int v){
    x++;
    while(x<=n){
        bit[x]+=v;
        x+=x&-x;
    }
}
int query(int x){
    x++;
    int res=0;
    while(x>0){
        res+=bit[x];
        x-=x&-x;
    }
    return res;
}
signed main(){
    ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
    cin>>n>>q;
    for(int x=0;x<n;x++){
        int v;cin>>v;
        update(x,v);
    }
    while(q--){
        int mode;
        cin>>mode;
        if(mode==0){
            int x,v;cin>>x>>v;
            update(x,v);
        }
        else{
            int l,r;cin>>l>>r;
            cout<<query(r-1)-query(l-1)<<"\n";
        }
    }
}

Measured memory_bytes: 8252
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int> 


int main(){
  ll N, M; cin >> N >> M;
  if (2*N<M){
    cout << N+(M-2*N)/4 << endl;
  }
  else cout << M/2 << endl;

  return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
l=list(input())
list=[0]
c=0
for i in range(len(l)-1):
  if l[i]=="A" and l[i+1]=="C":
    c+=1
    list.append(c)
  else:
    list.append(c)
for i in range(m):
  n,m=map(int,input().split())
  print(list[m-1]-list[n-1])
    
   

Measured memory_bytes: 6872
#include<stdio.h>
#include<string.h>
main()
{   int i;
	char a[100];
	char b[100];
	char c[100];
char x,y,z;
	scanf("%s %s %s",&a,&b,&c);
	x=a[0]-32;
	y=b[0]-32;
	z=c[0]-32;
printf("%c%c%c\n",x,y,z);
	
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <map>
#include <queue>
#include <vector>

using namespace std;
const int maxn = 1e5+100;
const int INF = 0x3f3f3f3f;
#define pr(x)      // cout << #x << " = " << x << " ";
#define prln(x)    // cout << #x << " = " << x <<endl;
#define ll long long
int head[maxn], nxt[maxn], to[maxn], dfsn, cnt, id[maxn], r[maxn], _n, sum[maxn<<2], dep[maxn];
void addedge(int u, int v) {
	nxt[cnt] = head[u];
	head[u] = cnt;
	to[cnt++] = v;
}
void init(int n) {
	cnt = dfsn = 0;
	_n = 1;
	while(_n < n) _n = _n*2;
	int _nn = _n*2;
	for(int i = 0; i <= _nn; ++i) sum[i] = -1;
	for(int i = 0; i <= n;++i) {
		head[i] =-1;
	}
}

void dfstree(int fa,int u) {
	id[u] = ++dfsn;
	dep[u] = dep[fa]+1;
	for(int i = head[u]; ~i; i = nxt[i]){
		dfstree(u,to[i]);
	}
	r[u] = dfsn;
}
inline void getans(int& ans, const int& v2){
	if(ans == -1 || dep[ans] < dep[v2]) ans = v2;
}
void pushdown(int rt) {
	if(sum[rt] != -1) {
		getans(sum[rt<<1], sum[rt]);
		getans(sum[rt<<1|1],sum[rt]);
	}
}
void update(int rt, int l, int r, int ql, int qr, int v) {
	if(ql <= l && r <= qr) {
		getans(sum[rt], v);
		return;
	}
	pushdown(rt);
	int m = l + r >> 1;
	if(m >= ql) update(rt<<1, l, m, ql, qr, v);
	if(m < qr) update(rt<<1|1, m+1, r, ql, qr, v);
}
int query(int rt) {
	rt += _n-1;
	int ans = 0;
	while(rt>=1) {
		getans(ans,sum[rt]);
		rt = rt>>1;
	}
	return ans;
}
int main(){
#ifdef LOCAL
    freopen("C:\\Users\\Administrator\\Desktop\\in.txt","r",stdin);
  //freopen("C:\\Users\\Administrator\\Desktop\\out.txt","w",stdout);
 #endif
    int n, m, x;
    char op[10];
    while(cin >> n >> m && (n||m)) {
    	ll ans = 0;
    	init(n);
    	for(int i = 2; i <= n; ++i) {
    		scanf("%d", &x);
    		addedge(x,i);
    	}
    	dep[0] = 0;
    	dfstree(0,1);
    	update(1, 1, _n, id[1], r[1], 1);
    	for(int i = 0; i < m; ++i) {
    		scanf("%s%d", op, &x);
    		if(op[0] == 'M')	update(1, 1, _n, id[x], r[x], x);
    		else	ans += query(id[x]);
    	}
    	printf("%lld\n", ans);
    }
    return 0;
}

Measured memory_bytes: 7724
import           Data.List
import           Data.Maybe

main = do
   s <- getLine
   putStrLn $ if g (Just s) then "YES" else "NO"

f s = fmap (($ s) . stripPrefix) ["dream", "dreamer", "erase", "eraser"]

g :: Maybe String -> Bool
g (Just s) = case f s of
        a | Just "" `elem` a  -> True
          | any isJust a -> any g (filter isJust a)
          | otherwise    -> False

Measured memory_bytes: 7932
s = input()
ans = 0
if s[0] == "R":
    cnt = 1
else:
    cnt = 0
ans = cnt
for i in range(1, 3):
    if s[i] == "R":
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
print(ans)

Measured memory_bytes: 61632
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
int a[105],b[maxn];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n-1;i++){
		cin>>b[i];
	}
	a[1]=b[1];a[n]=b[n-1];
	for(int i=1;i<=n-2;i++){
		a[i+1]=min(b[i],b[i+1]);
	}
	long long ans=0;
	for(int i=1;i<=n;i++){
		ans+=a[i];
	}
	cout<<ans;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

#[allow(unused_macros)]
macro_rules! get_chars {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().chars().collect::<Vec<_>>()
        }
    };
    ($n:expr) => {
        {
            (0..$n)
                .map(|_| get_chars!())
                .collect::<Vec<_>>()
        }
    };
}

fn main() {
    let s = get!(String);
    println!("{}", if s == "ABC" { "ARC" } else { "ABC" }); 
}


Measured memory_bytes: 2168
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

int main() {
    string S;
    cin >> S;
    int cnt = 0;
    int num = 1;
    int N = (int)S.size();
    for (int i = 1; i < N; i++) {
        if (num == 1 && S[i - 1] == S[i]) {
            cnt++;
            num = 2;
            i += 1;
        } else {
            num = 1;
        }
    }
    cout << N - cnt << endl;
}


Measured memory_bytes: 640
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    ll n,ans=0; cin>>n;
    vector<ll> a(n,0);
    rep(i,n) cin>>a[i];
    rep(i,n-1){
        ans+=a[i]/2;
        a[i]%=2;
        if(a[i]*a[i+1]>0){
            ans++;
            a[i]--; a[i+1]--;
        }
    }
    ans+=a.back()/2;
    cout<<ans<<endl;
}

Measured memory_bytes: 1152
#include <iostream>

int main(int argc, const char * argv[]) {
  // insert code here...
  int W, H;
  int w, h;
  int x, y, r;
  std::cin >> W >> H >> x >> y >> r;
  w = W - r; h = H - r;
  if ((r <= x && x <= w) && (r <= y && y <= h) ) {
    std::cout << "Yes\n";
  } else {
    std::cout << "No\n";
  }
  return 0;
}

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

using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

i64 sigma(int n) { return n * (1 + n) / 2; }

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

  i64 x;
  cin >> x;

  i64 res = 1;
  while (sigma(res) < x) ++res;

  cout << res << "\n";

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define piii pair<int,pii>
#define pll pair<ll,ll>
#define plii pair<ll,pii>
#define vi vector<int>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define lw(vc,num) lower_bound(vc.begin(), vc.end(), num) - vc.begin();
#define hg(vc,num) upper_bound(vc.begin(), vc.end(), num) - vc.begin();
#define bn(v,x) binary_search (v.begin(), v.end(), x)
#define mx 100001
#define eps 0.00000000001
#define mod 1000000007
#define pi acos(-1)
#define inf 100000000
#define loop(i,b,n) for(int i=b;i<n;++i)
#define rev_loop(i,b,n) for(int i=b;i>=n;--i)
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
bool isprime(int n)
{
    if(n == 1) return false;
    if(n == 2 || n == 3) return true;
    if(n%2 == 0 || n%3 == 0) return false;
    for(int i=5; i*i<=n; i+=6){
        if((n%i == 0)||(n%(i+2) == 0)) return false;
    }
    return true;
}
long long binpow(long long a, long long b) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}
int main()
{
    fio;
    int t;
    cin>>t;
    if(t>=30)
        cout<<"Yes\n";
    else
        cout<<"No\n";
    return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<vector<int>>a( n + 1, vector<int>(4) ), tab( n + 1, vector<int>(4, -1) );

    for ( int i = 1; i <= n; i++ )
        for ( int j = 1; j <= 3; j++ )
        cin >> a[i][j];
    
    tab[n][1] = a[n][1];
    tab[n][2] = a[n][2];
    tab[n][3] = a[n][3];
        
    for ( int i = n - 1; i >= 1; i-- ){
        tab[i][1] = max( tab[i + 1][2], tab[i + 1][3] ) + a[i][1];
        tab[i][2] = max( tab[i + 1][1], tab[i + 1][3] ) + a[i][2];
        tab[i][3] = max( tab[i + 1][1], tab[i + 1][2] ) + a[i][3];
    }
    
    cout << max( tab[1][1], max( tab[1][2], tab[1][3] ) ) << endl;
    // for ( int i = 1; i <= n; i++ ){
    //     for ( int j = 1; j <= 3; j++ ){
    //         cout << tab[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    return 0;
}


Measured memory_bytes: 11136
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <climits>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;

    vector<int> e(N, 0);
    for (int i = 0; i < N; i++) {
        if (S[i] == 'E') {
            if (i > 0) {
                e[i] = e[i-1] + 1;
            } else {
                e[i] = 1;
            }
        } else {
            if (i > 0) {
                e[i] = e[i-1];
            }
        }
    }

    int minchg = INT_MAX;
    for (int i = 0; i < N; i++) {
        int left = 0;
        if (i > 0) {
            left = i - e[i - 1];
        }
        int right = e[N - 1] - e[i];
        minchg = min(left + right, minchg);
    }
    cout << minchg << endl;
    return 0;
}


Measured memory_bytes: 1796
#include <stdio.h>
#include <stdlib.h>
int main(void) {
	int i,j,n,ans=0,prime[1000000];
	prime[0]=0;prime[1]=0;
	for(i=2;i<1000000;i++){prime[i]=1;}
	for(i=2;i<1000000;i++){
		if(prime[i]==1){
			ans++;
			if(i<1000)for(j=i*i;j<1000000;j+=i)prime[j]=0;
		}
		prime[i]=ans;
	}
	while(scanf("%d",&n)!=EOF){printf("%d\n",prime[n]);}
	return 0;
}

Measured memory_bytes: 4504
#include <bits/stdc++.h>
using namespace std;
typedef  long long int ll;
#define pb push_back
typedef long double ld;
#define fi first
#define se second
#define mp make_pair
ll inf=1e18;
ll p=1e9+7;
ll phi(ll n) {
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if(n % i == 0) {
            while(n % i == 0)
                n /= i;
            result -= result / i;
        }
    }
    if(n > 1)
        result -= result / n;
    return result;
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
   while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll i,j,h,x,y,n,m,k,t1,t2,t3;
    ll a,b,c;
    cin>>a>>b>>c>>k;
    ll ans=0;
    if(a+b>=k)
    cout<<std::min(k,a);
    else
    {
        ll temp=std::min(k,a);
        k-=(a+b);
        cout<<temp-k;
    }
}

Measured memory_bytes: 3652