akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll= long long ;
using P = pair<ll,ll>;
#define rep(i,n) for (ll i = 0; i<(ll)(n); i++)
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<ll> vcl;

ll gcd(ll a,ll b){
    if(b>a) swap(a,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 rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t =rep_jijo(n,x/2);
        return t*t%mod;
  }
  return n*rep_jijo(n,x-1)%mod;
}

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


int main() {
   ll N;
   cin>>N;
   ll a[100010][3];
   ll dp[100010][3];
   rep(i,N){
       rep(j,3){
           cin>>a[i][j];
       }
   }
   rep(i,100010) rep(j,3) dp[i][j]=0;

   rep(i,N){
       rep(j,3){
           rep(k,3){
               if(j==k){
                   continue;
                   }
               
               chmax(dp[i + 1][k], dp[i][j] + a[i][k]);
           }
       }
   }
   
   ll ans=0;
   rep(i,3){chmax(ans,dp[N][i]);}
    cout << ans << endl;
   return 0;
}


Measured memory_bytes: 4992
# 
N1= int(input())
N2= list(str(N1))
L= len(N2)
S= 0
for i in range(0, L):
    S= S+int(N2[i])

T= N1%S
if T== 0:
    print("Yes")
else :
    print("No")


#〜〜〜・〜〜〜・〜〜〜・〜〜〜・〜〜〜・〜〜〜・〜〜〜
# "input()"：入力する箱を作る
# "int()":数字として扱う
# "len()":リストの個数を調べる
#
#
#


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

// void dfs(int i, int sum) {
//     if (i == n-1) {
//         if (sum == a) res++;
//     }
//     else {
//         if (sum-x[i] >= 0) { dfs(i+1, sum-x[i]); }
//         if (sum+x[i] <= 20) { dfs(i+1, sum+x[i]); }
//     }
// }

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

    long long dp[101][21];
    memset(dp, 0, sizeof(dp));

    dp[1][x[0]] = 1;
    for (int i=0;i<n-1;++i) {
        for (int j=0;j<=20;++j) {
            if (j - x[i] >= 0) {
                dp[i+1][j - x[i]] += dp[i][j];
            }
            if (j + x[i] <= 20) {
                dp[i+1][j + x[i]] += dp[i][j];
            }
        }
    }

    cout << dp[n-1][a] << endl;

    return 0;
}

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

const int N=1e5+4;
map<int,int> pos1,pos2;
int a[N];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;++i)
		cin>>a[i];
	for(int i=0;i<n;++i){
		pos1[a[i]]=i;
	}
	sort(a,a+n);
	for(int i=0;i<n;++i){
		pos2[a[i]]=i;
	}
	int ans=0;
	for(int i=0;i<n;++i){
		int diff=abs(pos1[a[i]]-pos2[a[i]]);
		ans+=(diff&1);
	}
	cout<<ans/2<<endl;
}

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

int main() {
  int n,k;
  cin>>n>>k;
  vector<int> vec(n+1);
  int p;
  for(int i=0;i<n;i++){
    cin>>p;
    vec.at(p)++;
  }
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  int answer=0;
  for(int i=k;i<n+1;i++){
    answer+=vec.at(i);
  }
  cout<<answer<<endl;
}

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

int main() {

    map<int, bool> numbers = map<int, bool>();

    int n;
    bool isTrue = true;

    cin >> n;

    for(int i = 0; i < n; ++i) {
        int in_num;
        cin >> in_num;

        if(numbers.find(in_num) != numbers.cend()) {
            isTrue = false;

        }
        else {
            numbers[in_num] = true;

        }

    }

    if(isTrue)
        cout << "YES";
    else
        cout << "NO";

    cout << endl;

    return 0;

}

Measured memory_bytes: 9600
#include<bits/stdc++.h>
using namespace std;
#define N 2005
#define ll long long
const ll mod=1e9+7;


int main()
{
    ll l,r;
    cin>>l>>r;

    if(r-l>2018)printf("0");
    else
    {
        l%=2019,r%=2019;
        int ans=2019;
        for(int i=l;i<r;i++)
            for(int j=i+1;j<=r;j++)
            {
                ans=min(ans,(i*j)%2019);
            }
        cout<<ans;
    }
    return 0;
}


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

string to_string(string s) {
  return '"' + s + '"';
}
 
string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
 
#ifdef LOCAL
#define db(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define db(...) 42
#endif

using ll = long long;

int main() {
  int n;
  cin >> n;
  int a[n+1];
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    ans += a[i];
  }
  int t;
  cin >> t;
  while (t--) {
    int x, y;
    cin >> x >> y;
    cout << ans - a[x] + y << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string to_string(const string& s) {
	return '"' + s + '"';
}
string to_string(const bool b) {
	return (b ? "true" : "false");
}
string to_string(const char* s) {
	return to_string((string)s);
}
string to_string(const char c) {
	string s = "'";
	s += c;
	s += "'";
	return s;
}
template<class T, class U>
string to_string(const pair<T, U>& p) {
	string s = "(";
	s += to_string(p.first);
	s += ", ";
	s += to_string(p.second);
	s += ")";
	return s;
}
template<class T>
string to_string(const T& a) {
	bool first = true;
	string s = "{";
	for (const auto& x : a) {
		if(!first){
			s += ", ";
		}
		first = false;
		s += to_string(x);
	}
	s += "}";
	return s;
}
void debug_out() {cerr << '\n';}
template<class Head, class... Tail>
void debug_out(Head head, Tail... tail) {
	cerr << ' ' << to_string(head);
	debug_out(tail...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "] = ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const int inf = 1e9 + 100;
const ll inf64 = 7e18l;
bool check(int x) {
	string p = to_string(x);
	string t = p;
	reverse(p.begin(), p.end());
	return t == p;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(20);
	int n, k;
	cin >> n >> k;
	ll answer = 0;
	for (int num = 1; num <= n; ++num) {
		for (int now = 0; now <= n; now += num) {
			int r = min(n + 1, now + num);
			int l = now + k;
			if (l == 0) {
				++l;
			}
			answer += max(r - l, 0);
		}
	}
	cout << answer << '\n';
 	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
int main(){
    int n;
    cin >> n;
    int p[n],q[n];
    rep(i,n)cin >> p[i];
    rep(i,n)cin >> q[i];
    vector<int>m(n);
    rep(i,n)m[i] = i+1;
    int a = 0,b = 0;
    int cnt = 1;
    do{
        bool okp = true,okq = true;
        rep(i,n)if(m[i]!=p[i])okp = false;
        rep(i,n)if(m[i]!=q[i])okq = false;
        if(okp)a = cnt;
        if(okq)b = cnt;
        cnt++;
    }while(next_permutation(all(m)));
    cout << abs(a-b) << endl;
    return 0;
}

Measured memory_bytes: 3576
require 'set'

N, M = gets.split.map(&:to_i)
A = Set.new(M.times.map { gets.to_i })
MOD = 10 ** 9 + 7
dp = Array.new(N + 10, 0)
dp[0] = 1
N.times do |i|
  next if A.include?(i)
  if i + 1 <= N && !A.include?(i + 1)
    dp[i + 1] = (dp[i + 1] + dp[i]) % MOD
  end
  if i + 2 <= N && !A.include?(i + 2)
    dp[i + 2] = (dp[i + 2] + dp[i]) % MOD
  end
end
puts dp[N]

Measured memory_bytes: 9980
(function(input) {
    var p = input.split('\n').map(Number);
    var n = p.shift();
    var a = p.slice(0, n);

    var count = 0;
    for (var i = 0; i < a.length; i++) {
        if (isPrimeNumber(a[i])) {
            count++;
        }
    }
    console.log(count);
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

function greatestCommonDevisor(x, y) {
    return Math.max.apply(null, commonDevisors(x, y));
}

function commonDevisors(x, y) {
    if (x > y) {
        x = x % y;
    } else if (x < y) {
        var tmp = y;
        y = x;
        x = tmp % x;
    }
    var a = [];
    var ds = divisors(x);
    for (var i = 0; i < ds.length ; i++) {
        var d = ds[i];
        if (y % d === 0) {
            a.push(i);
        }
    }
    return a;
}

function divisors(x) {
    var a = [];
    for (var i = 1; i <= x / 2; i++) {
        if (x % i === 0) {
            a.push(i);
        }
    }
    return a;
}

function inArray(needle, heystack) {
    return heystack.indexOf(needle) !== -1;
}

function primeNumbersIn(x) {
    var a = [];
    for (var i = 2; i <= x; i++) {
        a.push(i);
    }

    var j = 0
    var n = a[j];
    do {
        for (var i = n * 2; i <= x; i += n) {
            var index = a.indexOf(i);
            if (index >= 0) {
                a = a.slice(0, index).concat(a.slice(index + 1, a.length));
            }
        }
        n = a[++j];
    } while (n <= Math.sqrt(x))
    return a;
}

function isPrimeNumber(x) {
    if (x === 2) {
        return true;
    } else if (x % 2 === 0) {
        return false;
    }
    var n = 3;
    while (n <= Math.sqrt(x)) {
        if (x % n === 0) {
            return false;
        }
        n += 2;
    }
    return true;
}

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

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


Measured memory_bytes: 3092
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 400000;







int main() {

	int N, K;
	cin >> N >> K;

	if (K > (N - 1)*(N - 2) / 2) { cout << -1; }

	else {
		int M = N * (N - 1) / 2 - K;

		cout << M << endl;

		int c = 0;

		for (int i = 1; i <= N; i++) {
			for (int j = i + 1; j <= N; j++) {
				cout << i << " " << j << endl;
				c++;

				if (c == M) { break; }
			}

			if (c == M) { break; }
		}


	}



	
	system("PAUSE");

}

Measured memory_bytes: 504
#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MOD	1000000007
#define int	long long
#define pii pair<int,int> 
#define vi vector<int>
using namespace std;

int power(int a, int b){ int S = 1; while(b--)S *= a; return S;}

int32_t main(){
	int l;
	cin >> l;
	float k = (float)l/3;
	float s = k*k*k;
	cout << fixed << setprecision(10) << s;
	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>


int main() {
    int i, ans;
    int L, R, d;
    ans = 0;

    scanf("%d %d %d", &L, &R, &d);

    for(i=L; i<=R; i++){
        if((i % d) == 0) ans++;
    }

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

Measured memory_bytes: 1712
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
long long int INF = 1e18;
double Pi = 3.1415926535897932384626;
 
//vector<ll> G[500005];
//vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←
 
 
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
 
 
ll mod = 998244353;
ll rui(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
 
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
 
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
 
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
 
//ll fact[800005],rfact[800005];
/*
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=800000; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[800000] = rui(fact[800000],mod - 2);
    for(ll i=800000; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod) * rfact[n-r]) % mod;}
*/
 
ll n,m,num,sum,ans,a,b,c,e,g,h,w,i,j,k,q;
ll t,d;
ll x[500005],y[500005],z[500005];
P table[500005];
string s;

int main(){
    cin >> a >> b;
    vector <ll> va;
    vector <ll> vb;
    for(ll i=2;i*i<=a;i++){
    	if(a % i == 0){
    		va.pb(i);
    		//pe(i);
    		while(a % i == 0){
    			a /= i;
    		}
    	}
    }
    if(a != 1)va.pb(a);
    for(ll i=2;i*i<=b;i++){
    	if(b % i == 0){
    		vb.pb(i);
    		//pe(i);
    		while(b % i == 0){
    			b /= i;
    		}
    	}
    }
    if(b != 1)vb.pb(b);
    ll n = va.size();
    ll m = vb.size();
    for(int i=0;i<n;i++){
    	for(int j=0;j<m;j++){
    		if(va[i] == vb[j]){
    			//p(va[i]);
    			ans++;
    		}
    	}
    }
    p(ans + 1);

    return 0;
}


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

typedef long long int ll;
typedef long double ld;

int main(){
    ll n;
    scanf("%lld",&n);
    vector<ll>ch(n+1,0LL);
    ll num[n+5];
    for(ll i=0;i<n;i++){
        scanf("%lld",&num[i]);
        ch[num[i]]++;
    }
    ll ans=0;
    map<ll,ll>res;
    for(ll i=0;i<n;i++){
        ll t = (ch[num[i]]*(ch[num[i]]-1))/2;
        if(res.count(num[i])==0) {
            res[num[i]]=t;
            ans+=t;
        }
    }
    for(ll i=0;i<n;i++){
        ll temp = ch[num[i]]-1;
        ll pluss = (temp*(temp-1))/2;
        printf("%lld\n",ans-res[num[i]]+pluss);
    }
    return 0;
}


Measured memory_bytes: 12672
#define _DEBUG 1
#define _GLIBCXX_DEBUG

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

using ll = long long;

#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z)                                                     \
  cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z \
       << endl
#define check(s) cerr << s << endl
#else
#define dump(x)
#define dump2(x, y)
#define dump3(x, y, z)
#define check(s)
#endif

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

const ll LINF = 2e18;
const int INF = 1e9;

void solve(ll N, std::vector<ll> A) {
  double x = 0.0;
  sort(all(A), greater<ll>());
  for (auto v : A) {
    x += 1.0 / v;
  }

  cout << std::fixed << std::setprecision(15) << 1.0 / x << endl;
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
double dp[301][301][301];
int n;

double ans(int a1 , int a2 , int a3){
    if(a1+a2+a3 == 0){
        return 0.0;
    }
    if(dp[a1][a2][a3] > -0.01){
        return dp[a1][a2][a3];
    }
    double ret = ((a1 > 0 ? a1*(1.0+ans(a1-1,a2,a3)) : 0.0) + (a2 > 0 ? a2*(1.0+ans(a1+1,a2-1,a3)) : 0.0) + (a3 > 0 ? a3*(1.0+ans(a1,a2+1,a3-1)) : 0.0) + double(n-a1-a2-a3))/double(a1+a2+a3);
    return dp[a1][a2][a3] = ret;
}

int main(){
    for(int i = 0 ; i <= 300 ; i += 1){
        for(int j = 0 ; j <= 300 ; j += 1){
            for(int k = 0 ; k <= 300 ; k += 1){
                dp[i][j][k] = -1.0;
            }
        }
    }
    cin >> n;
    int a[4] = {0};
    for(int i = 0 ; i < n ; i += 1){
        int b;
        cin >> b;
        a[b] += 1;
    }
    cout << setprecision(10) << fixed;
    cout << ans(a[1],a[2],a[3]) << endl;
}

Measured memory_bytes: 213376
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a < b) {
			System.out.println(0);
		}else {
			System.out.println(10);
		}
	}
}

Measured memory_bytes: 23636
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_4_B&lang=jp
#include<bits/stdc++.h>
using namespace std;
double r;
int main(void){
  cin>>r;
  printf("%f %f\n",M_PI*r*r,2*M_PI*r);
  return 0;
}



Measured memory_bytes: 3284
import itertools
N=int(input())
L=list(map(int,input().split()))
c=0
if len(L) >=3:
    for v in itertools.combinations(L, 3):
        if (v[0] != v[1] and v[1] != v[2]) and v[0] != v[2]:
            if sorted(v)[-2]+min(v) > max(v):
                c=c+1
            else:
                c=c
        else:
            c=c
else:
    c=0
print(c)

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

using namespace std;

#define INF -1

int main()
{
	int D, N;

	cin >> D >> N;

	vector<int> T(D);
	vector<int> A(N);
	vector<int> B(N);
	vector<int> C(N);

	for (int i = 0; i < D; i++) { cin >> T[i]; }
	for (int i = 0; i < N; i++) { cin >> A[i] >> B[i] >> C[i]; }

	vector<vector<int> > dp(D, vector<int>(101, INF));

	for (int i = 0; i < N; i++)
	{ 
		if (A[i] <= T[0] && T[0] <= B[i])
		{
			dp[0][C[i]] = 0;
		}
	}

	for (int i = 1; i < D; i++)
	{
		for (int j = 0; j < N; j++)
		{
			int max_ = 0;

			if (A[j] <= T[i] && T[i] <= B[j])
			{
				for (int k = 0; k < N; k++)
				{
					if (dp[i - 1][C[k]] != INF)
					{
						max_ = max(max_, dp[i - 1][C[k]] + abs(C[j] - C[k]));
					}
				}

				dp[i][C[j]] = max_;
			}
		}
	}

	cout << *max_element(dp[D - 1].begin(), dp[D - 1].end()) << endl;

	return 0;
}

// Time : O( D * N ^ 2 )

Measured memory_bytes: 1304
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}


macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    fn s(n: u32) -> u32 {
        if n < 10 {
            n
        } else {
            s(n / 10) + n % 10
        }
    }
    let mut sc = Scanner::new();
    let n: u32 = sc.cin();
    if n % s(n) == 0 {
        put!("Yes");
    } else {
        put!("No");
    }
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <numeric>
#include <math.h>

using namespace std;
void func()
{
	int N, X, T;
	cin >> N >> X >> T;
	cout << (int)ceil((double)N / X) * T << endl;
}

int main() {
//	while(1)
	func();
	return 0;
}


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

long long sv(long long a, long long b, long long m) 
{
	if (a % m == 0) 
		return (b / m) - (a / m) + 1;
	return (b / m) - (a / m); 
} 
  
int main()
{
  long long a,b,c,d;
  cin>>a>>b>>c>>d;
  long long ans=b-a+1;
  long long lcm = (c*d)/__gcd(c,d);
  ans-=sv(a,b,c);
  ans-=sv(a,b,d);
  ans+=sv(a,b,lcm);
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());


int main(){
    int a,b;
    cin >> a >> b;
    cout << (a+b)%24 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
struct Solution {
    void solve(std::istream& in, std::ostream& out) {
        ll h, w;
        in >> h >> w;
        vvll a(h, vll(w));
        vvll c(10, vll(10));
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                in >> c[i][j];
            }
        }
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                in >> a[i][j];
            }
        }
        for (int k = 0; k < 10; k++) {
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 10; j++) {
                    if (c[i][j] > c[i][k] + c[k][j]) {
                        c[i][j] = c[i][k] + c[k][j];
                    }
                }
            }
        }
        ll ans = 0;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                int id = a[i][j];
                if (id != -1) {
                    ans += c[id][1];
                }
            }
        }
        out << ans << '\n';
    }
};
void solve(std::istream& in, std::ostream& out) {
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}
#include <fstream>
#include <iostream>
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    istream& in = cin;
    ostream& out = cout;
    solve(in, out);
    return 0;
}


Measured memory_bytes: 640
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

const uint32_t Giga = 1000000000;

int main() {
  uint64_t S;
  cin >> S;

  if (S == 1000000000000000000) {
    cout << 0 << " " << 0 << " " << Giga << " " << 0 << " " << 0 << " " << Giga
         << endl;
  } else {
    uint64_t res1 = Giga - (S - (S / Giga) * Giga);
    uint64_t res2 = (S + res1) / Giga;
    cout << 0 << " " << 0 << " " << Giga << " " << res1 << " " << 1 << " "
         << res2 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    long N,A,B;
    long Xb,X,ans = 0;
    cin >> N >> A >> B;
    cin >> Xb;
    for(int i=1;i<N;i++){
        cin >> X;
        ans += A*(X-Xb) < B? A*(X-Xb) : B;
        Xb = X;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
using namespace std;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(long long i=0;i<n;i++)
#define rp(i,n) for(long long i=1;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define V vector
long long p = 1000000007;
vel rui(19, 1);
vel kai(1000007, 1);
vel ink(1000007, 1);
vel par;
int root(int ser) {
	if (par[ser] == -1) { return ser; }
	int ans = root(par[ser]);
	par[ser] = ans;
	return ans;
}
bool marge(pin a) {
	int x = root(a.first);
	int y = root(a.second);
	if (x != y) {par[x] = y;}
	return x != y;
}
int gcd(int a, int b) {
	if (a < b) { swap(a, b); }
	if (b == 0) { return a; }
	return gcd(b, a%b);
}
int ru(int a, int r) {
	if (r == 0) { return 1; }
	int ans = ru(a, r / 2);
	ans *= ans; ans %= p;
	if (r % 2 == 1) { ans *= a; ans %= p; }
	return ans;
}
int inv(int a) {
	return ru(a, p - 2);
}
void make_kai() {
	rep(i, 1000006) { kai[i + 1] = (kai[i] * (i + 1)) % p; }
	rep(i, 1000007) { ink[i] = inv(kai[i]); }
}
int com(int n, int r) {
	int ans = kai[n] * ink[r];
	ans %= p;
	return ans;
}
signed main() {
	int n; cin >> n;
	vel x(n), y(n);
	rep(i, n) { cin >> x[i] >> y[i]; }
	int ans = n;
	rep(i, n) {
		for (int j = i + 1; j < n; j++) {
			int qans = n;
			int dx = x[i] - x[j];
			int dy = y[i] - y[j];
			rep(k, n) {
				rep(l,n) {
					int dx1 = x[k] - x[l];
					int dy2 = y[k] - y[l];
					if (dx == dx1 and dy == dy2) { qans--; }
				}
			}
			mmin(ans, qans);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 15872
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

int main(int argc, char** argv) {
  ll N;
  cin >> N;
  vector<int> a(N);
  rep(i, N) {
    int x;
    cin >> x;
    ++a[x-1];
  }
  sort(all(a)); // a: frequencies in increasing order.

  vector<int> s(N+1); // s[i]: sum of [0, i). s[0] = 0.
  rep(i, N) {
    s[i+1] = s[i] + a[i];
  }

  ll ans = N;
  for (int k = 1; k <= N; ++k) {
    // We want to find the boundary of ok and ng.
    while (1) {
      bool ok = [&](int c) {
        int i = lower_bound(all(a), c) - a.begin();
        int sum = c*(N-i) + s[i]; // (N-1)-(i-1) = N-i
        return sum >= c*k;
      }(ans);
      if (ok) { break; }
      --ans;
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 3200
#include "bits/stdc++.h"

using namespace std;

// This is a question of dp

int lds(int arr[], int n) 
{ 
    int lds[n]; 
    int i, max = 0; 
  
    // Initialize LDS with 1 for all index 
    // The minimum LDS starting with any 
    // element is always 1 
    for (i = 0; i < n; i++) 
        lds[i] = 0; 
  
    // Compute LDS from every index 
    // in bottom up manner 
    for (i = 1; i < n; i++) {
        if(arr[i] <= arr[i-1]){
            lds[i] += lds[i-1] + 1;
        }
        else{
            lds[i] = 0;
        }
    }

  
    // Select the maximum  
    // of all the LDS values 
    for (i = 0; i < n; i++) 
        {
            // cout << lds[i] << endl;
             if (max < lds[i]) 
           {
                max = lds[i];
           } 
        }
       
  
    // returns the length of the LDS 
    return max; 
} 

int main(){

    int N;
    cin >> N;
    int H_values[N];

    int i =0;
    while(i < N){
        scanf("%d", &H_values[i]);
        i++;
    }

    cout << lds(H_values, N);





    return 0;
}

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,n) for(int i=(int)(n-1);i>=0;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define print(x) cout << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<int, P> PIP;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;
typedef set<int> S;

#define INF INT_MAX/3
#define MAX_N 1000000001

map<string, char> mp[2] = {
  {{"SS", 'S'}, {"SW", 'W'}, {"WS", 'W'}, {"WW", 'S'}},
  {{"SS", 'W'}, {"SW", 'S'}, {"WS", 'S'}, {"WW", 'W'}}
};

int main(){
  cin.sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;

  int pt = (s[0] == 'o') ? 0 : 1;
  bool ok = false;
  string ans;
  for(auto m : mp[pt]) {
    ans = m.fi;
    repl(i, 1, n) {
      if (s[i] == 'o') {
        ans += mp[0][ans.substr(i - 1, 2)];
      } else {
        ans += mp[1][ans.substr(i - 1, 2)];
      }
    }

    if (mp[pt][m.fi] == ans[n - 1] && ans[n] == ans[0]) {
      ok = true;
      break;
    }
  }

  if (ok) print(ans.substr(0, n));
  else print(-1);

  return 0;
}

Measured memory_bytes: 832
// #include <bits/stdc++.h>
#include<iostream>
#include<stack>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<iomanip>
#include<set>
#include<bitset>
#include<cmath>
#include<numeric>
#include<limits>
#include<functional>
#include <bitset>

#define REP(i, m, n) for(int i = (m); i < (n); i++)
#define rep(i,n) REP(i,0,n)
#define NIL -1
using namespace std;
typedef long long ll;
typedef long long int lli;
// static const int MOD = 10000007;
static const int MAX = 500005;
// static const int ls = 101;
// static const int NMAX = 5005;
// static const lli INFTY = 1000000000000;

// typedef priority_queue<int, greater<int>> RevQ;
lli n;
string s;
// lli A, B;
stack<int> m;
// vector<pair<int, int>> a(MAX);

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

int main(){
  s.reserve(MAX);
  cin >> s;
  n = s.size();
  vector<lli> up, down;
  int lu, ru; // left up, right up flag
  lu = (s[0] == '<') ? 1:0;
  ru = (s[n-1] == '<') ? 1:0;
  lli pre = s[0];
  lli cnt = 1;
  REP(i, 1, n) {
    if (pre != s[i]) {
      if (pre == '<') up.push_back(cnt);
      else down.push_back(cnt);
      cnt = 1;
      pre = s[i];
    } else {
      cnt += 1;
      pre = s[i];
    }
    if (i == n-1) {
      if (s[i] == '<') up.push_back(cnt);
      else down.push_back(cnt);
    }
  }
  lli d = down.size();
  lli u = up.size();
  lli ans = 0;
  //
  // rep(i,d) cout << down[i] << " ";
  // cout << endl;
  // rep(i, u) cout << up[i] << " ";
  // cout << endl;
  if (lu && ru) {
    rep(i, d) {
      if (down[i] < up[i]) {
        down[i] -= 1;
      } else  {
        up[i] -= 1;
      }
    }
    rep(i, d) ans += ((down[i] + 1)*down[i])/2;
    rep(i, u) ans += ((up[i] + 1)*up[i])/2;
  } else if (lu && !ru) {
    rep(i, d) {
      if (down[i] < up[i]) {
        down[i] -= 1;
      } else  {
        up[i] -= 1;
      }
    }
    rep(i, d) ans += ((down[i] + 1)*down[i])/2;
    rep(i, u) ans += ((up[i] + 1)*up[i])/2;
  } else if (!lu && ru) {
    REP(i, 1, d) {
      if (down[i] < up[i-1]) {
        down[i] -= 1;
      } else  {
        up[i-1] -= 1;
      }
    }
    rep(i, d) ans += ((down[i] + 1)*down[i])/2;
    rep(i, u) ans += ((up[i] + 1)*up[i])/2;
  } else if (!lu && !ru) {
    REP(i, 1, d) {
      if (down[i] < up[i-1]) {
        down[i] -= 1;
      } else  {
        up[i-1] -= 1;
      }
    }
    rep(i, d) ans += ((down[i] + 1)*down[i])/2;
    rep(i, u) ans += ((up[i] + 1)*up[i])/2;
  }
  if (n == 1) ans = 1;
  cout << ans << endl;
}


Measured memory_bytes: 2924
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll N,K; cin >> N >> K;
  ll sum = 0;
  for(ll b = 1; b <= N; b++){
    ll p = N/b; ll r = N%b;
    
    sum += p*max(b-K,0LL) + max(r-K+1, 0LL); if(K == 0LL){ sum--;}
  }
  cout << sum << endl; return 0;}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {

	int H = 0;			//??????????????°??????????????°
	int i = 0;
	int W = 0;			//?¨????????????°??????????????°
	int j = 0;

	do{
		scanf("%d",&H);
		scanf("%d",&W);
		for(i = 1 ; i <= H ; i++){
			for(j = 1 ; j <= W ; j++){

				if( (i + j)%2){
					printf(".");
				}else{
					printf("#");
				}
			}
			printf("\n");
		}

		if(W || H){			//0,0??????????????????????????????????????????????????¨????????¨???????????????
			printf("\n");
		}

	}while(W || H);

	return 0;
}

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

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

    int c=0;
    rep(i,n){
        if(a[i] == b[i]) {
            ++c;
        } else {
            c=0;
        }
        if (c==3) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3600
#include <iostream>

int main(){
  int h,w,k,count=0;
  std::cin >> h >> w >> k;
  char c[100][100];
  for(int i=0; i<h; i++){
    for(int j=0; j<w; j++){
      std::cin >> c[i][j];
    }
  }
  
  for(int maskH=0; maskH<(1<<h); maskH++){//bit全探索 '1'の行を塗る
    for(int maskW=0; maskW<(1<<w); maskW++){
      int black=0;
      for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
          if(((maskH>>i) & 1) == 1){continue;}//i行目が赤なら飛ばす
          if(((maskW>>j) & 1) == 1){continue;}
          if(c[i][j] == '#'){black++;}
        }
      }
      if(black == k){count++;}
    }
  }
          
  std::cout << count << std::endl;
  
  return 0;
}


Measured memory_bytes: 3588
#include <iostream>
#include <numeric>

using namespace std;

int N, X[100];
int p;

int main() {
    cin >> N;

    for (int i = 0; i < N; i++) {
        cin >> X[i];
    }

    p = (int) (accumulate(X, X + N, 0) / (double) N + 0.5);

    int ans = accumulate(X, X + N, 0, [](int sum, int x) -> int {
        return sum + abs(x - p) * abs(x - p);
    });

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<iomanip>
#include <math.h>
using namespace std;
int main(){
    string a,b;
    cin>>a>>b;
    if(a==b){
        cout<<"EQUAL"<<endl;
    }
    else if(a.size()>b.size()||(a.size()==b.size()&&a>b)){
        cout<<"GREATER"<<endl;
    }
    else{
        cout<<"LESS"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3616
//kruskal tree
#include <cstdio>
#include <algorithm>
using namespace std;
#define M 9999
int parent[M],a[M],b[M];
pair<int,int>node[M];
int root(int a){return parent[a]==a?a:parent[a]=root(parent[a]);}
int unite(int a,int b){
	int x=root(a),y=root(b);
	if(x==y)return 0;
	parent[x]=y;
	return 1;
}
int main(){
	int i,j,J,n,m,r,R;
	for(;scanf("%d%d",&n,&m),n;printf("%d\n",R)){
		for(i=0;i<m;i++)scanf("%d%d%d",a+i,b+i,&node[i].first),node[i].second=i,a[i]--,b[i]--;
		for(sort(node,node+m),R=-1,i=0;i<m;i++){
			for(J=j=0;j<n;j++)parent[j]=j;
			for(j=i;j<m;j++)if(unite(a[node[j].second],b[node[j].second]))if(r=node[j].first-node[i].first,++J==n-1){if(R==-1||R>r)R=r;break;}
		}
	}
}

Measured memory_bytes: 1152
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cout<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}


typedef long long int64;


int main() {
    int a,b;
    cin >> a >> b;
    string s ( b,(char)0x30+a);
    string t ( a,(char)0x30+b);
    cout << min(s,t) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
vector<int> vis;
vector<int> ki[110000];
void dfs(int now,int last = -1){
    vis[now] = 1;
    for(auto next:ki[now]){
        if(next == last)continue;
        if(vis[next])continue;
        
        dfs(next,now);
    }
}
signed main(){
    int n,m;cin >> n >> m;
    vis.resize(n);
    rep(i,m){
        int a,b,c;cin >>a  >> b >> c;
        a--;b--;
        ki[a].push_back(b);
        ki[b].push_back(a);
    }
    

    int ans =0;
    rep(i,n){
        if(vis[i])continue;
        dfs(i);
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 14252
#include<bits/stdc++.h>
using namespace std;
string a;
int ok=0;
int main()
{
	getline(cin,a);
	for(int i=0;i<a.size();i++){
		if(a[i]=='C')ok=1;
		if(a[i]=='F'&&ok==1){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int N;
    int Y;
    cin >> N >> Y ;
    int count = 0;
    int i,j,k;
    Y = Y/1000;
    for(i=0;i<=N;i++){
        for(j = 0;j<=N-i;j++){
            for(k = 0;k<=N-i-j;k++){
                if(k+j+i==N && i+5*j+10*k == Y)goto tag;
            }

        }
    }tag:
    if(i<0||j<0||k<0||i+j+k != N || k*10+j*5+i != Y){
        j = i = k = -1;
    }
    cout << k << " "<<j <<" " <<  i << endl;
    return 0;
}

Measured memory_bytes: 256
s = input()

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('Yes')
else:
    print('No')

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

int main()
{
    ll n;
    cin >> n;
    int s;
    int a = n;
    while(n != 0) {
        s += n % 10;
        n = n / 10;
    }
    if(a % s == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
 
#define ll long long
#define MOD 1000000007
 
#define MODA(a, b) ((a + b) % MOD)
#define MODS(a, b) (((a - b) % MOD + MOD) % MOD)
#define MODM(a, b) (a * b % MOD)
 
ll power_mod(ll x, ll n) {
  if (n == 0)
    return 1;
  else if (n % 2)
    return MODM(x, power_mod(x, n - 1));
  else
    return power_mod(MODM(x, x), n / 2);
}
 
ll facts[1000000];
ll rfacts[1000000];
 
ll comb(ll n, ll k) {
  if (n == 0 || k == 0 || n - k == 0) return 1;
  return MODM(MODM(facts[n], rfacts[k]), rfacts[n - k]);
}
 
int main() {
  int upper = 1000000;
 
  ll f = 1;
  facts[0] = 1;
  for (int i = 1; i <= upper; i++) {
    f = MODM(f, i);
    facts[i] = f;
    rfacts[i] = power_mod(f, MOD - 2);
  }
 
  //ここでcomb()使った処理
  int n;
  std::cin >> n;
 
  ll res = 0;
  ll pre = 0;
  for (int k = (n - 1) / 2 + 1; k < n; k++) {
    ll cnt = MODM(MODM(comb(k - 1, n - k - 1), facts[k]), facts[n - k - 1]);
 
    res = MODA(res, MODM(k, MODS(cnt, pre)));
    pre = cnt;
  }
 
  std::cout << res << std::endl;
 
  return 0;
}

Measured memory_bytes: 15872
process.stdin.resume();
process.stdin.setEncoding('utf8');
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
});
reader.on('line', (line) => {
    lines.push(line);
});
reader.on('close', () => {
    const [A, B, H, M] = lines[0].split(" ").map(e => parseFloat(e));
    const degB = M * 6.0;
    const degA = H * 30.0 + 30.0 * M / 60;
    const deg1 = Math.abs(degA - degB);
    const deg = deg1 > 180 ? 360 - deg1 : deg1;
    const rad = deg * Math.PI / 180;
    const ans = Math.sqrt(Math.pow(A,2) + Math.pow(B,2) - 2 * A * B * Math.cos(rad));
    console.log(ans);
});

Measured memory_bytes: 30124
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define repp(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define popcnt __builtin_popcount
#define all(v) v.begin(),v.end()
#define _Pi 3.1415926535
#define _MOD = 1e9+7;
using namespace std;
using ll = long long;
using pint = pair<int,int>;
using itn = int;
using vint = vector<int>;
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;}
template<class T> T gcd(T a, T b){return b?GCD(b,a%b):a;}
template<class T> T lcm(T a, T b){return a*b/GCD(a,b);}

int main(){
    ll n; cin >> n;
    if((n&1) == 0){
        ll ans = 0;
        ll i = 10;
        while(n/i>0){
            ans += n/i;
            i *= 5;
        }
        cout << ans << endl;
    }
    else{
        cout << 0 << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
n,a,b = map(int, input().split())
MOD = 10**9 + 7

def modcomb(n,a,mod):
    cnt = 1
    for i in range(a):
        cnt *= (n-i)
        cnt *= pow(i+1,mod-2,mod)
        cnt %= mod
    # print(cnt)
    return cnt
    


X = pow(2,n,MOD)-1
A = modcomb(n,a,MOD)
B = modcomb(n,b,MOD)
ans = (X-A-B)%MOD
print(ans)

Measured memory_bytes: 40428
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VI = vector<int>;
using VVI = vector<vector<int>>;

int pow2(int n){
  int ans=1;
  rep(i,n) ans *= 2;
  return ans;
}

int main(){
  int n,m;
  cin >> n >> m;
  VI k(m);
  VVI s(m, VI(n,0));
  rep(i,m){
    cin >> k[i];
    rep(j,k[i]){
      int x;
      cin >> x;
      s[i][x-1] = 1;
    }
  }
  VI p(m);
  rep(i,m) cin >> p[i];
  
  VI Switch(n);
  int ans=0;
  rep(i,pow(2,n)){
    rep(j,n){
      Switch[j] = (i % pow2(j+1)) / pow2(j);
    }
    
    bool flag=true;
    rep(j,m){
      int num=0;
      rep(k,n){
        if(s[j][k]==1 && Switch[k]==1) num++;
      }
      if(num%2 != p[j]) flag = false;
    }
    if(flag) ans++;
    
    //cout << i << " " << flag << endl;
  }
  
  cout << ans;
  
  return 0;
}

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

int dp[1025][100001],v[323456],w[323456];
int f(int a,int l){
  if(l<0)return -1000000000;
  if(!a)return 0;
  if(a<1025){
    if(~dp[a][l])return dp[a][l];
    return dp[a][l]=max({f(a/2,l),f(a,l-1),f(a/2,l-w[a])+v[a]});
  }
  return max(f(a/2,l),f(a/2,l-w[a])+v[a]);
}

int main(){
  memset(dp,-1,sizeof(dp));
  int n;cin>>n;
  for(int i=0;i<n;i++)cin>>v[i+1]>>w[i+1];
  int q;cin>>q;
  while(q--){
    int a,l;cin>>a>>l;
    cout<<f(a,l)<<endl;
  }
}


Measured memory_bytes: 413780
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <regex>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;
using VL=vector<ll>;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
const long long INF =  999999999;

int main(){
  int a[4];
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);
  if((a[0]==a[1]&&a[1]!=a[2])||(a[1]==a[2]&&a[0]!=a[1])){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


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 watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define INF ll(1e18)
#define MOD 998244353
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
#define MAXN 1000000007
 
 
int main() {
	ll x;
	cin>>x;
	cout<<x*x*x<<endl;
}


Measured memory_bytes: 3100
def main():
    S = input().rstrip()
    v1 = int(S[:2])
    v2 = int(S[2:])
    if 1 <= v1 <= 12 and 1 <= v2 <= 12:
        print("AMBIGUOUS")
    elif 1 <= v1 <= 12 and (v2 >= 13 or v2 == 0):
        print("MMYY")
    elif (v1 >= 13 or v1 == 0) and 1 <= v2 <= 12:
        print("YYMM")
    else:
        print("NA")


if __name__ == '__main__':
    main()


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

int main() {
	int n,p[4];
  	cin >> n;
  	p[0]=n%10; n/=10;
  	p[1]=n%10; n/=10;
    p[2]=n%10; n/=10;
  	p[3]=n%10; n/=10;      
  	if(p[1]==p[2]){
      if(p[0]==p[1] || p[3]==p[1]){
 		   cout << "Yes" << endl;
      }
      else{
      	cout << "No" << endl;
      }
    }else{
    cout << "No" << endl;
    }
}

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

int main(){
  int a,b;
  cin >> a >> b;
  int res = a-2*b;
  if(res>0)cout << res << endl;
  else cout << 0 << endl;
}


Measured memory_bytes: 256