akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

#define rep(i, o) for (ll i = 0; i < (o);i++)
#define rep_s(i, o) for (int i = 1; i <= (o);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<(int)(b);i++)
#define NUM 1e5

typedef long long ll;
typedef unsigned long long ull;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll c, ll d) { return c / gcd(c, d) * d; }


template<class T>
bool chmax(T &a, const T &b) { if (a < b) { return b; } return a; }

template<class T>
bool chmin(T &a, const T &b) { if (a > b) { a = b; return a; } return a; }

int main() {
    ll n; cin >> n;
    map<string, ll> judges;
    rep(i, n) {
        string s; cin >> s;
        judges[s] += 1;
    }

    cout << "AC x " << judges["AC"] << endl;
    cout << "WA x " << judges["WA"] << endl;
    cout << "TLE x " << judges["TLE"] << endl;
    cout << "RE x " << judges["RE"] << endl;
    return 0;
}

Measured memory_bytes: 3564
// edpc_d
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    ll N, W;
    cin >> N >> W;

    vector<ll> w(N), v(N);
    REP(i, N) cin >> w[i] >> v[i];

    vector<ll> dp(W+1);
    REP(i, N){
        REP_REV(j, W+1){
            if (j - w[i] < 0) break;
            dp[j] = max(dp[j], dp[j - w[i]] + v[i]);
        }
    }

    print(dp[W]);

    return 0;
}


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

int main()
{
    int A, B, C;
    cin >> A >> B >> C;

    if (A == 5 && B == 5 && C == 7)
    {
        cout << "YES" << endl;
    }
    else if (A == 5 && B == 7 && C == 5)
    {
        cout << "YES" << endl;
    }
    else if (A == 7 && B == 5 && C == 5)
    {
        cout << "YES" << endl;
    } else 
    {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 3552
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

using namespace std;

long long  n, k;
long long ans = 1;
long long  l_neg = -1,l_pos = -1, r_neg = -1, r_pos = -1;
//l_neg表示前N-K项最大的负数，l_pos表示前N-K项最大的正数，r_neg表示后K项最小负数,r-pos表示后K项最小正数
const long long int M = 1000000007;

bool cmp(long long int a,long long  int b)
{
    return abs(a) < abs(b);
}

long long int calc(vector<long long int> a)
{
    long long temp = 1;
    for(long long int i = n - k; i < n; i++)
        temp = (temp * a[i]) % M;
    return (temp+M)%M;
}

bool v_cmp(vector<long long int> a, vector<long long int> b)
{
    long long  sum1 = 0, sum2 = 0;
    for(long long int i = n - k; i < n; i++)
    {
        sum1 += abs(a[i]);
        sum2 += abs(b[i]);
    }
    return sum1 >= sum2;
}

int main()
{
    cin >> n >> k;
    vector<long long int> a(n, 0);
    for(long long int i = 0; i < n; i++)
    {
        cin >> a[i];

    }
    sort(a.begin(), a.end(), cmp);
    for(long long int i = n - k; i < n; i++)
    {
        ans = (ans * a[i]) % M;
        if(r_pos == -1 && a[i] > 0)
            r_pos = i;
        if(r_neg == -1 && a[i] < 0)
            r_neg = i;


    }
    for(long long int i = n - k - 1; i >= 0; i--)
    {
        if(l_pos == -1 && a[i] > 0)
            l_pos = i;
        if(l_neg == -1 && a[i] < 0)
            l_neg = i;
    }

    if(ans < 0 && n != k)
    {
        if(r_pos == -1)
        {
            if(l_pos == -1)
            {
                ans = 1;
                for(long long int i = 0; i < k; i++)
                    ans = (ans * a[i]) % M;
            }
            else
            {
                swap(a[l_pos], a[r_neg]);
                ans = calc(a);
            }
        }
        else
        {
            if(l_neg == -1)
            {
                swap(a[l_pos], a[r_neg]);
                ans = calc(a);
            }
            else if(l_pos == -1)
            {
                swap(a[l_neg], a[r_pos]);
                ans = calc(a);
            }
            else
            {
                vector<long long int> c1 = a;
                vector<long long int> c2 = a;
                swap(c1[l_neg], c1[r_pos]);
                swap(c2[l_pos], c2[r_neg]);
                ans=(abs(a[l_neg]*a[r_neg])>abs(a[l_pos]*a[r_pos]))?calc(c1):calc(c2);;
            }
        }
    }
    cout << (ans+M)%M << endl;
    return 0;
}


Measured memory_bytes: 9540
import qualified Data.ByteString.Char8 as B
import Control.Monad
import Data.List
import qualified Data.Vector as V

import Control.Monad.Trans.State.Strict
import Data.Char (isSpace)
import Data.Maybe (fromJust)

type Parser a = StateT B.ByteString Maybe a

parseInt :: Parser Int
parseInt = StateT (B.readInt . B.dropWhile isSpace)

parseInt2 :: Parser (Int,Int)
parseInt2 = liftM2 (,) ((+(-1))<$>parseInt) ((+(-1))<$>parseInt)

parse :: Parser (Int, V.Vector (Int,Int))
parse = do
    n <- parseInt
    m <- parseInt
    fmap ((,) n) (V.replicateM m parseInt2)

t2 [a,b]=(a-1,b-1)
main=do
    (n,xys) <- fromJust.evalStateT parse <$> B.getContents
    print $ g n xys

g n xys = V.maximum v where
    ve = V.accumulate (flip (:)) (V.replicate n []) xys
    v = V.generate n m
    m i = (+1) $ maximum $ ((-1):) $ map (v V.!) (ve V.! i) 

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

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

    int L;
    cin >> L;

    double l = (double)L / 3;
    cout << fixed << setprecision(10) << l * l * l << endl;
}

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

int main(){
  int N,D;
  cin >> N >> D;
  vector<vector<int>> points(N);
  rep(i,N){
    points[i].resize(D);
    rep(d,D){
      cin >> points[i][d];
    }
  }

  int ans = 0;
  rep(i,N)rep(j,i){
    int ss = 0;
    rep(d,D){
      int s = points[i][d] - points[j][d];
      ss += s*s;
    }
    int root = sqrt(ss) + 0.1;
    if(ss == root*root) ans += 1;
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n, i, ans=0, cnt;
    cin >> n;
    long long a[200010];
    vector<long long> sum;
    for(i=0;i<n;i++){
        cin >> a[i];
    }
    sum.push_back(0);
    for(i=1;i<=n;i++){
        sum.push_back(sum[i-1]+a[i-1]);
    }
    sort(sum.begin(), sum.end());
    cnt=1;
    for(i=1;i<=n;i++){
        if(sum[i]==sum[i-1]) cnt++;
        else{
            if(cnt>1){
                if(cnt%2==0) ans=ans+cnt/2*(cnt-1);
                else ans=ans+(cnt-1)/2*cnt;
            }
            cnt=1;
        }
    }
    if(cnt>1){
            if(cnt%2==0) ans=ans+cnt/2*(cnt-1);
            else ans=ans+(cnt-1)/2*cnt;
            }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    string a,b,c;
    cin>>n>>a>>b>>c;
    int ans=0;
    for(int i=0;i<n;i++){
        set<char> s;
        s.insert(a[i]);
        s.insert(b[i]);
        s.insert(c[i]);
        int l=s.size();
        if(l==3)
            ans+=2;
        else if(l==2)
            ans+=1;    
    }
    cout<<ans;



}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <numeric>
#include <climits>
#include <math.h>
#include <memory.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for(int i = (k); i < (int)(n); i++)
using namespace std;
using ll = long long;
int N, M;
int cnt = 0;
ll ans = 0LL;
int i_index;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};
string board[64];
int main(){
    string S;
    cin >> S;
    int l = S.length();
    for(int i = 2; i < l; i++){
        if(S[i] == 'C' && i < l - 1)
            cnt++;
        else if(S[i] - 'a' < 0){
            cout << "WA" << endl;
            return 0; 
        }
    }
    if(cnt != 1 || S[0] != 'A' || S[1] - 'a' <0){
        cout << "WA" << endl;
        return 0;   
    }
    cout << "AC" << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

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

#define GET_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define REP2(i,n) for(int i=0;i<(int)(n);i++)
#define REP3(i,m,n) for(int i=m;i<(int)(n);i++)
#define REP4(i,m,n,s) for(int i=m;(s>0 and i<(int)(n)) or (s<0 and i>(int)(n));i+=s)
#define REP(...) GET_MACRO(__VA_ARGS__, REP4, REP3, REP2)(__VA_ARGS__)
#define REPIT(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define PIS(x) printf("%d ",x)
#define PN() putchar('\n')
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define MT make_tuple

using PII = pair<int, int>;
using TI3 = tuple<int, int, int>;
using LL = long long;
using ULL =  unsigned long long;
using MAT = array<array<LL, 2>, 2>;

template<class T> void _read( T &x ) { cin>>x; }
void _read(int &x) { scanf("%d", &x); }
void _read(LL &x) { scanf("%lld", &x); }
void _read(double &x) { scanf("%lf", &x); }
void _read(char &x) { scanf(" %c", &x); }
void _read(char *x) { scanf("%s", x); }
void read() {}
template<class T, class... U>
void read( T& head, U&... tail ) {
    _read(head);
    read(tail...);
}

template<class T> void _print( const T &x ) { cout << x; }
void _print( const int &x ) { printf("%d", x); }
void _print( const LL &x ) { printf("%lld", x); }
void _print( const double &x ) { printf("%.16lf",x); }
void _print( const char &x ) { putchar(x); }
void _print( const char *x ) { printf("%s",x); }
template<class T> void _print( const vector<T> &x ) { for (auto i = x.begin(); i != x.end(); _print(*i++)) if (i != x.cbegin()) putchar(' '); }
void print() {}
template<class T, class... U> void print( const T& head, const U&... tail ) {
    _print(head);
    putchar(sizeof...(tail) ? ' ' : '\n');
    print(tail...);
}

const int MOD = 1000000007;
#define MAX_N 1005

char s[MAX_N];

int main()
{
    read(s);
    int n = strlen(s);
    int carry = 0;
    int ans = 0;
    REP(i, n-1, -1, -1) {
        int d = s[i] - '0';
        d += carry;
        if(d < 0) {
            d += 10;
            carry = -1;
        } else {
            carry = 0;
        }
        if(d < 9 and i != 0) {
            d = 9;
            carry -= 1;
        }
        ans += d;
    }
    print(ans);
    return 0;
}


Measured memory_bytes: 764
// C++ 14
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
//  cout.precision(15); cout << fixed;

int main() {
  int n, d; cin >> d >> n;
  int s = 1;
  while (d--) s *= 100;
  if (n==100) n = 101;
  cout << s * n << endl;
  return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
int main(){
    ios::sync_with_stdio(false);
    ll n,k;
    cin >> n >> k;
    cout << min(n%k, k-n%k) << endl;
}

Measured memory_bytes: 384
N, W = map(int, input().split())

w, v = map(int, input().split())

values = [[] for _ in range(4)]

values[0].append(v)

for _ in range(N-1):
    x, y = map(int, input().split())
    values[x-w].append(y)

n = [0]*4
for i in range(4):
    n[i] = len(values[i])
    values[i].sort(reverse=1)

ans = 0
ans0 = 0
ans1 = 0
ans2 = 0
for n0 in range(n[0]+1):
    if n0 > 0:
        ans0 += values[0][n0-1]
    if n0 * w > W:
        break
    for n1 in range(n[1]+1):
        if n1 > 0:
            ans1 += values[1][n1-1]
        else:
            ans1 = 0
        if n0 * w + n1 * (w+1) > W:
            break
        for n2 in range(n[2]+1):
            ww = n0 * w + n1 * (w+1) + n2 * (w+2)
            if n2 > 0:
                ans2 += values[2][n2-1]
            else:
                ans2 = 0
            if ww > W:
                break
            n3 = (W - ww) // (w+3)
            ans = max(ans, ans0+ans1+ans2+sum(values[3][:n3]))

print(ans)

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

int main() {
  string A, B, C;
  cin >> A >> B >> C;
  char a, b, c;
  a=A.at(0);
  b=B.at(0);
  c=C.at(0);
  cout << a << b << c << endl;
}

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

int main(void){
    
    string s;
    bool flag = true;
    cin >> s;

    int len = s.size();
    int count_c = 0;
    int i_c = -1;
    
    if(s[0] != 'A') flag = false;
    
    for(int i=2;i<=len-2;i++){
        if(s[i] == 'C') {
            count_c++;
            i_c = i;
        }
    }
    
    if(count_c != 1) flag = false;
    
    for(int i=1;i<len;i++){
        if((int)s[i] >= 97 && (int)s[i] <= 121){
            
        }
        else{
            if(i != i_c) flag = false;
        }
    }
    
    if(flag){
        cout << "AC" << endl;
    }
    else{
        cout << "WA" << endl;
    }
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define debug(...) fprintf (stderr, __VA_ARGS__)
using namespace std;
void read (int&a) {
	a = 0; char k = getchar(); int f = 1;
	for(;!isdigit(k); k = getchar()) if (k == '-') f = -1;
	for(; isdigit(k); k = getchar()) a = a * 10 + k - '0';
	a *= f;
}

const int N = 3000 + 5, mod = 1000000007, inv2 = 500000004;
void upd (int&a, int b) { a = (a + b) % mod; }
int dp[N][N], n, q, a[N], tmp, s = 1;

int main ()
{
	read (n), read (q);
	for (int i = 1; i <= n; ++i) read (a[i]);
	for (int i = 1; i <= n; ++i) for (int j = 1; j <= n; ++j) dp[i][j] = (a[i] > a[j]);
	while (q--) {
		s = 1LL * s * 2 % mod;
		int x, y; read (x), read (y);
		for (int i = 1; i <= n; ++i) {
			if (i != y && i != x) {
				tmp = (dp[x][i] + dp[y][i]) % mod;
				dp[x][i] = dp[y][i] = tmp;
				dp[x][i] = 1LL * dp[x][i] * inv2 % mod, dp[y][i] = 1LL * dp[y][i] * inv2 % mod;
				tmp = (dp[i][x] + dp[i][y]) % mod;
				dp[i][x] = dp[i][y] = tmp;
				dp[i][x] = 1LL * dp[i][x] * inv2 % mod, dp[i][y] = 1LL * dp[i][y] * inv2 % mod;
			}
		}
		tmp = (dp[x][y] + dp[y][x]) % mod;
		dp[x][y] = dp[y][x] = tmp;
		dp[x][y] = 1LL * dp[x][y] * inv2 % mod, dp[y][x] = 1LL * dp[y][x] * inv2 % mod;
	}
	int ans = 0;
	for (int i = 1; i <= n; ++i) for (int j = 1; j <= n; ++j) if (i < j) upd (ans, 1LL * dp[i][j] * s % mod);
	printf ("%d\n", ans);
	return 0;
}





















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

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; }
constexpr int mod = 1e9 + 7;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
  friend ostream &operator<<(ostream &os, const mint &a) { return (os << a.x); }
};
struct combination {
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
};

int main() {
  int n;
  cin >> n;
  for (int i = 0; i <= n; ++i) {
    int j = static_cast<int>(static_cast<double>(i) * 1.08);
    if (j == n) {
      cout << i << endl;
      return 0;
    }
  }
  cout << ":(" << endl;
}


Measured memory_bytes: 256
s = input()
flag = 0
if len(s) % 2 == 1:
  print('No')
else:
  for i in range(len(s)):
    if i % 2 == 0:
      if s[i] == 'h':
        flag += 1
    else:
      if s[i] == 'i':
        flag+= 1
  if flag == len(s):
    print('Yes')
  else:
    print('No')

Measured memory_bytes: 3060
// --------------------<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 <bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define f first
#define s second
#define sz(x) ll(x.size())
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;++i)
#define fore(i,l,r) for(int i=int(l);i<=int(r);++i)
#define rep(i,begin,end) for(__typeof(end) i=(begin);i!=(end);i++)
#define fill(a,value) memset(a,value,sizeof(a));
#define gcd(a,b) __gcd((a),(b))
#define watch1(x) cout << (x) << endl
#define watch2(x,y) cout << (x) << " " << (y) << endl
#define watch3(x,y,z) cout << (x) << " " << (y) << " " << (z) << endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
 
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
 
const ll mod = 1e9 + 7;
const int inf = 1e9 + 5;
const int N = 1e5 + 5;

signed main(){
    fastio;
    vi v(3);
    cin>>v[0]>>v[1]>>v[2];
    sort(all(v));
    if((v[0]==v[1] && v[1]<v[2]) || (v[0]<v[1] && v[1]==v[2]))
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,i;
    map <int, int> mp;
    map <int, int>::iterator it;
    cin>>n;
    for(i = 0; i < n; i++)
    {
        int x;
        cin>>x;
        mp[x]++;
    }
    int sum = 0;
    for(it=mp.begin();it!=mp.end();it++)
    {
        if(it->second < it->first)
            sum += it->second;
        else
            sum += it->second - it->first;
    }

    cout<<sum<<endl;
}


Measured memory_bytes: 4736
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

const int INF = 1001001001;

int main(){
    int n;
    cin >> n;
    vector<int> x(n), l(n);
    rep(i, n) cin >> x[i] >> l[i];

    vector<P> p(n);
    rep(i, n) p[i] = P(x[i] + l[i], x[i] - l[i]);

    sort(p.begin(), p.end());

    int ans = 0;
    int now = -INF;
    rep(i, n) {
        int begin = p[i].second;
        int end = p[i].first;
        if (begin >= now) {
            ans++;
            now = end;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string score;
string ans[300];
string win;
int a,b;
int cou;

void saiki(int ac,int bc ,int d) {
  
  if(d == a+b && (score[a+b-1] == win[0] || win[0] == 'd') ) {
    cou++;
    for(int i=0;i<a+b;i++) ans[cou-1] += score[i];
   
  }
    
  if(a+b > d && !(ac == 3 && bc == 5) && !(ac == 5 && bc == 3)) {
    if(ac < a) {
      score[d] = 'A';
      saiki(ac+1,bc,d+1);
    }
    if(bc < b) {
      score[d] = 'B';
      saiki(ac,bc+1,d+1);
    }
  }
    
}

int main(){

  int flg = 0;
  cin >> a >> b;
  if((a == 4 && b == 5)) flg = 1,a = b = 4;
  if (a == 5 && b == 4)  a = b = flg =  4;

  win = "d";
  score.resize(a+b);
  if(a > b && (a >= 5 && b <= 3) || a == 6) win = "A";
  else if(b > a && (b >= 5 && a <=3) || b == 6) win = "B";
  //  cout << win << endl;

  cou = 0;
  saiki(0,0,0);

  if(flg == 1)
    for(int i=0;i<cou;i++) ans[i] += 'B';
  if(flg == 4) 
    for(int i=0;i<cou;i++) ans[i] += 'A'; 
  
  sort(ans,ans+cou);


  for(int i=0;i<cou;i++) {
    cout << ans[i] << endl;
    if(ans[i] == ans[i+1]){
      cout <<"ok"<<endl;
      break;
    }
  }

  // cout << cou << endl;


  return 0;

}

Measured memory_bytes: 1228
/*input
a
*/

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

#define rep(i,j,n) for(i=j;i<n;i++)
#define repi(i,j,n) for(i=j;i>n;i--)
#define inf 100001
#define M 1000000007
#define ll long long
#define vll vector<long long>
#define vi vector<int>
#define pll pair<long long,long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define vpll vector<pair<long long,long long> >
#define pb push_back
#define pf pop_front
#define mp make_pair
#define F first
#define S second


ll power(ll a,ll m,ll mod){
	ll ans=1;
	while(m){
		if(m%2){
			ans*=a;
			ans%=(mod);
		}
		a=(a*a)%(mod);
		m>>=1;
	}
	return ans;
}


void init(long long* a,long long n,long long val){
	for(long long i=0;i<n;i++)
		a[i]=val;
}



int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);	
	ll t=1,i,j;
	char c;
	cin>>c;
	c++;
	cout<<c<<endl;
	return 0;
}




Measured memory_bytes: 256
import sys
if sys.argv[-1] == 'ONLINE_JUDGE':
    import os, zlib, base64
    open('solve.pyx', 'wb').write(zlib.decompress(base64.b85decode("c${rg!EVAZ482$CKlrlIjDU)?NmB*;5yqiy(l%O1AWaJU`#Gf0Fz_kydwza)(ipvm`qy?^Ef1wBrQ{N7u|H^I;b2PD@-%5YNs6jo_Ld2K!&`3at~3;hLfM8w&+Sk-f3QqDn<h2m4M?rp?MIHW+5sDrzHqzBudxHHOOsI`3-uH(VmXD0NXB|>h(1(CK<QS<B256}22~Vl*gziAr%p%?tC8fRLU6R7ktr=2MAq>BSwLlY`7<G2t%f&r0(0ankP|?|tuqSh(bu2_gOah#yAbqZ=6r85xDl}4fQl@!t=PeQ1Lw$&zYBPUg@|?uz1s)*C&LHA|Ir0}K_2z$y|8Z>_gYN7qQUxT;mR+;FP*}1I^vZ0RF1-sCMRLLJ5!A|s4CR>nKDI+upV6FiUtYtoO&dYV|(p4rQBm`cue7w+G6~n+3ZEKZ#AQr6%GWS(H|U%_+0ipSaiYSfZ!iL*V3{")))
    os.system('cythonize -i -3 -b solve.pyx')
import solve

Measured memory_bytes: 16688
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline

def main():
    def get_group(k):
        g = pd[k]
        if g < 0:
            return k
        gg = get_group(g)
        pd[k] = gg
        return gg
    def merge(j, k):
        g1 = get_group(j)
        g2 = get_group(k)
        if g1 != g2:
            d1 = -pd[g1]
            d2 = -pd[g2]
            if d2 > d1:
                g1, g2 = g2, g1
            pd[g2] = g1
            if d1 == d2:
                pd[g1] -= 1

    n,m=map(int, input().split())
    pd = [-1] * (n + 1)  # 親(parent)と深さ(depth)。0以上は親。負の場合、そのノードが根で絶対値が深さ。
    p=list(map(int, input().split()))
    for _ in range(m):
        x,y=map(int, input().split())
        merge(x-1,y-1)
    ans=0
    for i in range(n-1,-1,-1):
        if get_group(i)==get_group(p[i]-1):
            ans+=1
    print(ans)

main()

Measured memory_bytes: 14644
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>


using namespace std;


int main() {
	int n;
	cin >> n;
	vector <tuple<int, int>> ranges;
	for (int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b;
		ranges.emplace_back(b, a);
	}
	stable_sort(ranges.begin(), ranges.end());
	vector<bool> looked(31, false);
	for (int i = 0; i < n; i++) {
		int l, r;
		tie(r, l) = ranges[i];
		for (int j = l - 1; j <= r - 1; j++) {
			if (!looked[j]) {
				looked[j] = true;
				break;
			}
		}
	}

	int cnt = 0;
	for (int i = 0; i < 31; i++)if (looked[i])cnt++;

	cout << cnt * 100 + (31 - cnt) * 50 << endl;
}


Measured memory_bytes: 3132
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl;
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

int main() {
	string s;
	while (cin >> s) {
		string ans;
		rep(i, sz(s)) {
			string plas;
			if (s[i] == '@') {
				plas.assign(s[i + 1] - '0', s[i + 2]);
				i += 2;
			}
			else {
				plas = s[i];
			}
			ans += plas;
		}
		Cout(ans);
	}
}


Measured memory_bytes: 3088
#include<iostream>
using namespace std;
int main(){
    int a,b,c,t;
    cin>>a>>b>>c;
    if(a>b){
        t=a;a=b;b=t;
    }if(b>c){
        t=b;b=c;c=t;
    }if(a>b){
        t=a;a=b;b=t;
    }cout<<a<<" "<<b<<" "<<c<<endl;
    return 0;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793

int main(){
    int h, w;
    cin >> h >> w;

    vector<string> v(h);
    for(int i = 0; i < h; i++) cin >> v[i];
    for(auto x: v){
        cout << x << endl;
        cout << x << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <array>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional>
#include <cmath>
#include <numeric>
#include <bitset>
#include <cstdint>
#include <stdexcept>
using namespace std;

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

// 整数型

using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i512 = int512_t;

// [0,n)を昇順/降順でループ

#define rep(i, n) for (int i = 0; i < static_cast<int>(n); ++i)
#define repd(i, n) for (int i = static_cast<int>(n) - 1; i >= 0; --i)

// [a,b)を昇順/降順でループ

#define FOR(i, a, b) for (int i = static_cast<int>(a); i < static_cast<int>(b); ++i)
#define FORD(i, a, b) for (int i = static_cast<int>(b) - 1; i >= static_cast<int>(a); --i)

// デバッグ

#ifdef DEBUG
#include <cassert>
#define my_assert(x) assert(x)
#else
#define my_assert(x)
#define assert(x)
#endif

//////////////// //////////////// //////////////// //////////////// ////////////////
//////////////// //////////////// //////////////// //////////////// ////////////////

map<pair<i512, int>, i512> memo;
i512 loop(i512 n, int k)
{
    if (memo.find({n, k}) != memo.end())
    {
        return memo[{n, k}];
    }
    int n0 = static_cast<int>(n % 10);
    // 0 or (0,n0] or (n0,10)
    auto res1 = loop(n / 10, k); // 0
    auto res2 = k >= 1 ? loop(n / 10, k - 1) : 0; // (0,n0]
    auto res3 = (k >= 1 and n >= 10) ? loop(n / 10 - 1, k - 1) : 0; // (n0,10)
    return memo[{n, k}] = res1 + n0 * res2 + (9 - n0) * res3;
}

int main()
{
    // 高速な入出力
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // 浮動小数の表示の精度
    cout << setprecision(15);

    string s;
    cin >> s;
    i512 n(s);
    int k;
    cin >> k;

    memo[{0, 0}] = 1;
    FOR(i, 1, 4)
    {
        memo[{0, i}] = 0;
    }
    cout << loop(n, k) << endl;

    return 0;
}


Measured memory_bytes: 3912
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

int N;

long long int x[105], y[105];

int used[105];

long long int  dis(long long int x, long long int y) {
	return x*x + y*y;
}

long long int prod(long long int x, long long int y, long long int a, long long int b) {

	return a*x + b*y;
}

int main(void) {

	cin >> N;

	long long int ans = 0;

	for (int i = 1; i <= N; i++) {
		cin >> x[i] >> y[i];
	}


	long long int X, Y;



	for (long long int a = -1000000; a <= 1000000; a++) {
		long long int b = 1000000 - abs(a);

		X = 0; Y = 0;
		for (int i = 1; i <= N; i++) {
			if (prod(a, b, x[i], y[i]) >= 0) { X += x[i]; Y += y[i]; }
		}
		ans = max(ans, dis(X, Y));
	}

	for (long long int a = -1000000; a <= 1000000; a++) {
		long long int b = -(1000000 - abs(a));

		X = 0; Y = 0;
		for (int i = 1; i <= N; i++) {
			if (prod(a, b, x[i], y[i]) >= 0) { X += x[i]; Y += y[i]; }
		}
		ans = max(ans, dis(X, Y));
	}

	long double ANS;

	
	ANS = sqrt(1.0L*ans);

	cout << setprecision(15) << fixed << ANS << endl;

	return 0;
}

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

typedef long long ll;
#define PI 3.1415926535897932384626433
#define mod 1000000007

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

int lcm(int a, int b) { return a * b / gcd(a, b); }

int main(){
    int n, p;
    bool ch = false;
    cin >> n >> p;
    int a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }

    ll ans = 1;
    for (int i = 0; i < n; i++){
        if(a[i] % 2 == 1){
            ch = true;
        }
        ans *= 2;
    }

    if(ch){
        cout << ans / 2 << endl;
    }else if (p == 1){
        cout << 0 << endl;
    }else{
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))

lis = [pow(-1,i) for i in range(n)]

res1 = 0
s1 = 0
for i in range(n):
	s1 += a[i]
	if lis[i] == 1:
		if s1 <= 0:
			res1 += 1 - s1
			s1 = 1
	else:
		if s1 >= 0:
			res1 += s1 + 1
			s1 = -1

lis = [pow(-1,i)*(-1) for i in range(n)]

res2 = 0
s2 = 0
for i in range(n):
	s2 += a[i]
	if lis[i] == 1:
		if s2 <= 0:
			res2 += 1 - s2
			s2 = 1
	else:
		if s2 >= 0:
			res2 += s2 + 1
			s2 = -1

print(min(res1,res2))

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

//26
typedef long long ll;

ll power(ll a , ll b) {
    ll ans = 1;
	while (b) {
		if (b & 1) {
			ans = ans  * a;
		}
		a = a * a;
		b  /= 2;
	}
	return ans;
}

int main() {
	int n;
	cin >> n;
	vector<int> v(n);
	for (int i = 0; i < n; ++i) {
		cin >> v[i];
	}
	int g = 0;
	for (int i = 0; i < n; ++i) {
		g = __gcd(v[i],g);
	}
	cout << g;
} 	



Measured memory_bytes: 3772
#include <stdio.h>
#include <stdlib.h>
int cmp ( const void *a , const void *b )
{
return *(int *)a - *(int *)b;
}
int main()
{
    int n,k,m,sum=0;
    int a[1001];
    scanf("%d %d",&n,&k);
    for(m=0;m<n;m++)
    {
        scanf("%d",&a[m]);
    }
    qsort(a,n,sizeof(a[0]),cmp);
    for(m=0;m<k;m++)
        sum=sum+a[m];
    printf("%d",sum);
    return 0;
}

Measured memory_bytes: 1748
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const long double EPS = 1e-9;

#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<char> &o) {
    string a;
    in >> a;
    for (char c : a) o.insert(c);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<char> &s, char a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<P, vector<P>, greater<P> > PQ_ASK;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    rep(i, n) {
        if (s[i] == '?') s[i] = 'D';
    }

    cout << s << endl;
}


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

signed main(void)
{
	int h, w;
	cin >> h >> w;
	string s[h];
	bool flag_l[h], flag_r[w + 1];
	rep(i, h) {cin >> s[i]; s[i] +='\n';}
	rep(i, h) flag_l[i] = false; 
	rep(i, w + 1) flag_r[i] = false;
	rep(i, h) rep(j, w)
	{
		if (s[i][j] == '#')
			flag_l[i] = true;
	}
	rep(i, w + 1) rep(j, h)
	{
		if (s[j][i] != '.')
			flag_r[i] = true;
	}
	rep(i, h)
	{
		rep(j, w + 1)
		{
			if (flag_l[i] && flag_r[j])
				cout << s[i][j];
		}
	}
	return 0;
}


Measured memory_bytes: 256
while 1:
    H, W = map(int, input().split())
    if(H == 0 and W == 0):
        break
    for i in range(H):
        if(i != 0):
            print()
        for j in range(W):
            if(i%2 == 0):
                if(j%2 == 0):
                    print('#',end="")
                else:
                    print('.',end="")
            else:
                if(j%2 == 0):
                    print('.',end="")
                else:
                    print('#',end="")
    print()
    print()



Measured memory_bytes: 7008
n, m = [int(x) for x in input().split(' ')]

ans = 0

if m == 1:
    ans = 0
elif n * 2 > m:
    ans = m // 2
elif n * 2 + 4 > m:
    ans = n
else:
    ans = (m - (n*2)) // 4 + n

print(ans)

Measured memory_bytes: 3060
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Buffer(make([]byte, 500000), 500000)
	sc.Split(bufio.ScanWords)

	s := next()

	isFumiyasui := true
	for i, c := range s {
		if i%2 == 0 {
			if c == 'L' {
				isFumiyasui = false
				break
			}
		} else {
			if c == 'R' {
				isFumiyasui = false
				break
			}
		}
	}
	if isFumiyasui {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextInt64() int64 {
	sc.Scan()
	i, _ := strconv.ParseInt(sc.Text(), 10, 64)
	return i
}


Measured memory_bytes: 640
#!/usr/bin/env python3
def main():
    from collections import deque

    N, M, K = map(int, input().split())
    friends = [set() for _ in range(N + 1)]
    for _ in range(M):
        a, b = map(int, input().split())
        friends[a].add(b)
        friends[b].add(a)
    blocks = [set() for _ in range(N + 1)]
    for _ in range(K):
        c, d = map(int, input().split())
        blocks[c].add(d)
        blocks[d].add(c)

    friends_chain = []
    seen = [-1] * (N + 1)
    cnt = 0
    for person in range(1, N + 1):
        if seen[person] != -1:
            continue
        q = deque([person])
        friends_chain.append(set(q))
        while q:
            now = q.pop()
            seen[now] = cnt
            for next in friends[now]:
                if seen[next] != -1:
                    continue
                friends_chain[-1].add(next)
                q.append(next)
        cnt += 1

    for person in range(1, N + 1):
        res = friends_chain[seen[person]]
        tmp_ans = len(res) - len(friends[person]) - 1
        for block in blocks[person]:
            tmp_ans -= 1 if block in res else 0
        print(tmp_ans, end=' ')


if __name__ == '__main__':
    main()


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

int main() {

	long long  N; cin >> N;
	long long  ans = N - 1;
	for (int i= 1 ; i<1000010; i++) {
		if (N % i == 0) {
			ans = min(ans, i + N / i - 2);
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
typedef long long int ll;
using namespace std;
using Graph = vector<vector<int> >;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll x;
cin>>x;
ll sum=0;
ll cnt=0;
int add[2]={6,5};
if(x>11){
    cnt=cnt+2*(x/11);
    sum=11*ll(x/11);
}
while(sum<x){
    sum+=add[cnt%2];
    cnt++;
}
cout<<cnt<<endl;
//system("pause");
return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#define sacnf scanf
#define pritnf printf
#define srnad srand
#define rnad rand
#define sl(sl_a) strlen(sl_a)
#define gt(gt_a) goto gt_a
#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))
#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))
#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))
#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))
#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))
#define re register
#define inl inline
#define br break
#define con continue
#define stt struct
#define nms namespace
#define gc getchar
#define rt return
#define infa (0x3f3f3f3f)
#define infb (0x7fffffff)
#define infd (0x7f)
#define in(in_a) freopen("F:/""/in"in_a".in","r",stdin)
#define out(out_a) freopen("F:/""/out"out_a".out","w",stdout)
#define fin(filein_a) freopen(filein_a".in","r",stdin)
#define fout(fileout_a) freopen(fileout_a".out","w",stdout)
typedef long long ll;
typedef int itn,nti,tin,tni,nit;
using namespace std;
const nit maxa=1004;
const nit maxb=54;
const nit maxc=4;
const tni maxd=24;
#include<iostream>

string x;
tni s;

tin main()
{
	cin>>x;
	//
	s=x.size();
	//
	printf("%c%d%c\n",x[0],s-2,x[s-1]);
	rt 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <iomanip>
#define INF 100000000000000
using namespace std;
typedef long long ll;
int n;
vector<ll> a;
ll dp[410][410];

int main(){
 //入力
 cin >> n;
 a.resize(n);
 for(int i = 0; i < n; ++i) cin >> a[i];
   
 for(int len = 2; len <= n; ++len){
   for(int i = 0; i + len <= n; ++i){
     int j = i + len;
     ll add = 0;
     ll tmp = INF;
     for(int l = i; l < j; ++l) add += a[l];
     for(int k = i+1; k < j; ++k){
       tmp = min(tmp, (dp[i][k] + dp[k][j] + add));
     }
     dp[i][j] += tmp;
   }
 }
 cout << dp[0][n] << endl;
 return 0;
}

Measured memory_bytes: 1536
a,b,c,d,e,f= map(int, input().split())
youeki=0
yousitu=0
noudo=0
n_a=int(f/(100*a))


for i in range(1+n_a):
 for j in range(1+int((f-100*i*a)/(100*b))):
  for k in range(1+int((f-100*i*a-100*j*b)/c)):
   for l in range(1+int((f-100*i*a-100*j*b-k*c)/d)):
    S=100.0*a*i+100.0*b*j+c*k+d*l
    T=c*k+d*l
    if S!=0:
     L=100.0*T/S
     if S<=f and L<=100*e/(100+e) and L>=noudo:
      noudo=L
      youeki=S
      yousitu=T
print(int(youeki),int(yousitu))


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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, a;
    int maxX = -Inf;
    cin >> n >> a;
    vector<int> card;
    rep (i, n) {
        int x;
        cin >> x;
        card.push_back(x - a);
        maxX = max(maxX, x);
    }
    vector<vector<ll> > dp(n + 1, vector<ll>(2 * n * maxX + 1, 0));
    dp[0][n * maxX] = 1;
    rep (i, n) {
        rep (j, 2 * n * maxX) {
            if (j < card[i] || j > card[i] + 2 * n * maxX) dp[i + 1][j] = dp[i][j];
            else if (card[i] <= j && j < card[i] + 2 * n * maxX) dp[i + 1][j] = dp[i][j] + dp[i][j - card[i]];
        }
    }
    cout << dp[n][n * maxX] - 1 << endl;

    return 0;
}


Measured memory_bytes: 2304
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>

using namespace std;
int n = 0;
int m = 0;


int main(){
    
    cin >> n >> m;
    int total = 0;
    for(int i = 1; i < n; i++){
        for(int j = 1; j < m; j++){
            total++;
        }
    }

    cout << total << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define speedhack ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fromfile freopen("input.txt", "r", stdin);  freopen("output.txt", "w", stdout); 
#define mod int (1e9+7)
#define MAXN int (1e9)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ull, ull> pull;
typedef pair<int, int> pii;
typedef pair<ld, ld> pld;
 


int k,t,n;
ll a,b,c,d;
string s;

int main() {
    speedhack;
    //fromfile;
    cin >> n;
    k = n%10;
    if (k == 2 ||k == 4 ||k == 5 ||k == 7|| k == 9){
        cout << "hon";
    }
    else if (k == 3){
        cout << "bon";
    }
    else{
        cout << "pon";
    }
 
}
 
 
    

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

long a[3*100000+7];
map <long,long> mp;

int main()
{
    long x,n,sum=0,cnt=0;
    cin >> n;
    mp[0]=1;
    for(int i=0;i<n;i++)
    {
        cin >> a[i];
        sum+=a[i];
        mp[sum]++;

    }
    sum=0;
    for(int i=0;i<n;i++)
    {
        sum+=a[i];
        long c=mp[sum];
        mp[sum]=0;
        cnt+=(c*(c-1)/2);
    }

    cout << cnt << endl;
}


Measured memory_bytes: 16384
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;

typedef long long ll;

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

int main(void) {
    int N, Q;
    cin >> N >> Q;
    string S;
    cin >> S;

    vector<int> idxes;
    {
        char prev = ' ';
        for (int i = 0; i < N; i++) {
            if (prev == 'A' && S[i] == 'C') {
                idxes.push_back(i - 1);
            }
            prev = S[i];
        }
    }

    for (int i = 0; i < Q; i++) {
        int l, r;
        cin >> l >> r;
        l--;
        r--;

        auto low = lower_bound(idxes.begin(), idxes.end(), l);
        auto high = lower_bound(idxes.begin(), idxes.end(), r);
        cout << high - low << endl;
    }

    return 0;
}


Measured memory_bytes: 1276
#include<bits/stdc++.h>
using namespace std;
int main(){
    while(1){
        int N;
        cin >> N;
        if(!N) break;
        string s[N];
        for(int i = 0; i < N; i++) cin >> s[i];
        const vector<int> po = {5, 7, 5, 7, 7};
        for(int i = 0; i < N; i++){
            int index = 0;
            vector<int> yo = po;
            for(int j = i; j < N; j++){
                if(index == 5) break;
                if(yo[index] < s[j].size()) break;
                yo[index] -= s[j].size();
                if(!yo[index]) index++;
            }
            if(index == 5){
                cout << i + 1 << endl;
                break;
            }
        }
    }
    return 0;
}



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

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  cout << v[n/2] - v[n/2-1] << endl;
  return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

string s, t;
vector<int> scnt(30, 0), tcnt(30, 0);

int main(void){
	
	cin >> s >> t;
	
	for(int i = 0; i < s.size(); ++i) ++scnt[s[i] - 'a'], ++tcnt[t[i] - 'a'];
	sort(scnt.begin(), scnt.end());
	sort(tcnt.begin(), tcnt.end());
	
	for(int i = 0; i < scnt.size(); ++i){
	    if(scnt[i] != tcnt[i]){ printf("No\n"); return 0; }
	}
	printf("Yes\n");
	
    return 0;
}


Measured memory_bytes: 776
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++) {
			a[i]=sc.nextInt();
		}
		long g=0;
		for(int i=0;i<n-1;i++) {
			for(int j=i+1;j<n;j++) {
				g+=a[i]*a[j];
			}
		}

		System.out.println(g);

	}

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define LOOP(i,x,n) for(int i=(x);i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
const int MOD=1e9+7;
const int INF=1e17;

int dp[200][20004];

signed main(){
  int N,W;
  cin>>N>>W;
  vector<int> v(N),w(N);
  REP(i,N)cin>>v[i]>>w[i];

  REP(i,N){
    REP(j,W+1){
      dp[i][j+w[i]]=max(dp[i][j+w[i]],dp[i][j]+v[i]);
      dp[i+1][j]=max(dp[i+1][j],dp[i][j]);
      //dp[i+1][j+w[i]]=max(dp[i+1][j+w[i]],dp[i][j]+v[i]);
    }
  }
  // REP(i,N+1){
  //   REP(j,W+1){
  //     cout<<dp[i][j]<<' ';
  //   }
  //   cout<<endl;
  // }
  // cout<<endl;
  int ans=0;
  REP(j,W+1){
    ans=max(ans,dp[N][j]);
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 12148
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

long long int cnt1[210000] = {}, cnt2[210000] = {};
long long int hoge[100000000] = {};

int main(){
    int N;
    cin >> N;
    string str;
    cin >> str;
    int cnt = 0;
    for(int i = 0; i < N; i++){
        if(str[i] == '#'){
            cnt += 1;
        }
        cnt1[i] = cnt;
    }
    cnt = 0;
    for(int i = N - 1; i >= 0; i--){
        if(str[i] == '.'){
            cnt += 1;
        }
        cnt2[i] = cnt;
    }
    long long int ans = min(cnt1[N - 1], cnt2[0]);
    for(int i = 0; i < N - 1; i++){
        ans = min(ans, cnt1[i] + cnt2[i + 1]);
    }
    cout << ans << endl;
    hoge[0] = 1;
    hoge[100000000 - 1] = 1;
    return 0;
}

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

int main(){
   int  a_health ,a_power ,  b_health , b_power ; 
    cin>>a_health>>a_power>>b_health>>b_power ; 
   
   int shots_atodie  = 0 ; 
   int  shots_btodie=0; 

   if(a_health%b_power==0){ 
       shots_atodie = a_health/b_power ; 
   }else{
       shots_atodie = a_health/b_power+1 ;
   }

   if(b_health%a_power==0){ 
       shots_btodie = b_health/a_power ; 
   }else{
       shots_btodie = b_health/a_power+1 ;
   }
      if(shots_atodie>=shots_btodie){
          cout<<"Yes\n" ; 
      }else{
          cout<<"No\n" ;
      }   
    }


Measured memory_bytes: 3596
n,m,c = map(int,input().split())
ans = list(map(int,input().split()))
cnt = 0
for i in range(n):
    g = 0
    x = list(map(int,input().split()))
    for j in range(m):
        g += ans[j]*x[j]
    if g+c>0:
        cnt+=1
print(cnt)

Measured memory_bytes: 3064