akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main()
{
	int x, a, b;
	cin >> x >> a >> b;
	if (a >= b) {
		cout << "delicious" << endl;
	}
	else if(x + a >= b) {
		cout << "safe" << endl;
	}
	else {
		cout << "dangerous" << endl;
	}
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;
P b[100010];
int main() {
	int n, m;
	cin >> n >> m;
	int x,y;
	rep(i,m) {
		cin >> x >> y;
		b[i] = {y,x};
	}

	sort(b,b+m);
	int r = b[0].first; 
	int ans = 0;
	rep(i,m) {
		while (b[i].second < r && i < m) i++;
		if (i == m-1) i--;
		ans++;
		r = b[i].first;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4352
//go:generate echo "https://atcoder.jp/contests/dp/tasks/dp_c"
package main

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

type scanner struct{ *bufio.Scanner }

func newScanner(r io.Reader) *scanner {
	s := bufio.NewScanner(r)
	s.Split(bufio.ScanWords)
	s.Buffer(nil, 100000000)
	return &scanner{s}
}

func (s *scanner) Int() int {
	s.Scan()
	n, _ := strconv.Atoi(s.Text())
	return n
}

func (s *scanner) IntSlice(l int) []int {
	if l == 0 {
		return []int{}
	}
	sl := make([]int, l, l)
	for i := range sl {
		sl[i] = s.Int()
	}
	return sl
}

func (s *scanner) IntSlice2(l, n int) []int {
	if l == 0 {
		return []int{}
	}
	sl := make([]int, l, l)
	for i := 0; i < n; i++ {
		sl[i] = s.Int()
	}
	return sl
}

func solve(n int, u [][]int) int {
	t := make([][]int, n+1, n+1)
	for i := range t {
		t[i] = make([]int, 3, 3)
	}
	for i := 0; i < n; i++ {
		for j := 0; j < 3; j++ {
			for k := 0; k < 3; k++ {
				if j == k {
					continue
				}
				if v := t[i][j] + u[i][k]; t[i+1][k] < v {
					t[i+1][k] = v
				}
			}
		}
	}
	max := math.MinInt64
	for _, v := range t[n] {
		if max < v {
			max = v
		}
	}
	return max
}

func main() {
	scan := newScanner(os.Stdin)
	n := scan.Int()
	u := make([][]int, n+1, n+1)
	for i := 0; i <= n; i++ {
		u[i] = []int{scan.Int(), scan.Int(), scan.Int()}
	}
	fmt.Println(solve(n, u))
}


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

int main(int argc, char const *argv[])
{
  int a, b, c;
  cin >> a >> b >> c;
  if(b-a == c-b)
    cout << "YES" << flush;
  else
    cout << "NO" << flush;
  return 0;
}


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    ll maxi = 0;
    rep(i, N) {
        cin >> A[i];
        maxi = max(maxi, A[i]);
    }
    ll l = 1, r = maxi;
    do {
        ll key = (l + r) / 2;
        ll temp = 0;
        iter(i, A) temp += i / key + !!(i % key) - 1;
        if(temp <= K) r = key - 1;
        else l = key + 1;
    } while(l <= r);
    cout << l << endl;
    return 0;
}


Measured memory_bytes: 4840
#include <bits/stdc++.h>  
using namespace std;  
#define INF 0x3f3f3f3f  
typedef long long ll;  
const int N =  200005;  
#define FI first
#define SE second
typedef pair<int, int>pii;
int mod = 1000000007;
int num[55];
ll C[55][55];
int main()  
{  

   // ios::sync_with_stdio(0);
   for (int i = 0; i <= 50; i++)
   {
      C[i][i] = 1;
      C[i][0] = 1;
      for (int j = 1; j <= i; j++)
         C[i][j] = C[i-1][j-1] + C[i-1][j];
   }

   int n, m;
   while (~scanf("%d%d", &n, &m))
   {
      int odd = 0, even;
      ll ans = 0;
      for (int i = 0; i < n; i++)
      {
         scanf("%d", num + i);
         odd += num[i]&1;
      }

      even = n - odd;
      if (m)
      {
         for (int i = 1; i <= odd; i += 2)
            for (int j = 0; j <= even; j++)
            {
               ans += C[odd][i]*C[even][j];
            }
      }else
      {
         for (int i = 0; i <= odd; i += 2)
            for (int j = 0; j <= even; j++)
            {
               ans += C[odd][i]*C[even][j];
            }
      }
      cout<<ans<<endl;
   }


   return 0;
}  

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

# define REP(i,n) for (int i=0;i<(n);++i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long int ll;
typedef pair<ll,ll> P_ii;
typedef pair<double,double> P_dd;

const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

// a^b mod M
long myPow(long a,long b,int M) {
    long ret = 1;
    long tmp = a;
    while(b>0) {
        if((b&1)==1) ret = (ret * tmp) % M;
        tmp = (tmp * tmp) % M;
        b = b>>1;
    }
    return ret;
}

 // nCk mod M
int nCk(int n,int k,int M) {
    long ret = 1;
    int mi = min(k, n-k);
    for(int i=1;i<=mi;i++) {
        ret = (ret * myPow(i,M-2,M)) % M;
    }
    for(int i=n-mi+1;i<=n;i++) {
        ret = (ret * i) % M;
    }
    return (int)ret;
};

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}


int main() {
    ll N, K;
    cin >> N >> K;

    vector<ll> A(N), B(N), C;
    REP(i, N){
        cin >> A[i];
        B[i] = A[i];
    }
    sort(all(B));

    ll ans = 0;
    for(int i = N -1; i >= 0; i--) {
        C.push_back(A[i]);
        sort(all(C));

        ll tmp1 = (ll)(lower_bound(all(C), A[i]) - C.begin());
        mulM(tmp1, K);
        addM(ans, tmp1);

        ll tmp2 = (ll)(lower_bound(all(B), A[i]) - B.begin());
        mulM(tmp2, K * (K - 1) / 2);

        addM(ans, tmp2);

//        cout << A[i] << ":" << tmp1 << ":" << tmp2 << endl;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)

ans = 0
n.times do |i|
  if a[i] >= b[i]
    ans += b[i]
  else
    ans += a[i]
    e = b[i] - a[i]
    if e >= a[i+1]
      ans += a[i+1]
      a[i+1] = 0
    else
      ans += e
      a[i+1] -= e
    end
  end
end
p ans


Measured memory_bytes: 17572
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
int ceil(int a, int b) {
    return (a + b - 1) / b;
}
int round(int a, int b) {
    return (a + b / 2) / b;
}
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);
}
template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    ll a, b, x;
    cin >> a >> b >> x;
    ll res = b / x - a / x;
    if (a % x == 0) {
        res++;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10000)
dx = [1, -1, 0, 0, 1, 1, -1, -1]
dy = [0, 0, 1, -1, 1, -1, 1, -1]


def dfs(y, x):
    if x < 0 or w <= x:
        return
    if y < 0 or h <= y:
        return
    if V[y][x]:
        return
    if C[y][x] == 0:
        return

    V[y][x] = True
    for i in range(8):
        dfs(y + dy[i], x + dx[i])


while True:
    w, h = map(int, input().split())
    if w == h == 0:
        break
    C = [list(map(int, input().split())) for _ in range(h)]
    V = [[False]*w for _ in range(h)]
    ans = 0
    for y in range(h):
        for x in range(w):
            if C[y][x] == 0:
                continue
            if V[y][x]:
                continue
            dfs(y, x)
            ans += 1
    print(ans)



Measured memory_bytes: 7984
#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define mt make_tuple
#define INF 2000000000
#define INFL 1000000000000000000LL
#define EPS 1e-9
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef pair<int, pair<int, int> > Edge;
typedef vector<Edge> vE;
typedef priority_queue<Edge, vector<Edge>, greater<Edge> > pqlE;

int main() {
	vi num(180);
	rep(i, 180) {
		num[i] = (i + 1)*(i + 2)*(i + 3) / 6;
	}
	int N = 1000001;
	vi ans1(N), ans2(N);
	rep(i, N) {
		ans1[i] = ans2[i] = i;
	}
	
	repl(i, 1, 180) {
		repl(j, num[i], N) {
			ans1[j] = min(ans1[j], ans1[j - num[i]] + 1);
		}
	}
	repl(i, 1, 180 / 4) {
		repl(j, num[4 * i], N) {
			ans2[j] = min(ans2[j], ans2[j - num[4 * i]] + 1);
		}

	}

	while (true) {
		int n;
		cin >> n;
		if (n == 0)break;
		cout << ans1[n] << " " << ans2[n] << endl;
	}


	return 0;
}

Measured memory_bytes: 10536
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
char s[MAXN]; int t[MAXN], f[MAXN];
int main() {
	scanf("%s", s + 1);
	int n = strlen(s + 1);
	int tot = 0, cnt[2] = {0, 0}; ll ans = 0;
	for (int i = 1; i <= n; i++)
		tot += s[i] == '0';
	for (int i = 1; i <= n; i++)
		if (s[i] == '0') cnt[0]++;
		else {
			if (s[i + 1] == '1') {
				ans += tot + 1, i++;
				cnt[1] += 2;
			} else {
				cnt[1] += 1;
				ans += i % 2;
				ans += tot - cnt[0];
				if (i % 2) ans += cnt[0] / 2;
				else ans += (cnt[0] + 1) / 2;
			}
		}
	for (int i = 1; i <= cnt[1] - 1; i++)
		ans += (i + 1) / 2;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3928
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin>>n;
	ll a[n];
	ll f[n+1] = {0};
	for(int i=1;i<n;i++){
		cin>>a[i];
		f[a[i]] += 1;
	}
	for(int i=1;i<=n;i++){
		cout<<f[i]<<"\n";
	}	
}

Measured memory_bytes: 6780
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int n, y;
	cin >> n >> y;

	int num1, num2, num3, sum;
	for (int i = 0; i <= y / 10000; i++) {
		for (int j = 0; j <= y / 5000; j++) {
			num3 = (y - i * 10000 - j * 5000) / 1000;
			sum = i + j + num3;
			if (sum == n && num3 >= 0) {
				num1 = i;
				num2 = j;
				break;
			}
		}
		if (sum == n && num3 >= 0) break;
	}

	if (sum == n && num3 >= 0) cout << num1 << " " << num2 << " " << (y - num1 * 10000 - num2 * 5000) / 1000 << endl;
	else cout << -1 << " " << -1 << " " << -1 << endl;

 	return 0;
 }

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"

using namespace std;
using namespace __gnu_pbds;


#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(),a.end()

typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)

int main(void)
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll ans = max({a*c, a*d, b*c, b*d});
    cout << ans << "\n";
}

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

int main() {
   ll n;
   cin>>n;
   unordered_map<ll,ll>m;
   for(int i=0;i<n;i++){
       ll x;
       cin>>x;
       m[x]++;
   }
   
   ll ans=0;
   for(auto it=m.begin();it!=m.end();it++){
       if((it->first)<=(it->second)){
           ans+=((it->second) - (it->first));
       }
       else{
           ans+=(it->second);
       }
   }
   cout<<ans<<endl;
   return 0;
}

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

#define INF 100000000
#define ABS(a) (a<0?-(a):a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define REP(i,a) for(int i=0;i<a;i++) 

using namespace std;
int main(){
  string S;
  cin >> S;
  int po[26];
  REP(i, 26){
    po[i] = 0;
  }
  REP(i, S.length()){
    if(po[S[i]-'a'] == 1){
      cout << "no"<<endl;
      return 0;
    }
    po[S[i] - 'a'] = 1;
  }
  cout << "yes" << endl;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 100000000000
#define int long long
int h[100010];
int N, A, B;
bool isOk(int num) {
    int H[100010];
    int cnt = 0;
    rep(i, N) {
        cnt += max(0LL, (h[i] - B * num) + A - B - 1)/(A - B);
    }
    return cnt <= num;
}

int binary_search() {
    int ok = INF;
    int ng = 0;
    while(abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;
        if (isOk(mid)) ok = mid;
        else ng = mid;
    }
    return ok;
}

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

    cin >> N >> A >> B;
    rep(i, N) cin >> h[i];
    cout << binary_search() << endl;

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
/* clang-format on */

int main() {
  string s;
  cin >> s;
  ll ttl = 0;
  REP(i, s.size()) { ll t = s[i] - '0';
    ttl += t;
  }
  if (ttl % 9 == 0) cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}


Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()

int main() { cin.tie(0); ios::sync_with_stdio(false);
    int N = in, W = in;
    vector<lint> dp( W+1, 0 );
    rep( i, N ) {
        int w = in, v = in;
        for( int j=W; j>=w; j-- ) {
            dp[j] = max( dp[j], dp[j-w]+v );
        }
    }
    cout << dp[W] << "\n";
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

// mt19937 gen_rand_int(chrono::steady_clock::now().time_since_epoch().count());
// mt19937_64 gen_rand_ll(chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

long long power(long long a, long long b,long long m) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a %m;
        a = a * a %m;
        b >>= 1;
    }
    return res;
}

set<pair<int,int> >mm[100005];
int vis[100005][2];
vector<vector<pair<int,int> >>adj;
void dfs(int ver,int x,int y,int par)
{
    vis[ver][par]=1;
    mm[ver].insert({x,y});
    for(auto i:adj[ver])
    {
        if(!vis[i.first][!par])
            dfs(i.first,i.second-x,-y,!par);
        else
        {
            mm[i.first].insert({i.second-x,-y});
        }        
    }
}

int mn=1,mx=1e9;

void ganza(pair<int,int>p)
{
    if(p.second>0)
    {
        mn=max(mn,-p.first+1);
    }
    else
    {
        mx=min(mx,p.first-1);
    }            
}

signed main()
{

ios_base::sync_with_stdio(false);
cin.tie(NULL);  
cout.tie(0);   

#ifndef ONLINE_JUDGE
    if(fopen("INPUT.txt","r"))
    {
    freopen ("INPUT.txt" , "r" , stdin);
    freopen ("OUTPUT.txt" , "w" , stdout);
    }
#endif  

    int n,m;
    cin>>n>>m;
    adj.resize(n+1);
    int x,y,z;
    for(int i=0;i<m;i++)
    {
        cin>>x>>y>>z;
        adj[x].push_back({y,z});
        adj[y].push_back({x,z});
    }

    dfs(1,0,1,0);
    int ind=-1e17;
    for(int i=1;i<=n;i++)
    {
        if(mm[i].size()>2)
        {
            cout<<0;
            return 0;
        }
        else if(mm[i].size()==2)
        {
            auto j=mm[i].begin();
            pair<int,int>x=*j;
            j++;
            pair<int,int>y=*j;
            if(x.second==y.second)
            {
                cout<<0;
                return 0;
            }
            if(x.second<0)
                swap(x,y);
            int z=y.first-x.first;
            if(z<=0)
            {
                cout<<0;
                return 0;
            }
            else if(z&1)
            {
                cout<<0;
                return 0;
            }
            else
            {
                ind=z/2;
            }            
            ganza(x);
            ganza(y);
        }
        else
            ganza(*mm[i].begin());
    }
    
    if(ind==-1e17)
    {
        cout<<max(0LL,mx-mn+1);
    }
    else
    {
        if(ind>=mn && ind<=mx)
        {
            cout<<1;
        }
        else
        {
            cout<<0;
        }
        
    }
    

} 
    


Measured memory_bytes: 44532
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define ld long double
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

void print(Vl vec){
    rep(i, 0, sz(vec)){
        if(i) cout << " ";
        cout << vec[i];
    }
    coel;
}

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

// デバッグを消し忘れるな！！！

int main() {
    ll x; cin >> x;
    if(x == 3 || x == 5 || x == 7) co("YES");
    else co("NO");

    return 0;
}


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

int main() {
  int N;
  string color = "Three";

  cin >> N;
    
  for ( int i = 0 ; i < N ; i ++ ) {
    string S;
    cin >> S;
    
    if ( S == "Y" ) {
      color = "Four";
    }
  }
  cout << color << endl;
}
    


Measured memory_bytes: 256
K = int(input())

if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

res = -1
count = 0
ai = 0
while(True):
    ai = (ai*10 + 7) % K
    count += 1
    if(ai == 0):
        res = count
        break

print(res)


Measured memory_bytes: 8932
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<class T> void re(T& x) { cin >> x; }
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "/home/o_o/MyCodes/pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  


void solve(){
	int n; re(n);
	vi nod(n+1);
	for(int i = 1 ; i <= n ; ++i ){
		for(int j = i ; j<=n ; j+=i) nod[j]++;
	}
	int ans = 0 ; for(int i = 1 ; i <= n ;++i) ans+=(i*nod[i]);
	cout << ans << endl; 
}


signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 81336
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 1)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int moder) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%moder;
		x = x * x%moder;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	if (x == y)return 1;
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int n, a[200010];
bool bl[200010];
vector<int> ans;

signed main(){
	cin >> n;
	rep(i, n)cin >> a[i];
	for (int i = n; i > 0; i--) {
		int cnt = 0;
		for (int j = i * 2; j <= n; j += i) {
			if (bl[j])cnt++;
		}
		if (cnt % 2 != a[i - 1]) {
			ans.push_back(i);
			bl[i] = true;
		}
	}
	cout << ans.size() << endl;
	rep(i, ans.size()) {
		if (i != ans.size() - 1)cout << ans[i] << " ";
		else cout << ans[i] << endl;
	}
}


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

using namespace std;

int main()
{
  bool isPrime[1000001];
  for(int i = 0; i <= 1000000; i++) isPrime[i] = true;
  isPrime[0] = isPrime[1] = false;
  for(int i = 2; i <= 1000000; i++){
    if(isPrime[i]){
      for(int j = i+i; j <= 1000000; j += i) isPrime[j] = false;
    }
  }

  int N, P;
  while(cin >> N >> P, N != -1 || P != -1){
    int prime[100];
    for(int i = N + 1, j = 0; j < 100; i++){
      if(isPrime[i]) prime[j] = i, j++;
    }
    int matsu[10000];
    int idx = 0;
    for(int i = 0; i < 100; i++){
      for(int j = i; j < 100; j++){
	matsu[idx] = prime[i]+prime[j], idx++;
      }
    }
    sort(matsu, matsu + idx);
    cout << matsu[P-1] << endl;
  }
  return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)

ll N, K;

ll solve() {
    return min(N%K, K-N%K);
}

int main() {
    cin >> N >> K;
    cout << solve() << endl;
}

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

long long n, m ;

char a[100010], b[100010] ;

int main(){
	#define NAME "a"
	//freopen( NAME".inp" , "r" , stdin ) ; freopen( NAME".out" , "w" , stdout ) ;

	scanf("%lld %lld", &m, &n) ;

	scanf("%s", a + 1) ; scanf("%s", b + 1) ;

	long long res = 1ll * m * n / __gcd(m, n) ;	

	long long foo = res / m, bar = res / n ;

	long long magic = foo * bar / __gcd(foo, bar) ;

	foo = magic / foo ; bar = magic / bar ;

	for (int i = 0;; ++ i){
		if(foo * i + 1 > m) break ;
		if(a[foo * i + 1] != b[bar * i + 1]) return printf("-1"), 0 ;
	}

	printf("%lld", res) ;

	return 0 ;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <climits>
#include <set>
#include <map>
#include <stack>
#include <iomanip>
#include <tuple>
#define ll long long
using namespace std;
/*階乗*/
ll factorial(ll n){
    if(n==0){
        return 1;
    }
    else{
        return n*factorial(n-1);
    }
}

/* ユークリッドの互除法 最大公約数*/
/*ll gcd(ll a, ll b) {
	ll r;
	r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
*/


/*最小公倍数*/
/*
ll lcm(ll a,ll b){
	return a/gcd(a,b)*b;
}
*/

/*二点間の距離*/
double dist(pair<double,double> a,pair<double,double> b){
	return sqrt(pow((a.first - b.first) ,2) + pow((a.second - b.second),2));
}

//繰り返し自乗法
double ism(double aa,ll p){
    double ap=aa;
    double ans=1;
    while(p>0){
        //cout<<"p="<<p<<",ap="<<ap<<endl;
        if(p&1){//奇数が真
            ans*=ap;
        }
        p/=2;
        ap=ap*ap;
    }
    return ans;

}
//繰り返し自乗法(アマリトリバージョン)
ll ismm(ll aa,ll p,ll m){
    ll ap=aa;
    ll ans=1;
    while(p>0){
        //cout<<"p="<<p<<",ap="<<ap<<endl;
        if(p&1){//奇数が真
            ans=(ans*ap)%m;    
        }
        p/=2;              
        ap=(ap*ap)%m;
    }
    return ans;

}
/*
ll solve(ll i,ll m,vector<ll>t,ll n){
    if(m==0){
        return 1;
    }
    if(i>=n){
        return 0;
    }
    
    
    cout<<i+1<<" "<<m<<endl;
    cout<<i+1<<" "<<m-t[i]<<endl;
    ll res=solve(i+1,m,t,n)||solve(i+1,m-t[i],t,n);
    return res;
}
*/

//小数点12桁
struct all_init
{
    all_init()
    {
        cout << fixed << setprecision(12);
    }
} All_init;


int main()
{
    ll a,b,c;
    cin>>a>>b>>c;
    cout<<a*b/2<<endl;
    

    

}

Measured memory_bytes: 256
// B - Contest with Drinks Easy
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ote(x) cout<<(x)<<endl

int main(){
	int N; cin>>N;
	vi T(N+1);
	int all = 0;
	up(i,1,N+1,1){
		cin>>T[i];
		all += T[i];
	}

	int M; cin>>M;
	up(i,1,M+1,1){
		int p,x; cin>>p>>x;
		ote(all-T[p]+x);
	}
}

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

#define INF 1e9
#define PI 3.141592653589793238
typedef long long ll;

int main() {
    string s; cin>>s;
    ll sum=0;
    for(int i=0; i<s.size(); i++) sum += s[i]-'0';
    if(sum%9==0) puts("Yes");
    else puts("No");


    return 0;
}

Measured memory_bytes: 3740
#include<cstdio>
#include<vector>
#include<queue>
#include<iostream>
using namespace std;
int n, e; vector<int> G[10005];
int visited[10005], indeg[10005];

void bfs(int i)
{
  queue<int> Q;
  Q.push(i);
  visited[i] = 0;
  while(!Q.empty())
  {
    int u = Q.front(); Q.pop();
    printf("%d\n", u);
    for(int i=0; i<G[u].size(); i++)
    {
      int v = G[u][i];
      indeg[v]--;
      if(indeg[v] == 0 && visited[v] == 0)
      {
        Q.push(v); visited[v] = 1;
      }
    }
  }
}
void TopoSort()
{
  for(int i=0; i<n; i++)
  {
    if(visited[i] == 0 && indeg[i] == 0)
      bfs(i);
  }
}
int main()
{
  scanf("%d%d", &n, &e);
  for(int i=0; i<n; i++)
  {
    visited[i] = indeg[i] = 0;
  }
  int s, t;
  for(int i=0; i<e; i++)
  {
    scanf("%d%d", &s, &t);
    G[s].push_back(t);
    indeg[t]++;
  }
  TopoSort();

  return 0;
}



Measured memory_bytes: 3920
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;

const ll MOD=1000000007;

int main(){
  int i,j,k,l;ll cnt=0;
  ll n;
  cin>>n;
  ll a[n];
  for(i=0;i<n;i++)cin>>a[i];
  ll p[61];
  for(i=0;i<61;i++)p[i]=0;
  for(i=0;i<n;i++){
    for(j=0;j<61;j++){
      if((a[i]/(ll)round(pow(2,j)))%2==1)p[j]++;
    }
  }
  for(i=0;i<n;i++)a[i]=a[i]%MOD;
  ll sum=0;
  for(i=0;i<n;i++)sum=(sum+a[i])%MOD;
  sum=(2*n*sum)%MOD;
  ll q[61];
  for(i=0;i<61;i++){
    q[i]=p[i]*p[i];
    for(j=0;j<i+1;j++){
      q[i]=(2*q[i])%MOD;
    }
  }
  for(i=0;i<61;i++){
    sum=sum-q[i];
    if(sum<0)sum=(sum+MOD)%MOD;
  }
  if(sum%2==0)cout<<sum/2;
  else cout<<((sum+MOD)/2)%MOD;
}

Measured memory_bytes: 2560
#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // dequef
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define all(a) (a).begin(), (a).end()
#define mod 1000000007
using ll = long long;
using namespace std;
struct UnionFind {
  vi d;
  UnionFind(int n): d(n,-1) {}
  int root(int x) {
    if (d[x] < 0) return x;
    return d[x] = root(d[x]);
  }
  bool unite(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y){
    return root(x) == root(y);
  }
  int size(int x){
    return -d[root(x)];
  }
};
int main(){
  int n,q;
  cin >> n >> q;
  UnionFind tree(n);
  rep(i, q){
    int t,u,v;
    cin >> t >> u >> v;
    if(!t) tree.unite(u, v);
    else cout << tree.same(u, v) << endl;
  }
}

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

long long solve()
{
    long long N;
    cin>>N;
    long long last = 1;
    long long root = sqrt(N)+1;
    for(long long i=root; i>1; i--){
        if(N%i==0){
            last = i;
            break;
        }
    }
    return last+N/last-2;
}
int main()
{
    // int test;
    // cin>>test;
    // for(int t=1; t<=test; t++)
        cout << solve() << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <sstream>
#include <algorithm>
#define abs(a,b) a<b?b-a:a-b
using namespace std;
long long a,b,c,d,e,m,n,ma,le,ri,mid,p[1080130],q[5],r[105],i,t;
string s[5];
char k;
int su(int a)
{int i;
	if(a==1||a==0)return 0;
	for(i=2;i<=a;i++)
	{
		if(a-i>0&&(a-i)%2==0&&i%2==0)return 1;
	}
	return 0;
}
int main() 
{long long to=0;
	for(i=0;i<3;i++)
    cin>>q[i];
    sort(q,q+3);
	if(q[0]-q[1]==q[1]-q[2])cout<<"YES";
	else cout<<"NO";    
    return 0;
}

Measured memory_bytes: 256
inpl = lambda: list(map(int,input().split()))
N = int(input())
A = inpl()
B = inpl()
ans = 0
for i in range(N):
    p = min(A[i],B[i])
    B[i] -= p
    q = min(B[i],A[i+1])
    A[i+1] -= q
    ans += p + q
print(ans)

Measured memory_bytes: 18624
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
typedef complex<double> Point;
typedef vector<Point> VP;
#define X real()
#define Y imag()
const double EPS = 1e-9;
#define EQ(n,m) (abs((n)-(m)) < EPS)

double dot(Point a, Point b) {
  return a.X*b.X + a.Y*b.Y;
}

double cross(Point a, Point b) {
  return a.X*b.Y - a.Y*b.X;
}

int ccw(Point a, Point b, Point c) {
  b -= a;  c -= a;
  if (cross(b,c) >  EPS) return +1;  // counter clockwise
  if (cross(b,c) < -EPS) return -1;  // clockwise
  if (dot(b,c)   < -EPS) return +2;  // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line or a==b
  return 0;                          // a--c--b on line or a==c or b==c
}

bool isecSP(Point a1, Point a2, Point b) {
  return !ccw(a1, a2, b);
}

Point proj(Point a1, Point a2, Point p) {
  return a1 + dot(a2-a1, p-a1)/norm(a2-a1) * (a2-a1);
}

VP crosspointSC(Point a1, Point a2, Point c, double r) {
  VP ps;
  Point ft = proj(a1, a2, c);
  if (r*r < norm(ft-c)) return ps;
  Point dir = sqrt(max(r*r - norm(ft-c), 0.0)) / abs(a2-a1) * (a2-a1);
  if(isecSP(a1,a2,ft+dir)) ps.push_back(ft+dir);
  if (!EQ(r*r, norm(ft-c)) && isecSP(a1,a2,ft-dir))
    ps.push_back(ft-dir);
  return ps;
}

// a??????b???????????¢?§??????????(0,0)???[-pi,+pi]
double angle(Point a,Point b){
    double t = arg(b)-arg(a);
    while(t>+M_PI) t-=2*M_PI;
    while(t<-M_PI) t+=2*M_PI;
    return t;
}


int main(void){
    int n;
    double r,x,y;
    cin>>n>>r;
    VP ps(n);
    rep(i,n){
        cin>>x>>y;
        ps[i] = Point(x,y);
    }

    double area=0;
    rep(i,n){
        Point p=ps[i], q=ps[(i+1)%n];
        VP cp = crosspointSC(p,q,Point(0,0),r);
        if(abs(p)<r && abs(q)<r){
            assert(cp.size()==0);
            area += cross(p,q)/2;
        }
        else if(abs(p)<r && abs(q)>=r){
            assert(cp.size()==1);
            area += cross(p,cp[0])/2;
            area += r*r*angle(cp[0],q)/2;
        }
        else if(abs(p)>=r && abs(q)<r){
            assert(cp.size()==1);
            area += r*r*angle(p,cp[0])/2;
            area += cross(cp[0],q)/2;
        }
        // abs(p)>=r && abs(q)>=r
        else if(cp.size()==2){
            if(abs(p-cp[0])>abs(p-cp[1])) swap(cp[0],cp[1]);
            area += r*r*angle(p,cp[0])/2;
            area += cross(cp[0],cp[1])/2;
            area += r*r*angle(cp[1],q)/2;
        }
        else area += r*r*angle(p,q)/2;
    }
    printf("%.10f\n",area);

    return 0;
}

Measured memory_bytes: 3504
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//--<for debugging>
#define whatis(x) cout << #x << " is " << x<<" ";
#define whatisl(x) cout << #x << " is " << x<<"\n";
#define parr(array,end)for(ll loop=0;loop<end;loop++)cout<<array[loop]<<" ";cout<<"\n";
#define lline cout<<"\n";
#define errorl(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout<<"\n";}
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout<<"___";}
    
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a <<" , ";
    err(++it, args...);
}
//--</for debugging> 
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define testcase ll tt; cin >> tt; while(tt--)
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define vars ll h,i,j,k,d,l,p,q,r,x,y,a,b,c,v,var,n,m,z,s,ans,ind1,ind2,flag,limit1,limit2,limit3,mod;
#define vll vector<ll>
#define pll pair<ll,ll>
#define sll set<ll>
#define pint pair<int,int>
const ll INF=1e9+7;
const ll MOD=1e9+7;
int main()
{
    boost vars
    string aa,bb;
    cin>>aa>>aa>>bb;
    cout<<"A"<<aa[0]<<"C";
}

Measured memory_bytes: 256
#  --*-coding:utf-8-*--

X = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

K = int(input())
print(X[K-1])


Measured memory_bytes: 2940
from itertools import chain, count, takewhile

x = int(input())

if x > 1:
  ps = takewhile(lambda p: 2**p <= x, count(2))
  bps = (takewhile(lambda y:y <= x, (b**p for b in count(1))) for p in ps)
  print(max(chain.from_iterable(bps)))
else:
  print(1)

Measured memory_bytes: 3060
#include<iostream>

using namespace std;

char s[100001],rev[100001];
int num = 0;
bool same = true, skip = false;

int main(){
	cin >> s;

	while (s[num] != NULL){
		num++;
	}

	for (int i = 0; i < num; i++){
		rev[i] = s[num - i - 1];

		skip = false;

		switch (rev[i]){
		case 'b':
			if (!skip){
				rev[i] = 'd';
			}
			skip = true;
			break;

		case 'd':
			if (!skip){
				rev[i] = 'b';
			}
			skip = true;
			break;

		case 'p':
			if (!skip){
				rev[i] = 'q';
			}
			skip = true;
			break;

		case 'q':
			if (!skip){
				rev[i] = 'p';
			}
			skip = true;
			break;
		}
	}

	for (int i = 0; i < num; i++){
		if (s[i] != rev[i]){
			same = false;
			break;
		}
	}

	if (same){
		cout << "Yes" << "\n";
	}
	else{
		cout << "No" << "\n";
	}

	return 0;
}

Measured memory_bytes: 512
n = int(input())
A = list(map(int, input().split()))
X = [0] * n
X[0] = sum(A) - 2 * sum(A[1::2])
for i in range(1, n):
    X[i] = 2 * A[i - 1] - X[i - 1]
print(*X)

Measured memory_bytes: 14092
package main

import "fmt"

func main() {
	var a, b, c, d int
	fmt.Scan(&a, &b, &c, &d)
	ans := 0
	if a <= c && d <= b {
		ans = d - c
	} else if c <= a && b <= d {
		ans = b - a
	} else if c <= a && a <= d {
		ans = d - a
	} else if a <= c && c <= b {
		ans = b - c
	}
	fmt.Println(ans)
}


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

#define ll long long
#define ld long double
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    cin >> n;
    ll a[n+1];
    ll b[n+1];
    ll c[n+1];
    for (ll i = 1; i <= n; i++){
        cin >> a[i];
    }

    for (ll i = 1; i <= n; i++){
        cin >> b[i];
    }

    for (ll i = 1; i <= n; i++){
        cin >> c[i];
    }
    sort(a+1,a+n+1);
    sort(b+1,b+n+1);
    sort(c+1,c+n+1);
    ll dp1[n+1];
    for (ll i = 1; i <= n; i++){
        dp1[i] = 0;
    }
    ll it = n;
    while (c[it] > b[n] && it > 0){
        it--;
        dp1[n]++;
    }
    for (ll i = n-1; i >= 1; i--){
        dp1[i] += dp1[i+1];
        if (it > 0)
        while (c[it] > b[i] && it > 0){
            it--;
            dp1[i]++;
        }
    }

    ll dp2[n+1];
    for (ll i = 1; i <= n; i++){
        dp2[i] = 0;
    }
    ll it2 = n;
    while (b[it2] > a[n] && it2 > 0){
        dp2[n]+= dp1[it2];
        it2--;
    }
    for (ll i = n-1; i >= 1; i--){
        dp2[i] += dp2[i+1];
        if (it2 > 0)
        while (b[it2] > a[i] && it2 > 0){
            dp2[i] += dp1[it2];
            it2--;
        }
    }
    ll answ = 0;
    for (ll i = 1; i <= n; i++){
        answ+= dp2[i];
    }
    cout << answ << endl;
    return 0;
}

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

namespace ABCTemplate_B
{
    public class Program
    {
        static void Main(string[] args)
        {
            var b = new ProblemB();
        }
    }

    public class ProblemB
    {
        public ProblemB()
        {
            
            // 文字列の入力
            string s = Console.ReadLine();
            var wholeFlag = Check(s);

            var n = s.Length;
            var start = string.Join("", s.Take((n - 1) / 2));
            var end = string.Join("", s.Skip((n + 1) / 2));
            var startFlag = Check(start);
            var endFlag = Check(end);
            //出力
            if (wholeFlag & startFlag & endFlag)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
            
        }

        private bool Check(string s){
            var flag = false;
            var rev = string.Join("", s.Reverse());
            if (s == rev)
            {
                flag = true;
            }
            else
            {
                flag = false;
            }
            return flag;
        }
    }
}


Measured memory_bytes: 13268
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def Base_10_to_n(X, n):
  if (int(X/n)):
    return Base_10_to_n(int(X/n), n)+[X%n]
  return [X%n]


#############
# Main Code #
#############

N = inputI()
D,X = inputIL()
A = inputILs(N)

C = sum([(D-1)//a + 1 for a in A])

print(C+X)

Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	if (s.size()%2==1)
	{
		cout<<"No";
		return 0;
	}
	for (int i=0;i<s.size();i+=2)
	{
		if (s[i]!='h'||s[i+1]!='i')
		{
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    if(a==1){
        a=a+13;
    }
    if(b==1){
        b=b+13;
    }
    if(a>b){
        printf("Alice\n");
    }
    else if(b>a){
        printf("Bob\n");
    }
    else{
        printf("Draw\n");
    }
    return 0;
}


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

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    while(1){
        c -= b;
        if(c <= 0){
            cout << "Yes" << endl;
            return 0;
        }
        a -= d;
        if(a <= 0){
            cout << "No" << endl;
            return 0;
        }
    }

}

Measured memory_bytes: 3632
n = int(input())
w=[]
for i in range(n):
  w.append(input())
a=0
for j in range(n-1): 
  if w[j][-1] == w[j+1][0]:
    a = a + 1
if a==n-1 and len(list(set(w))) == len(w):
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int x=0;
		int y=0;
		int swap=0;
		while(true) {
			x=sc.nextInt();
			y=sc.nextInt();
			if(x==0 && y==0) {break;};
			if(x>y) {
				swap=x;
				x=y;
				y=swap;
			}
			System.out.printf("%d %d%n", x,y);
		}
	}

}



Measured memory_bytes: 40088
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>

using namespace std;

const long long mod = 1000000007;
int n;
long long ans;
string s1, s2;

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

  cin >> n >> s1 >> s2;
  ans = 3;
  bool was_two = s1[0] != s2[0];
  int i = 1;
  if (was_two) {
    ans *= 2;
    i++;
  }

  for (; i < n; i++) {
    if (s1[i] == s2[i]) {
      if (was_two) {
        was_two = false;
      } else {
        ans = (ans * 2) % mod;
      }
    } else {
      i++;
      if (was_two) {
        ans = (ans * 3) % mod;
      } else {
        ans = (ans * 2) % mod;
        was_two = true;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 256