akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(nullptr);
	//const ll p = 1e9 + 7;
	//const ll p = 998244353;

	ll n, x;
	cin >> n >> x;
	vll l(n);
	for (ll i = 0; i < n; i++) cin >> l[i];
	ll ans = 1, p = 0;
	for (ll i = 0; i < n; i++) {
		p += l[i];
		if (p <= x) ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using pll = pair<long, long>;
#define fix20 cout << fixed << setprecision(20);
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define MOD 1000000007

int main(){
  string s;
  cin >> s;
  vector<vector<long>> dp(3,vector<long>(s.size()+1,0));
  long state = 1;
  rep(i,s.size()){
    if(s.at(i) == 'A'){
      dp.at(0).at(i+1) = (dp.at(0).at(i) + state)%MOD;
      dp.at(1).at(i+1) = dp.at(1).at(i);
      dp.at(2).at(i+1) = dp.at(2).at(i);
    }
    if(s.at(i) == 'B'){
      dp.at(0).at(i+1) = dp.at(0).at(i);
      dp.at(1).at(i+1) = (dp.at(1).at(i) + dp.at(0).at(i))%MOD;
      dp.at(2).at(i+1) = dp.at(2).at(i);
    }
    if(s.at(i) == 'C'){
      dp.at(0).at(i+1) = dp.at(0).at(i);
      dp.at(1).at(i+1) = dp.at(1).at(i);
      dp.at(2).at(i+1) = (dp.at(2).at(i) + dp.at(1).at(i))%MOD;
    }
    if(s.at(i) == '?'){
      dp.at(2).at(i+1) = (3*dp.at(2).at(i) + dp.at(1).at(i))%MOD;
      dp.at(1).at(i+1) = (3*dp.at(1).at(i) + dp.at(0).at(i))%MOD;
      dp.at(0).at(i+1) = (3*dp.at(0).at(i) + state)%MOD;
      state *= 3;
      state %= MOD;
    }
  }
  /*rep(i,s.size()+1){
    rep(j,3) cout << dp[j][i] << " ";
    cout << endl;
  }*/
  cout << dp.at(2).at(s.size())%MOD << endl;
}


Measured memory_bytes: 3584
#include <iostream>
#include <string>
using namespace std;
int main(){
  string O, E;
  cin >> O >> E;
  for(int i = 0; E.size() > i; i++){
    cout << O.at(i);
    cout << E.at(i);
  }
  if(O.size() - E.size() == 1){
    cout << O.at(O.size() - 1);
  }
  cout << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const static int MOD = 1000000007;
const int dx[4]={1, 0, -1, 0};
const int dy[4]={0, 1, 0, -1};
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; }
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PF push_front
#define PB push_back
#define SORT(V) sort((V).begin(), (V).end())
#define RVERSE(V) reverse((V).begin(), (V).end())
#define paired make_pair
#define PRINT(V) for(auto v : (V)) cout << v << " "
//charを整数に
int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; }
// 累積和 for (int i = 0; i < N; ++i) s[i+1] = s[i] + a[i]; 
void cum_sum(int N,vector<double> a, vector<double> &s){ for(int i=0; i<N; i++){ s[i+1]=s[i]+a[i];}}
//ユークリッドの控除法
ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}
//最小公倍数
ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b; // Be careful not to overflow
}
//素数判定
bool is_prime(long long n) {
    if (n <= 1) return false;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p == 0) return false;
    }
    return true;
}
int getdigit(ll num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}
//空白文字も入力 getline(cin, S);
//桁数指定 setprecision

int main()
{
    ios::sync_with_stdio(0); 
    cin.tie(0); 
    cout.tie(0);
    int A, B;
    cin >> A >> B;
    cout << A*B << endl;

}

Measured memory_bytes: 3648
#include "iostream"

using namespace std;

int main() {
  string flag = "E869120";
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    ans += s == flag;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3196
#include<iostream>
#include<cstring>
//#include<bits/stdc++.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstdio>
#include<map>
#include<set>
#define  si(a)       scanf("%d",&a)
#define  sl(a)       scanf("%lld",&a)
#define  sii(a,b)    scanf("%d%d",&a,&b)
#define  sll(a,b)    scanf("%lld%lld",&a,&b)
#define  queues      priority_queue
#define mod 998244353
#define mem(a)  memset(a,0,sizeof(a));
#define def(a) ((a)&(-a))
#define fi  first
#define se  second
#define mp  make_pair
#define  pb push_back
#define mem(a,b) memset(a,b,sizeof(a));
typedef long long ll;
//priority_queue<ll,vector<ll >,greater<ll > >q;
const int INF=0x3f3f3f3f;
//const double E=exp(1);
//const double PI=acos(-1);
using namespace std;
//__builtin_popcount
//priority_queue
const ll MAX=100000;
ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
ll kc(ll a,ll b)
{
    ll c=1;
    while(b)
    {
        if(b&1)c=(c*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return c;
}
bool cmp(double x,double y)
{
    return x>y;
}
ll F[50003*3];
ll Find(ll a)
{
    return F[a]<0?a:F[a]=Find(F[a]);
}
ll same(ll a,ll b)
{
    if(Find(a)==Find(b))return 1;
    return 0;
}
ll up1(ll a,ll b)
{
    ll x,y;
    x=Find(a);
    y=Find(b);
    if(x!=y)
        F[x]=y;
    return 0;
}
int read() {
    int x=0,f=1;char s=getchar();
    for(;s>'9'||s<'0';s=getchar()) if(s=='-') f=-1;
    for(;s>='0'&&s<='9';s=getchar()) x=x*10+s-'0';
    return x*f;
}ll a[100003];
ll  b[100003];
int main()
{
   // ios::sync_with_stdio(false);
    int t;
  cin>>t;
   for(int i=1;i<=t+1;i++)
    cin>>a[i];
    ll sum=0;
   for(int i=1;i<=t;i++)
   {
       cin>>b[i];
   }
   for(int i=1;i<=t;i++)
   { ll z=min(a[i],b[i]);
       sum+=z;b[i]-=z;
        z=min(a[i+1],b[i]);
       sum+=z;a[i+1]-=z;

   }cout<<sum;
}



Measured memory_bytes: 1792
h, w, k = map(int, input().split())
s = []
for i in range(h):
    temp = list(input())
    temp = list(map(int, temp))
    s.append(temp)
ans = 2000
for i in range(2 ** (h - 1)):
    line = 0
    temp = bin(i + 2 ** (h - 1))
    group = [[0]]
    for j in range(h - 1):
        if temp[-1-j] == "0":
            group[-1].append(j + 1)
        else:
            group.append([j + 1])
            line += 1
    count = [0] * len(group)
    for j in range(w):
        for l in range(len(group)):
            for m in group[l]:
                count[l] += s[m][j]
        flag = True
        for l in count:
            if l > k:
                flag = False
                break
        if flag == False:
            line += 1
            count = [0] * len(group)
            for l in range(len(group)):
                for m in group[l]:
                    count[l] += s[m][j]
    flag = True
    for j in count:
        if j > k:
            flag = False
            break
    if flag == False:
        line = 2000
    ans = min(ans, line)
print(ans)

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

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

   cout << a * b / 2 << endl;
}

Measured memory_bytes: 256
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}

void solve(){
    ll A;
    cin >> A;
    double B;
    cin >> B;
    ll b = (ll)(B * 1000);
    ll v1 = (A / 1000) * b;
    ll a = A % 1000;
    double ad = (double) a;
    ad = floor(ad * B);
    v1 += (ll) ad;
    print(v1);


    

}

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

Measured memory_bytes: 3736
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}

void solve(){
    string S;
    cin >> S;
    ll cnt = 0, ans = 0;
    rep(i,0,3){
        if(S[i] == 'R'){
            cnt++;
        }else{
            ans = max(ans, cnt);
            cnt = 0;
        }
    }
    ans = max(ans, cnt);
    print(ans);

}

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

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

using namespace std;

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

int main()
{
	int mi = 1000, ma = -1;
	int i = 3;
	while (i--) {
		int a;
		cin >> a;
		ma = max(a, ma);
		mi = min(a, mi);
	}
	cout << ma - mi << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = 0;
    String result = null;
    k = n / 1000;
    if(k<1){
      result = "ABC";
    }else
    if(1<=k){
      result = "ABD";
    }
    System.out.println(result);
  }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vs = vector<string>;
#define  rep(i,n) for(ll i = 0; i < (n); ++i)
#define  red(i,n) for(ll i = (n)-1; i >= 0; --i)
#define  all(a)   begin(a),end(a)
#define  pb(a)    push_back(a)
#define  yn       cout<<"Yes\n"; else cout<<"No\n";
inline ll gcd(ll a,ll b) { return b?gcd(b,a%b):a; }
const int INF=1000000009;
const ll LINF = 1e18;


int main()
{
    int a[3],x;
    rep(i,3)cin>>a[i];
    sort(a,a+3);
    x=(a[2]*2-a[1]-a[0]);
    cout<<x/2+(x%2)*2<<endl;

    return 0;
}


Measured memory_bytes: 256
N = int(input())
Hs = list(map(int, input().split()))

if N == 1:
	print("Yes")
	exit(0)

for i in range(N-1, 1, -1):
	if Hs[i] - Hs[i-1] < -1:
		print("No")
		exit(0)
	if Hs[i] - Hs[i-1] < 0:
		Hs[i-1] -= 1

for i in range(N-1, 1, -1):
	if Hs[i-1] > Hs[i]:
		print("No")
		exit(0)

print("Yes")


Measured memory_bytes: 14252
import math

N, D = map(int, input().split(' '))

coords = []
for _ in range(N):
    coords.append(list(map(int, input().split(' '))))
    
dist = []
for x,y in coords:
    dist.append(math.sqrt(x**2+y**2))
    
print(sum([i<=D for i in dist]))

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

#define LL long long

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	LL n,q,a,b;
	cin >> n >> q;
	vector<vector<LL>> g(n);
	for (LL i = 1; i < n; i++){
		cin >> a >> b;
		a--;
		b--;
		g[a].push_back(b);
	}
	vector<LL> counters(n,0);
	while (q--){
		cin >> a >> b;
		a--;
		counters[a] += b;
	}
	for (LL i = 0; i < n; i++){
		for (LL v : g[i])
			counters[v] += counters[i];
	}
	cout << counters[0];
	for (LL i = 1; i < n; i++)
		cout << " " << counters[i];
	cout << "\n";
}


Measured memory_bytes: 14976
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int m, f, b;
    cin >> m >> f >> b;
    if(m + f < b) cout << "NA" << endl;
    else cout << max(0LL, b - m) << endl;
}

Measured memory_bytes: 3204
a = []
for _ in range(5):
    b = int(input())
    t = 10 if b%10 == 0 else b%10
    a.append((t, b))
a.sort()
a.reverse()
c = 0
for i in range(4):
    if a[i][0] == 10:
        c += (a[i][1]  - a[i][1] % 10)
    else:
        c += (a[i][1] + (10 - a[i][1] % 10))
c += a[-1][1]
print(c)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

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

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

void solve(long long N, std::vector<long long> H)
{
    ll maximum = H[0];
    ll ans = 0;
    for (int i = 0; i < N; i++)
    {
        if(maximum <= H[i]){
            ans++;
            maximum = max(maximum,H[i]);
        }
    }
    cout << ans << endl;
    
}

int main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> H(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &H[i]);
    }
    solve(N, std::move(H));
    return 0;
}


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

using namespace std;


int main (void) 
{

  /* Variable_Proclamation */
  int N;    // input
  int count;  // output

  int i;    // subscript

  bool judge;


  /* Input, Array_Proclamation */
  cin >> N;
  vector<int> A(N);

  for(i=0; i<N; i++)
  {
    cin >> A.at(i);
  }


  /* Initialize */
  count = 0;
  judge = true;


  /* Calculation */
  while(true)
  {

    for(i=0; i<N; i++)
    {

      if(A.at(i) % 2 == 0)
      {
        A.at(i) /= 2;
      }
      else
      {
        judge = false;
      }
      
    }

    if(judge == true)
    {
      count++;
    }
    else
    {
      break;
    }
    
  }
  

  /* Output */
  cout << count << endl;


  return 0;

}


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

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

    vector<long double> s(n,0.0);
    //s[0]を計算する
    for(int i=0;i<k;i++){
        s[0]+=(p[i]+1)/2.0;
        //cout << s[0] << endl;
    }
    
    for(int i=1;i+k-1<n;i++){
        s[i] = s[i-1] - (p[i-1]+1)/2.0 + (p[i+k-1]+1)/2.0;
    }

    long double res = 0;
    for(int i=0;i+k-1<n;i++){
        res = max(s[i],res);
    }

    cout << fixed << setprecision(6);
    cout << res << endl;
}   



Measured memory_bytes: 4096
"""
author : halo2halo
date : 31, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B = map(int, readline().decode('utf8').split())
if A == 1:
    A = 100
if B == 1:
    B = 100

print('Alice' if A > B else 'Draw' if A == B else 'Bob')


Measured memory_bytes: 3060
import math

N = int(input())
X_double = N / 1.08
if (X_double % 1) == 0:
  print(int(X_double))
else:
  X_ceil = math.ceil(X_double)
  if math.floor(X_ceil * 1.08) == N:
    print(X_ceil)
  else:
    print(':(')
  
    

Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<bitset>
#include<string>
#include<cmath>
#include<algorithm>
#include<stack>
#include<list>
#include<queue>
#include<map>
#include<numeric>
#include<set>
#include<iterator>
#include<cstdio>
using namespace std;
#define rep(i,x) for(int i=0;i<x;i++)
#define re(i,x,y) for(int i=x;i<y;i++)
int INF=1e9;
const long long mod=1e9+7;
#define ll long long

int main(){
  int n;
  cin>>n;
  vector<int>a(n+2),b(n+2);
  for(int i=1;i<=n;i++){
    cin>>a[i];
  }
  int sum=0;
  a[0]=0,a[n+1]=0;
  for(int i=1;i<=n+1;i++){
    sum+=(abs(a[i]-a[i-1]));
  }
  for(int i=1;i<=n;i++){
    if(a[i]>=a[i-1]&&a[i]<=a[i+1]){
      b[i]=sum;
    }
    else if(a[i]<=a[i-1]&&a[i]>=a[i+1]){
      b[i]=sum;
    }
    else if(a[i]>=a[i-1]&&a[i]>=a[i+1]){
      b[i]=sum-((a[i]-a[i-1])+(a[i]-a[i+1])-abs(a[i-1]-a[i+1]));
    }
    else if(a[i-1]>=a[i]&&a[i]<=a[i+1]){
      b[i]=sum-((a[i-1]-a[i])+(a[i+1]-a[i])-abs(a[i+1]-a[i-1]));
    }
    cout<<b[i]<<endl;
  }
  return 0;
}


Measured memory_bytes: 2048
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
t = na()
v = na()

bound = [0] * (n+1)
for i in range(n-1):
    bound[i+1] = min(v[i], v[i+1], bound[i] + t[i])
for i in range(n-1,0,-1):
    bound[i] = min(bound[i], v[i], v[i-1], bound[i+1] + t[i])

ans = 0
for i in range(n):
    l = bound[i]
    r = bound[i+1]
    # l + x = r + t - x
    # x = (r-l+t)/2
    x = (r-l+t[i])/2
    if l + x <= v[i]:
        ans += (l + (l + x)) * x / 2 + (l + x + r) * (t[i] - x) / 2
    else:
        ans += (v[i] + l) * (v[i] - l) / 2 + (v[i] + r) * (v[i] - r) / 2
        ans += (t[i] - (v[i] - l) - (v[i] - r)) * v[i]
print("{:.14f}".format(ans))


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

int main() {
	int a, b;
	char op;
	scanf("%d %c %d", &a, &op, &b);
	
	if (op == '+') {
		printf("%d\n", a + b);
	} else {
		printf("%d\n", a - b);
	}
	return 0;
}

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

int main() {

    int array[3];
    for(int i=0; i<3; i++){
    	cin >> array[i];
    }
    sort(begin(array), end(array));
    cout << array[2]*10 + array[1] + array[0] << endl;
} 

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

int souwa(int A) {
	if (A == 0) {
		return 1;
	}
	return A * souwa(A - 1);

 }



int main() {
	char N ;
	cin >> N;
	cout << (char)(N + 1) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define each(a,x) for(auto a : (x))
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) ((a) = min((a),(b)))
#define chmax(a,b) ((a) = max((a),(b)))
#define in_range(x,l,r) ((l)<=(x) && (x)<(r))
#define printvec(a) rep(i,a) cout << a[i] << " \n"[i+1==(a).size()];
#define fs first
#define sc second
#define em emplace
#define eb emplace_back
#define sz size()
#define MP make_pair
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;

const ll INF = 1e8;
const D EPS = 1e-8;
const ll MOD = 1e9+7;

ll divNum(ll a, ll d){
  if(a<0) return 0;
  return a/d + 1;
}

int main(){
  ll a,b,x;
  cin >> a >> b >> x;
  cout << divNum(b,x) - divNum(a-1,x) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define endl '\n'
#define fastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
using namespace std;
int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b,a % b);
}
int combination(int n, int k){
    int spaceOptimize[k+1];
    memset(spaceOptimize, 0, sizeof(spaceOptimize));
    spaceOptimize[0] = 1;
    for(int i=1;i<=n; i++){
        for(int j= min(i,k);j>0;j--){
            spaceOptimize[j] = spaceOptimize[j] + spaceOptimize[j-1];
        }
    }
    return spaceOptimize[k];
}
int count_permutation(int arr[], int n){
    int a[n];
    for(int i=0;i<n;i++){
        a[i] = i+1;
    }
    int count = 0;
    do {
        count++;
        if (equal(a, a + n, arr)){
            return count;
        }
    } while (next_permutation(a, a + n));
    return 0;
}

signed main(){
#ifndef ONLINE_JUDGE
   // freopen("input.txt","r", stdin);
#endif
    fastIO

    int n,m;
    cin >> n >> m;
    priority_queue <int> price;
    for(int i=0,temp;i<n;i++){
        cin >> temp;
        price.push(temp);
    }
    for(int i=0;i<m;i++){
        int max_curr = price.top();
        price.pop();
        price.push(max_curr/2);
    }
    int finalPrice = 0;
    while(!price.empty()){
        finalPrice += price.top();
        price.pop();
    }
    cout << finalPrice;
    return 0;
}


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

int main () {
  int64_t N, ans = 0;
  cin >> N;
  
  vector<int64_t> vec(N);
  vector<int64_t> cnt(N+1,0);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
    cnt.at(vec.at(i))++; 
  }
  
  for (int i = 1; i < N+1; i++) {
    int64_t k = cnt.at(i);
    ans += k * (k-1) / 2;
  }
  for (int i = 0; i < N; i++) {
    cout << ans - cnt.at(vec.at(i)) +  1 << endl;
  }
}
  




Measured memory_bytes: 5760
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>

#define mp make_pair
#define pb push_back


typedef long long ll;
typedef long double ld;

using namespace std;

const int MAXN = 120000;
int n;
ll a[MAXN];
ll b[MAXN];

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		scanf("%lld", a + i);
	ll sum = 0;
	for (int i = 0; i < n; ++i)
		sum += a[i];
	ll k = (ll)n * (n + 1) / 2;
	if (sum % k != 0) {
		cout << "NO\n";
		return 0;
	}
	k = sum / k;
	a[n] = a[0];
	sum = 0;
	for (int i = 1; i <= n; ++i) {
		ll x = a[i] - a[i - 1] - k;
		x = -x;
		if (x < 0 || x % n != 0) {
			cout << "NO\n";
			return 0;
		}
		b[i] = x / n;
		sum += b[i];
	}
	if (sum == k) {
		cout << "YES\n";
	}
	else {
		cout << "NO\n";
	}
	return 0;
}




Measured memory_bytes: 1792
#include <stdio.h>
int main() {
  int n;
  int i, ans = 0;
  scanf ("%d\n", &n);
  char s[n];
  scanf ("%s", s);

  for (i = 0; i < n - 2; i++) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++;
  }

  printf ("%d", ans);

  return 0;
}


Measured memory_bytes: 128
import sys
input = sys.stdin.buffer.readline
from operator import itemgetter

def main():
    N,C = map(int,input().split())
    ch = [[] for _ in range(C)]
    l = 0
    for _ in range(N):
        s,t,c = map(int,input().split())
        l = max(l,t)
        ch[c-1].append((s,t))
    
    for x in ch:
        x.sort(key=itemgetter(0))

    imos = [0 for _ in range(l+2)]
    for x in ch:
        now = -1
        for st,ft in x:
            if st == now:
                imos[st] += 1
            else:
                imos[st-1] += 1
            imos[ft] -= 1
            now = ft
                
    for i in range(l+1):
        imos[i+1] += imos[i]
    
    print(max(imos))
    
if __name__ == "__main__":
    main()


Measured memory_bytes: 18180
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
const int maxn=2e7+10;
const LL inf=300000000000000;
LL x[maxn];
struct AC
{
    struct zp
    {
        int lson,rson;
        LL sum;
    }tree[maxn];
    int cont,root;
    void init()
    {
        cont=0;
        root=-1;
    }
    int newnode()
    {
        tree[cont].lson=tree[cont].rson=-1;
        tree[cont].sum=0;
        cont++;
        return cont-1;
    }
    void update(int &k,LL l,LL r,LL num)
    {
        if(k==-1) k=newnode();
        tree[k].sum++;
        if(l==r) return ;
        LL mid=(l+r)>>1;
        if(num<=mid)
            update(tree[k].lson,l,mid,num);
        else
            update(tree[k].rson,mid+1,r,num);
    }
    LL query(int k,LL l,LL r,LL ql,LL qr)
    {
        if(k==-1) return 0;
        if(l==ql&&r==qr)
            return tree[k].sum;
        LL mid=(l+r)>>1;
        if(qr<=mid)
            return query(tree[k].lson,l,mid,ql,qr);
        else if(ql>mid)
            return query(tree[k].rson,mid+1,r,ql,qr);
        else
            return query(tree[k].lson,l,mid,ql,mid)+query(tree[k].rson,mid+1,r,mid+1,qr);
    }
}ac;
int main()
{
    int n;
    LL m;
    while(~scanf("%d%lld",&n,&m))
    {
        ac.init();
        for(int i=0;i<n;i++)
        {
            scanf("%lld",&x[i]);
            x[i]-=m;
        }
        for(int i=1;i<n;i++)
            x[i]+=x[i-1];
        ac.update(ac.root,-inf,inf,0);
        LL ans=0;
        for(int i=0;i<n;i++)
        {
            ans+=ac.query(ac.root,-inf,inf,-inf,x[i]);
            if(i<n-1) ac.update(ac.root,-inf,inf,x[i]);
        }
        printf("%lld\n",ans);
    }
}

Measured memory_bytes: 98560
if __name__ == '__main__':
    N, K = map(int, input().split())
    S = input()
    # ans = 0
    # for i in range(N-1):
    #     if S[i] == S[i+1]:
    #         ans += 1
    ans = N - 1 - S.count('LR') - S.count('RL')
    ans = min(N-1, ans+K*2)
    print(ans)


Measured memory_bytes: 39152
import std.stdio, std.string, std.conv, std.range, std.algorithm, std.array;

void main()
{
    while(true)
    {
        int num = readln.chomp.to!int;
        if(!num)break;
        ulong[3][10_000] dp;
        foreach(i, time; num.iota.map!(a => readln.chomp.to!ulong).array.sort)
        {
            dp[i][0] = time;
            if(i)
            {
                dp[i][1] = dp[i - 1][0] + dp[i - 1][1];
                dp[i][2] = dp[i - 1][2] + dp[i][1];
            }
        }
        dp[num - 1][2].writeln;
    }
}

Measured memory_bytes: 1776
#include<bits/stdc++.h>
using namespace std;
int main(){
	int k,a,b;
	cin>>k>>a>>b;
	if(b-a<=2){
		cout<<k+1;
	}
	else{
		if(k<=a-1){
			cout<<k+1;
		}
		else{
			k-=(a-1);
			long long sl=k/2;
			unsigned long long ans=a;
			ans+=sl*(b-a);
			if(k%2==1){
				ans++;
			}
			cout<<ans;
		}
	}
}

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

typedef long long readtype;
typedef long long var;
typedef long double let;

readtype read() {
  readtype a = 0, c = getchar(), s = 0;
  while (!isdigit(c)) s |= c == '-', c = getchar();
  while (isdigit(c)) a = a * 10 + c - 48, c = getchar();
  return s ? -a : a;
}

#ifdef LOCAL_LOGGER
#define logger(...) fprintf(stderr, __VA_ARGS__)
#define abortif(v, ...) if (v) {logger("Error in Line %d, Function '%s()'.\nInfo: ", __LINE__, __FUNCTION__); logger(__VA_ARGS__); exit(0);}
#else
#define logger(...);
#define abortif(v, ...);
#endif
/* }}} */

const let EPS = 1e-8;

struct Point {
  let x, y;
  friend Point operator + (Point a, Point b) {
    return (Point) {a.x + b.x, a.y + b.y};
  }
  friend Point operator - (Point a, Point b) {
    return (Point) {a.x - b.x, a.y - b.y};
  }
  Point operator ~ () {
    return (Point) {x, -y};
  }
  Point operator * (let k) { return (Point) {x * k, y * k}; }

  let dist() {
    return sqrt(x * x + y * y);
  }

  Point Rotate(let sink, let cosk) {
    return (Point) {
      x * cosk - y * sink, x * sink + y * cosk
    };
  }

  Point Rotate(Point k) {
    let z = k.dist();
    return Rotate(k.y / z, k.x / z);
  }

  void EchoWith(char c) {
    printf("%.8Lf %.8Lf", x, y);
    putchar(c);
  }
};

typedef Point Vec;

struct Segment {
  Point s, e;
  Vec v;
  Segment() {}
  Segment(Point a, Point b) {
    s = a, e = b, v = b - a;
  }
  Segment(Point a, Point b, Vec c) {
    s = a, e = b, v = c;
  }

  Segment operator - (Vec k) {
    return (Segment) {
      s - k, e - k, v
    };
  }

  Segment Rotate(let sink, let cosk) {
    return (Segment) {
      s.Rotate(sink, cosk), e.Rotate(sink, cosk), v.Rotate(sink, cosk)
    };
  }

  Segment Rotate(Vec k) {
    let z = k.dist();
    return Rotate(k.y / z, k.x / z);
  }

  friend Point CrossPoint(Segment a, Segment b) {
    Segment c = (b - a.s).Rotate(~a.v);
    return (c.e - c.v * (c.e.y / c.v.y)).Rotate(a.v) + a.s;
  }
};

Point ReadPoint() {
  Point t;
  scanf("%Lf%Lf", &t.x, &t.y);
  return t;
}

int main() {
// #ifndef ONLINE_JUDGE
//   freopen("CGL_2_C.in", "r", stdin);
//   freopen("CGL_2_C.out", "w", stdout);
// #endif
// #ifdef LOCAL_LOGGER
//   freopen("CGL_2_C.log", "w", stderr);
// #endif
  int q = read();
  while (q--) {
    Point p0 = ReadPoint(), p1 = ReadPoint(), p2 = ReadPoint(), p3 = ReadPoint();
    Segment s1 = Segment(p0, p1), s2 = Segment(p2, p3);
    CrossPoint(s1, s2).EchoWith('\n');
  }
  return 0;
}

/* ==== Makefile ==== {{{
CompileAndRun:
	make Compile
	make Run

Compile:
	g++ -o CGL_2_C CGL_2_C.cpp -g -Wall -DLOCAL_LOGGER

CompileUF:
	g++ -o CGL_2_C CGL_2_C.cpp -g -Wall -DLOCAL_LOGGER -fsanitize=undefined

Run:
	./CGL_2_C < CGL_2_C.in > CGL_2_C.out
==================
}}} */



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

void solve(){
  int a, b; cin >> a >> b;
  if(a == b) cout << 2 * a << endl;
  else if(a > b) cout << a + (a - 1) << endl;
  else cout << b + (b - 1) << endl;
  return;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define max(a, b) ((a)>(b)?(a):(b))
#define min(a, b) ((a)>(b)?(b):(a))
int R, C, K, m[3333][3333];
long dp[3333][3333][4], ans = 0;
int main(){
	scanf("%d%d%d", &R, &C, &K);
	while(K--){
		int r, c, v;
		scanf("%d%d%d", &r, &c, &v);
		m[r][c] += v;
	}
	for(int i=1; i<=R; i++){
		for(int j=1; j<=C; j++){
			for(int k=0; k<4; k++){
				dp[i][j][0] = max(dp[i][j][0], dp[i-1][j][k]);
				dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k]);
			}
			for(int k=1; k<4; k++){
				dp[i][j][k] = max(max(dp[i][j][k], dp[i][j-1][k]), max(dp[i][j][0], dp[i][j-1][k-1])+m[i][j]);
				ans = max(ans, dp[i][j][k]);
			}
		}
	}
	printf("%ld\n", ans);
	return 0;
}

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

//#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LONG_LONG_MAX


bool cmp(int a, int b)
{
    return a > b;
}
int main()
{
    double n, a, b;
    cin >> n;
    vector<double> h(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> h[i];
    }
    sort(h.begin(), h.end(), cmp);
    for (int i = 0; i < n-1; ++i)
    {
        double a=h[n-i-1];
        double b=h[n-i-2];
        h.pop_back();
        h.pop_back();
        h.push_back((a+b)/2);
    }
    cout<<h[0]<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <climits>
#include <algorithm>
#include <stack>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <string>

using namespace std;

char s[110][110];
int n,m;

int main() {
   // freopen("test.in","r",stdin);
    //freopen("test.out","w",stdout);
    cin >> n >> m;
    for (int i=1;i<=n;i++) {
        scanf("%s",s[i]);
    }
    for (int i=1;i<=n+2;i++) {
        if (i == 1 || i == n+2) {
          for (int j=1;j<=m+2;j++)
           printf("#");
          printf("\n");
        }
         else {
             printf("#%s#\n",s[i-1]);
         }
    }
    return 0;
}

Measured memory_bytes: 256
// Aizu 2150: Matsuzaki Number
// 2017.9.20 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX  101300
#define SQRT 318     // sqrt(MAX)
char prime[MAX + 3], *p, *q, *pmax = prime + MAX;

int a[105];
char f[1500];

void mkprime()
{
	int k;
	prime[1] = 1;
//	for (p = prime + 4; p <= pmax; p += 2) *p = 1;
	for (k = 3, p = prime + 3; k <= SQRT; k += 2, p += 2)
		if (!*p) for (q = p + k; q <= pmax; q += k) *q = 1;
}

int main()
{
	int n, p, i, j, k, t, max, m;

	mkprime();
	while (scanf("%d%d", &n, &p) && p > 0) {
		if (n < 2) a[0] = 2, k = 1, i = 3;
		else k = 0, i = n + 1 + (n & 1);
		for ( ; k < p; i += 2) if (!prime[i]) a[k++] = i;
		memset(f, 0, sizeof(f));
		max = a[0] + a[p-1], m = a[0] << 1;
		for (k = 0, i = 0; i < p; i++) for (j = i; j < p; j++) {
			if ((t = a[i] + a[j]) > max) break;
			f[t-m]++;
		}
		for (k = 0, i = -1; k < p; ) k += f[++i]; 
		printf("%d\n", m + i);
	}
	return 0;
}

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

#define BeatMeScanf    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tc(x)          int x; cin >> x; while(x--)
#define ll             long long
#define vi             vector<int>
#define pii            pair<int,int>
#define mii            map<int,int>
#define inf            1<<28
#define mem(x,y)       memset(x, y, sizeof(x))
#define ps(x,y)        fixed<<setprecision(y)<<x
#define show(val)      cout<< #val << " -> " << val << endl
#define Case           cout<< "Case "<< ++cs << ": "
#define all(v)         (v).begin(), (v).end()
#define rall(v)        (v).rbegin(), (v).rend()
#define MOD            1000000007
#define MAX            100005

int main()
{
	BeatMeScanf;
	int n, m;
	cin >> n >> m;
	ll sum = 0;
	for (int i = 0; i < m; ++i)
	{
		int x;
		cin >> x;
		sum += x;
	}

	if((n-sum)<0) cout<< -1 <<'\n';
	else cout<< (n-sum) <<'\n';
	return 0;
}


Measured memory_bytes: 3652
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int n = scan.nextInt();
			int score = 0;
			int out = 0;
			boolean fir = false;
			boolean sec = false;
			boolean thi = false;
			String str;
			for(int i = 0;i < n;i++){
				do{
					str = scan.next();
					if(str.equals("OUT")){
						out += 1;
					}else if(str.equals("HIT")){
						if(thi){
							score += 1;
						}
						thi = sec;
						sec = fir;
						fir = true;
					}else if(str.equals("HOMERUN")){
						if(fir){
							score += 1;
							fir = false;
						}
						if(sec){
							score += 1;
							sec = false;
						}
						if(thi){
							score += 1;
							thi = false;
						}
						score += 1;
					}
				}while(out < 3);
				System.out.println(score);
				score = 0;
				fir = false;
				sec = false;
				thi = false;
				out = 0;
			}
		}
	}
}

Measured memory_bytes: 17200
from sys import stdin
from collections import deque
 
input = stdin.readline
 
k = int(input())
q = deque(list(range(1, 10)))
res = deque(list(range(1, 10)))
cnt = 9

while True:
    t = q.popleft()
    r = t % 10
    
    if r == 0:
        q.append(t * 10)
        q.append(t * 10 + 1)
        res.append(t * 10)
        res.append(t * 10 + 1)
        cnt += 2
    elif r == 9:
        q.append(t * 10 + 8)
        q.append(t * 10 + 9)
        res.append(t * 10 + 8)
        res.append(t * 10 + 9)
        cnt += 2
    else:
        q.append(t * 10 + r - 1)
        q.append(t * 10 + r)
        q.append(t * 10 + r + 1)
        res.append(t * 10 + r - 1)
        res.append(t * 10 + r)
        res.append(t * 10 + r + 1)
        cnt += 3

    if cnt >= k:
        break

print(res[k - 1])

Measured memory_bytes: 10180
#include <bits/stdc++.h>
using namespace std;
template<typename T> struct Dinitz{
	int n, source, sink;
	vector<vector<T>> adj;
	struct edge {
		int u;
		T flow, cap;
	};
	vector<edge> edges;
	Dinitz(int n, int source, int sink): n(n), source(source), sink(sink), adj(n) {}
	int add_edge(int a, int b, T abcap, T bacap = 0) {
		int result = edges.size();
		adj[a].push_back(edges.size());
		edges.push_back({b, 0, abcap});
		adj[b].push_back(edges.size());
		edges.push_back({a, 0, bacap});
		return result;
	}
	vector<int> mindist, position;
	bool bfs() {
		queue<int> q;
		fill(mindist.begin(), mindist.end(), INT_MAX / 2);
		mindist[source] = 0;
		q.push(source);
		while (!q.empty()) {
			int v = q.front();
			q.pop();
			for (int edid: adj[v]) {
				edge &ed = edges[edid];
				if (ed.flow < ed.cap && mindist[ed.u] > mindist[v] + 1) {
					mindist[ed.u] = mindist[v] + 1;
					q.push(ed.u);
				}
			}
		}
		return mindist[sink] < n;
	}
	T dfs(int v, T maxf) {
		if (v == sink) return maxf;
		for (int &pos = position[v]; pos < (int)adj[v].size(); ++pos) {
			int edid = adj[v][pos];
			edge &ed = edges[edid], &reved = edges[edid ^ 1];
			if (ed.flow < ed.cap && mindist[ed.u] == mindist[v] + 1) {
				T f = dfs(ed.u, min(maxf, ed.cap - ed.flow));
				if (f > 0) {
					ed.flow += f;
					reved.flow -= f;
					return f;
				}
			}
		}
		return 0;
	}
	T maxflow() {
		T result = 0;
		mindist.resize(n);
		position.resize(n);
		while (bfs()) {
			T extra;
			do {
				fill(position.begin(), position.end(), 0);
				extra = dfs(source, numeric_limits<T> :: max());
				result += extra;
			} while (extra > 0);
		}
		return result;
	}
};
int main(){
	int n; cin >> n;
	Dinitz<long long> flow(n + 2, 0, n + 1);
	const long long inf = 1ll<<60;
	long long x = 0;
	for(int i = 1; i <= n; i++){
		int v; cin >> v;
		if(v > 0) x += v;
		if(v <= 0) flow.add_edge(0, i, -v);
		else flow.add_edge(i, n + 1, v);
		for(int j = 2 * i; j <= n; j += i){
			flow.add_edge(i, j, inf);
		}
	}
	cout << x - flow.maxflow() << endl;
	return 0;
}


Measured memory_bytes: 256
def d_flipping_signs(N, A):
    minus_count = 0
    _a = []
    for a in A:
        if a >= 0:
            _a.append(a)
        else:
            minus_count += 1
            _a.append(abs(a))
    ans = sum(_a)
    if minus_count % 2 == 1:
        ans -= 2 * min(_a)
    return ans

N = int(input())
A = [int(i) for i in input().split()]
print(d_flipping_signs(N, A))

Measured memory_bytes: 14284
#include<cstdio>
#include<queue>
#include<string>
#include<cstring>
#include<cmath>
#include<map>
#include<iostream>
#include<algorithm>
#define ll long long
const ll mod = 1e9+7;
using namespace std;
int a,b,c;
int main()
{
	while(~scanf("%d%d%d",&a,&b,&c)) {
		int flag = 0;
		for(int k = 1; k<=10000005; k++) {
			if((b*k+c) % a == 0) {
				printf("YES\n");flag = 1;break;
			}
		}
		if(!flag) printf("NO\n");
	}
	
	
	return 0 ;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

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

    int a = stoi(s.substr(0, 2));
    int b = stoi(s.substr(2, 2));

    if(1 <= a && a <= 12){
        if(1 <= b && b <= 12)
            cout << "AMBIGUOUS" << endl;
        else
            cout << "MMYY" << endl;
    }
    else{
        if(1 <= b && b <= 12)
            cout << "YYMM" << endl;
        else
            cout << "NA" << endl;
    }

    return 0;
}


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

int main(void) {
  int n;
  cin >> n;

  int n0 = (int)(n / 1.08);

  if ((int)(n0 * 1.08) == n) {
    cout << n0 << endl;
  } else if ((int)((n0 + 1) * 1.08) == n) {
    cout << n0 + 1 << endl;
  } else {
    cout << ":(" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
(stdin => {
  // Define Function
  const Same = (a, b) => {
    if (a === b) {
      return 'a == b'
    } else if (a > b) {
      return 'a > b'
    } else {
      return 'a < b'
    }
  }
  // Declare Variable
  const inputs = stdin.toString().trim().split('\n')
  const [more, less] = Array.from(inputs[0].split(' '),Number)
  console.log(Same(more, less))
})(require('fs').readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 15136
N = int(input())
A = [int(input()) for _ in range(N)]
check = [True for _ in range(N)]

ai = 1
count = 1
while check[ai-1]:
  if A[ai-1] == 2:
    print(count)
    exit()
  check[ai-1] = False
  ai = A[ai-1]
  count += 1
print(-1)


Measured memory_bytes: 7888
#[allow(unused_imports)]
use std::{cmp::Reverse, collections::*};

#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Chars, Usize1},
};

#[allow(unused_imports)]
use itertools::Itertools;

#[allow(unused_imports)]
use num::Integer;

#[fastout]
pub fn main() {
    input! {
        n: usize,
        mut v: [usize; n],
    }
    v.sort();
    println!(
        "{}",
        v.iter().fold(v[0] as f64, |acc, v| (acc + *v as f64) / 2.0)
    );
}


Measured memory_bytes: 2192
n, c = map(int, input().split())
MAX_COLS = 10**5
table = [[0 for _ in range(MAX_COLS)] for _ in range(c)]

for _ in range(n):
    s, t, i = list(map(int, input().split()))
    for j in range(max(0, s - 2), t - 1):
        table[i - 1][j] = 1

res = 0
for j in range(MAX_COLS):
    count = 0
    for i in range(c):
        count += table[i][j]
    res = max(res, count)
print(res)

Measured memory_bytes: 26800
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int maxresult = 0;
        int kari = 0;
        for(int i = 0;i < s.length();i++){
            char a = s.charAt(i);
            if(a=='A'||a=='C'||a=='G'||a=='T'){
                kari += 1;
            }else{
                if(kari>maxresult){
                    maxresult = kari;
                    kari = 0;
                }
            }
        }
        if(kari>maxresult){
            maxresult = kari;
            kari = 0;
        }
        System.out.println(maxresult);
        sc.close();
    }
}

Measured memory_bytes: 20948
#include<bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#define all(arr) arr.begin(), arr.end()
#define va vector<long long int> a 
#define vb vector<long long int> b
#define debug() for(ll l=0;l<50;l++){}
const ll M = 1e9+7;
const ll inf = 1e18+5;
const ll val = 10000020;
const ll INF=INT_MAX;
using namespace std;
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
ll bs(ll arr[], ll l, ll r, ll x){
	ll mid=0;
    if (r >= l){
		if (arr[mid] == x) return mid; 
        if (arr[mid] > x) return bs(arr, l, mid - 1, x); 
        return bs(arr, mid + 1, r, x); 
    }
    return -1;
}
ll cs(vector<ll> &a,ll x){
	return upper_bound(all(a),x)-a.begin();
}
ll power(ll x,ul y,ll p){
	ll res = 1;
	x = x % p;
	if(x == 0) return 0;
	while (y > 0){
		if (y & 1) res = (res*x) % p;
		y = y>>1;
		x = (x*x) % p;
		}
	return res;
}
ll arr[500000],st[500000];
void buildtree(int si,int ss,int se){
	if(ss==se){
		st[si]=arr[ss];
		return;
	}
	int mid=ss+(se-ss)/2;
	buildtree(2*si,ss,mid);
	buildtree(2*si+1,mid+1,se);
	st[si]=min(st[2*si],st[2*si+1]);
}
int query(int si,int ss,int se,int qs,int qe){
	if(qs>se || qe<ss) //completely outside
		return INF;
	if(ss>=qs && se<=qe)
		return st[si];
	int mid=ss+(se-ss)/2;
	int l=query(2*si,ss,mid,qs,qe);
	int r=query(2*si+1,mid+1,se,qs,qe);
	return min(l,r);
}
void update(int si,int ss,int se,int qi){
	if(ss==se){
		st[si]=arr[ss];
		return;
	}
	int mid=ss+(se-ss)/2;
	if(qi<=mid) update(2*si,ss,mid,qi);
	else update(2*si+1,mid+1,se,qi);
	st[si]=min(st[2*si],st[2*si+1]);
}
ll mm(ll a,ll b,ll mod){ 
    ll res = 0;
    a %= mod; 
    while(b){
        if (b & 1) res = (res + a) % mod; 
        a = (2 * a) % mod; 
        b >>= 1; // b = b / 2 
    } 
    return res; 
} 

void DFS_ITR(vector<vector<ll>>& adj,ll src,vector<ll>& a,vector<ll>& f,vector<ll>& d,ll day,vector<bool>& visited){
	vector<ll>s;
    s.push_back(src);
    vector<ll>s2;
    visited[src]=true;
    while(s.size()>0){
		ll u=s[s.size()-1];
        s.pop_back();
        for(auto c:adj[u]){
            if(!visited[c]){
                ll eat=min(a[src-1],f[c-1]);
                f[c-1]-=eat;
                if(f[c-1]==0 && d[c]==-1) d[c]=day;
                s.push_back(c);
                s2.push_back(c);
                visited[c]=true;
			}
		}
	}
    for(auto i:s2) visited[i]=false;
}
ll nCr(ll n, ll r){
    return (n*(n-1)*(n-2))/6;
}

void solve(){
	ll n,k,t;
	cin>>n>>k>>t;
	if(n%k==0) cout<<(n/k)*t<<"\n";
	else cout<<(n/k +1)*t<<"\n";
}
int main(){
	fast;
	ll t=1;
	//cin>>t;
	while(t--)
		solve();
	return 0;
}



Measured memory_bytes: 3656
#include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a)=max(a, b)
#define chmin(a, b) (a)=min(a, b)
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;

/*
 for(i=0; i<N; i++)
   cin >> a[i];
*/



int main(void) {
  ll i, j, k;
  
  ll N, M, Q;
  cin >> N >> M >> Q;
  
  ll a[55], b[55], c[55], d[55];
  
  for(i=0; i<Q; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  
  
  ll ans=0;
  for(ll S=0; S<1<<M; S++) {
    
    vector<ll> va;
    for(i=0; i<M; i++) {
      if(S>>i&1) va.push_back(i);
    }
    
    
    for(ll T=0; T<1<<(N-1); T++) {
      
      vector<ll> vp;
      vp.push_back(-1);
      for(i=0; i<N-1; i++) {
        if(T>>i&1) vp.push_back(i);
      }
      vp.push_back(N-1);
      
      
      if(vp.size()!=va.size()+1) continue;
      
      ll u[11]={};
      for(i=0; i<vp.size()-1; i++) {
        for(j=vp[i]+1; j<=vp[i+1]; j++) {
          u[j]=va[i];
        }
      }
      
      
      ll t=0;
      for(i=0; i<Q; i++) {
        ll l=a[i]-1;
        ll r=b[i]-1;
        if(u[r]-u[l]==c[i]) t+=d[i];
      }
      
      chmax(ans, t);
      
    }
    
    
  }
    
  
  
  pt(ans);
  
  
  
}
 
 


Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<vector<ll>> Matrix;

const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<ll>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};

vector<ll> A;
// vectorのリサイズ
// A.resize(N);

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

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

  ll n;
  cin >> n;
  int hoge = n % 10;
  string ans;
  if (hoge == 0 || hoge == 1 || hoge == 6 || hoge == 8) ans = "pon";
  else if (hoge == 2 || hoge == 4 || hoge == 5 || hoge == 7 || hoge == 9) ans = "hon";
  else ans = "bon"; 
  cout << ans << endl; 
  return 0;
}


Measured memory_bytes: 3652
#include <stdio.h>

int main(void)
{
	int n, x, t;

	scanf("%d %d %d", &n, &x, &t);
	int a = x;
	for (int i = t;; i += t)
	{
		if (a >= n)
		{
			printf("%d\n", i);
			break;
		}
		a += x;
	}
}

Measured memory_bytes: 1736