akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define mod 1000000007
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}
const int MAX = 330000;
int fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}

// 二項係数計算
long long COMB(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
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;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y)* mod_pow(kai(y, y), mod - 2, mod) % mod;
}
void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug_out(T...);
}

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
struct edge { int to, cost; };
int par[114514], rrank[114514];//親、木の深さ
void init(int n) {
	rep(i, n) {
		par[i] = i;
		rrank[i] = 0;
	}
}
int find(int x) {
	if (par[x] == x) {
		return x;
	}
	else return par[x] = find(par[x]);
}
void unite(int x, int y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rrank[x] < rrank[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rrank[x] == rrank[y])rrank[x]++;
	}
}
bool same(int x, int y) {
	return find(x) == find(y);
}
int h, w, a, b;
signed main() {
	cin >> h >> w >> a >> b;
	COMinit();
	int ans = 0;
	rep(i, w - b) {
		ans += (COMB(h - a + b + i - 1, b + i) * COMB(w + a - b - i - 2, a - 1)) % mod; ans %= mod;
	}
	cout << ans << endl;
	ggr
}

Measured memory_bytes: 7936
import sys
from operator import itemgetter

read = sys.stdin.read
readline = sys.stdin.readline

W, H, *pq = map(int, read().split())
pq = list(zip(pq[:W], ['p'] * W)) + list(zip(pq[W:], ['q'] * H))
pq.sort(key=itemgetter(0))
answer = 0
x = W + 1
y = H + 1
for cost, i in pq:
    if i == 'p':
        answer += cost * y
        x -= 1
    else:
        answer += cost * x
        y -= 1

print(answer)


Measured memory_bytes: 28504
import java.io.*;
import java.util.*;
public class Main
{
	
	private void solve()throws Exception
	{
		int a=nextInt();
		int b=nextInt();
		out.println(a*b);
	}

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

	public void run()throws Exception
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();
		
		br.close();
		out.close();
	}
	public static void main(String args[])throws Exception{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws Exception{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws Exception{
		return br.readLine();
	}
	int nextInt()throws Exception{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws Exception{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws Exception{
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 32720
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def main():
    N = int(input())
    if N == 0 or N == 1:
        print(0)
        return

    if N % 2 == 1:
        print(0)
        return
    else:
        N //= 2
        n5 = 0
        i = 1
        while 5**i <= N:
            n5 += N // (5**i)
            i += 1

        print(n5)
        return

    # print(min(n2, n5))


if __name__ == '__main__':
    main()


Measured memory_bytes: 12496
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const ll MOD = 1e9 + 7;
struct edge { ll from; ll to; ll cost; };

ll dist[101010];
int used[101010];
vector<vector<pair<ll, ll>>>edges(101010);


void dfs(ll now, ll d) {
	dist[now] = d;
	used[now] = 1;

	rep(i, 0, edges[now].size()) {
		ll nxt = edges[now][i].first;
		ll nxtd = edges[now][i].second;
		if (used[nxt] == 0)dfs(nxt,d+nxtd);
	}
}

int main(){
	ll n;
	cin >> n;
	rep(i, 0, n - 1) {
		ll a, b, c;
		cin >> a >> b >> c;
		a--;
		b--;
		edges[a].pb({b,c});
		edges[b].pb({a,c});
	} 


	ll q, k;
	cin >> q >> k;
	k--;
	dfs(k,0);

	rep(i, 0, q) {
		ll x, y;
		cin >> x >> y;
		x--;
		y--;
		cout << dist[x] + dist[y] << endl;
	}

	return 0;
}

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

//region Template
#include "ext/pb_ds/assoc_container.hpp"
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const int MOD = 1000000007;

using namespace std;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_multiset;

#define finish(x) cout << x; exit(0);
#define fastIO cin.tie(0); cin.sync_with_stdio(false);

void setIn(string s) { freopen(s.c_str(), "r", stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

//const string USCAO_TAG = "mountains";
void usaco(const string& USACO_TAG) { setIn(USACO_TAG + ".in"); setOut(USACO_TAG + ".out"); }
void print() {}
template<typename T, typename... Args>
void print(T firstArg, Args... args) {
	#ifdef LOCAL
	cout << firstArg << "\t";
	print(args...);
	#endif
}
//endregion

/* Notes:
 * Farah </3
 */

const int MAXN = 1e5 + 6;
const ll INF = 2e18;

ll fact(int x){
	ll ans = 1;

	while(x > 1){
		ans = (ans * x) % MOD;
		x--;
	}

	return ans;
}

int main() {
	#ifdef LOCAL
	setIn("in.txt");
	setOut("out.txt");
	#endif


	int n, m;
	cin >> n >> m;

	if(max(n, m) - 1 > min(n , m)){
		finish(0);
	}

	ll ans = fact(n) * fact(m);
	ans %= MOD;

	if(n == m){
		ans = (2 * ans) % MOD;
	}

	cout << ans;
}


Measured memory_bytes: 256
Option Strict On
Module Module1

    Sub Main()
        Dim b As String = Console.ReadLine()
        If b = "A" Then
            b = "T"
        ElseIf b = "T" Then
            b = "A"
        ElseIf b = "G" Then
            b = "C"
        Else
            b = "G"

        End If
        Console.WriteLine(b)
        Console.ReadLine()
    End Sub

End Module

Measured memory_bytes: 19792
import scala.io.StdIn._

/**
 * ABC111B
 */
object Main extends App {

  val n = readInt()

  val ans = n match {
    case n if n <= 111 => 111
    case n if n <= 222 => 222
    case n if n <= 333 => 333
    case n if n <= 444 => 444
    case n if n <= 555 => 555
    case n if n <= 666 => 666
    case n if n <= 777 => 777
    case n if n <= 888 => 888
    case _             => 999
    }

  println(ans)
}

Measured memory_bytes: 27072
#include <bits/stdc++.h> 
using namespace std;
 
 
int main()
{ int n,i,sum=0,m,s=0,x; scanf("%d",&n);
if(n==1){printf("No"); return 0;}
m=n;
while(m%2==0){m/=2;}
if(m==1){printf("No"); return 0;}
m=n+1;
while(m){m/=2; s++;}  s--;
m=1; for(i=0;i<s;i++){m*=2;} int A[m];
for(i=0;i<m;i++){A[i]=i;}


printf("Yes\n");
//printf("%d\n",m);
for(i=m;i<n;i+=2){
printf("%d %d\n",i,i+1);
printf("1 %d\n",i);
printf("1 %d\n",i+n+1);
printf("%d %d\n",i+n,i+1+n);	
	
} 
if(n%2==0){
printf("%d %d\n",n,n-2);	
x=n^(n-2); x=x^1;
A[x]=2; A[2]=x;
printf("%d %d\n",2*n,x);	

	
	
	
}
for(i=1;i<m-1;i++){
printf("%d %d\n",A[i],A[i+1]);
	
	
} 
printf("%d %d\n",A[m-1],A[1]+n);
for(i=1;i<m-1;i++){
printf("%d %d\n",A[i]+n,A[i+1]+n);
	
	
} 


 
 
return 0;
}


Measured memory_bytes: 2816
""" C
    https://atcoder.jp/contests/abc173/tasks/abc173_c
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def _pattern(N):
    if N > 1:
        pa = _pattern(N-1)
        return [[0] + p for p in pa] + [[1] + p for p in pa]
    else:
        return [[0], [1]]

def main(H, W, K, c):
    count = 0
    pwSet = _pattern(W)
    phSet = _pattern(H)
    for ph in phSet:
        result = []
        for i in range(0, len(ph)):
            if ph[i] == 1:
                result.append(c[i])
        for pw in pwSet:
            s = 0
            for r in result:
                s += sum([1 if r[j] == "#" and pw[j] == 1 else 0 for j in range(0, len(r))])
            if s == K:
                count += 1
    return count

if __name__ == "__main__":
    _H, _W, _K = readIntegerSet(3)
    _c = [list(readString().strip()) for _ in range(0, _H)]

    print(main(_H, _W, _K, _c))

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

int main() {
	int i,n,c=0,j=0;
	string x;
	cin>>n;
	vector<string> s(n);
	vector<int> t(n);
	for(i=0;i<n;i++){
		cin>> s.at(i);
		cin>> t.at(i);
	}
	cin>>x;
	for(i=0;i<n;i++){
		if(j)c+=t.at(i);
		if(x==s.at(i))j=1;

	}
	cout<<c;

	// your code goes here
	return 0;
}


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


void solve(long long a){
    unsigned long int x = a*a*a+a*a+a;
    cout << x << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long a;
    scanf("%lld",&a);
    solve(a);
    return 0;
}


Measured memory_bytes: 3756
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1187&lang=jp>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */
int M,T,P,R;
struct Team{
    int id;
    int correct;
    int penalty;
    vector<int> accept;
    vector<int> wrong;
    Team(){};
    Team(int id,int P):id(id),accept(P),wrong(P),correct(0),penalty(0){}
    void AC(int P,int time){
        if(accept[P]) return;
        accept[P] = 1;
        penalty += wrong[P]*20 + time;
        correct++;
        return;
    }
    void WA(int P){
        wrong[P]++;
    }
    bool operator < (const Team& o)const {
        return correct!=o.correct?correct>o.correct:penalty!=o.penalty?penalty<o.penalty:id>o.id;
    }
};
void solve(){
    vector<Team> info(T);
    for(int i = 0; i < T;i++) info[i] = Team(i,P);
    for(int i = 0; i < R;i++){
        int tid,pid,time,msg;
        cin >> time >> tid >> pid >> msg;
        tid--; pid--;
        if(msg == 0){
            info[tid].AC(pid,time);
        }else{
            info[tid].WA(pid);
        }
    }
    sort(info.begin(),info.end());
    info.push_back(Team(INF,P)); info.rbegin()->penalty = INF;
    for(int i = 0; i < T;i++){
        cout << info[i].id+1;
        if(i+1==T) {cout << endl;}
        else if(info[i].correct > info[i+1].correct) cout << ",";
        else if(info[i].penalty < info[i+1].penalty) cout << ",";
        else cout << "=";
    }
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    while(cin >> M >> T >> P >> R,M){
        solve();
    }
    return 0;
}



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

const int MAX_N=1e5;

int N;
ll A[MAX_N],B[MAX_N];

int main(){
	scanf("%d",&N);
	REP(i,N){
		scanf("%lld %lld",&A[i],&B[i]);
	}
	ll ans=0;
	for(int i=N-1;i>=0;i--){
		A[i]+=ans;
		ans+=B[i]*((A[i]+B[i]-1)/B[i])-A[i];
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  vector<vector<int> > cnt(N, vector<int>(60));
  rrep(i, N) {
    if(i != N-1) {
      ll tmp = A[i+1];
      rep(j, 60) {
        cnt[i][j] = cnt[i+1][j] + (tmp % 2);
        tmp /= 2;
      }
    }
  }
  ll ans = 0;
  rep(i, N) {
    ll tmp = A[i];
    ll pow = 1;
    rep(j, 60) {
      if((tmp % 2) == 1) {
        ans += pow * (N-1-i-cnt[i][j]);
      } else {
        ans += pow * cnt[i][j];
      }
      ans %= mod;
      pow *= 2;
      pow %= mod;
      tmp /= 2;
    }
  }
  cout << ans << endl;
  return 0;
}


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

int main()
{
  string s;
  cin >> s;
  if(s == "A") cout << "T";
  if(s == "T") cout << "A";
  if(s == "C") cout << "G";
  if(s == "G") cout << "C";
  return 0;
}

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

int main(){
    int n;cin>>n;
    string a,b,c;
    cin>>a>>b>>c;
    int ans=0;
    for(int i=0;i<n;i++){
        set<char> st;
        st.insert(a[i]);st.insert(b[i]);st.insert(c[i]);
        if(st.size()==1)continue;
        if(st.size()==2)ans++;
        if(st.size()==3)ans+=2;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

int convert(int i, int j, int w) {
	return i*w+j;
}

std::pair<int,int> deconv(int i, int w) {
	std::pair<int,int> ret;
	ret.first=i/w;
	ret.second=i%w;
	return ret;
}

signed main() {
	int h,w;
	std::cin >> h >> w;
	std::vector<std::string> g(h);
	rep(i,h) std::cin >> g[i];
	int max = 0;

	rep(i,h) {
		rep(j,w) {
			if(g[i][j]=='.') {
				// bfs
				std::queue<std::pair<int,int> > que; // i, dist
				std::vector<int> went(h*w,false);
				que.emplace(convert(i,j,w),0);
				went[convert(i,j,w)]=true;
				while(!que.empty()) {
					auto tp = que.front(); que.pop();
					int xx = tp.first;
					int x = deconv(xx,w).first;
					int y = deconv(xx,w).second;
					int d = tp.second;
					max = std::max(d,max);
					for(int dx=-1;dx<=1;dx++) {
						for(int dy=-1;dy<=1;dy++) {
							if(dx*dy==0) {
								if(dx==0 && dy==0) continue;
								if(x+dx<0 || x+dx>=h) continue;
								if(y+dy<0 || y+dy>=w) continue;
								if(g[x+dx][y+dy]=='#') continue;
								if(went[convert(x+dx,y+dy,w)]) continue;
								went[convert(x+dx,y+dy,w)]=true;
								que.emplace(convert(x+dx,y+dy,w),d+1);
							}
						}
					}
				}
			}
		}
	}
	print(max);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int a,b,c,i;

    scanf("%d %d %d",&a,&b,&c);

    if(a>b){
      i = a;
      a = b;
      b = i;
    }
    if(b>c){
        i = b;
        b = c;
        c = i;
        if(a>b){
            i = a;
            a = b;
            b = i;
        }
    }
        printf("%d %d %d\n",a,b,c);

        return 0;
}

Measured memory_bytes: 1812
#include<bits/stdc++.h>
#define mx 100000
#define pb push_back
#define siz(v) v.size();
typedef unsigned long  ull;
typedef long long int lli;
using namespace std;

int main()
{
 	ios_base::sync_with_stdio(0);
 	cin.tie(0); cin.tie(0);
	
	double a;
	const double pi =3.14159;
	cin>>a;
	cout<<fixed<<setprecision(2)<<(2*pi*a)<<"\n";






 return 0;
 }


Measured memory_bytes: 3800
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        m: usize, d: usize,
    }
    let mut cnt = 0;
    for m_ in 1..m + 1 {
        for d_ in 1..d + 1 {
            let mut d1 = d_ % 10;
            let mut d10 = d_ / 10;
            if d1 >= 2 && d10 >= 2 && m_ == d1 * d10 {
                cnt += 1
            }
        }
    }

    println!("{}", cnt);
}


Measured memory_bytes: 4352
A,B = map(int,input().split())
count = 0
for i in range(A,B + 1):
  num =[]
  while i > 0:
    
    num.append(i % 10)
    i = i//10
  num.reverse()
  if num[0] == num[4] and num[1] == num[3]:
    count += 1
print(count)

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

int main() {
	long long N, A, B;
	cin >> N >> A >> B;

	vector<long long> H(N, 0);
	for (int i=0; i<N; i++) {
		cin >> H[i];
	}

	long long l = 0;
	long long r = 1<<30;

	for (;;) {
		long long m = (l+r)/2;
		long long sum = 0;

		for (int i=0; i<N; i++) {
			if (H[i] <= m * B) continue;
			sum += (H[i] - m*B - 1) / (A - B) + 1;
		}

		if (sum <= m) {
			r = m;
		} else {
			l = m + 1;
		}

		if (l == r) {
			cout << l << endl;
			return 0;
		}
	}
}


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

#ifdef _DEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif

using namespace std;

int main() {
    int N, X, Y;
    cin >> N >> X >> Y;
    for (int k = 1; k <= N - 1; ++k) {
        int64_t cnt = 0;
        for (int i = 1; i < N; ++i) {
            set<int> js;
            const auto f1 = [&](int j) { return j - i; };
            const auto f2 = [&](int j) { return abs(i - X) + 1 + abs(Y - j); };
            const auto f3 = [&](int j) { return abs(i - Y) + 1 + abs(X - j); };
            { 
                int j = k + i;
                if (i < j && j <= N && f2(j) >= k && f3(j) >= k) { js.insert(j); }
            }
            { 
                int t = k - abs(i - X) - 1;
                vector<int> jj({Y + t, Y - t});
                for (auto j : jj) {
                    if (0 <= t && i < j && j <= N && f1(j) >= k && f3(j) >= k) { js.insert(j); }
                }
            }
            { 
                int t = k - abs(i - Y) - 1;
                vector<int> jj({X + t, X - t});
                for (auto j : jj) {
                    if (0 <= t && i < j && j <= N && f1(j) >= k && f2(j) >= k) { js.insert(j); }
                }
            }
            // for (auto j : js) { cout << i << ", " << j << endl; }
            cnt += js.size();
        }
        cout << cnt << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
double p[6];
double q[6];
double ans = 1.0;
void test(double prob){
	double cur = 0;
	for(int i = 0; i < 6; i++){
		cur += max(prob*p[i],(1.0-prob)*q[i]);
	}
	ans = min(ans,cur);
}
int main(){
	for(int i = 0; i < 6; i++) cin >> p[i];	
	for(int i = 0; i < 6; i++) cin >> q[i];
	for(int i = 0; i < 6; i++) p[i] /= 100.0;
	for(int i = 0; i < 6; i++) q[i] /= 100.0;
	test(0);
	test(1);
	for(int i = 0; i < 6; i++){
		if(p[i] + q[i] < 0.00000001) continue;
		test((p[i])/(p[i]+q[i]));
		test((q[i])/(p[i]+q[i]));
	}
	printf("%.10lf\n", ans);

}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
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; }

using namespace std;

int main(){

    ll N, A, B;
    cin >> N >> A >> B;
    ll m = N / (A+B);
    ll n = N % (A+B);
    if (n < A) {
        cout << m * A + n << endl;
    } else {
        cout << m * A + A << endl;
    }

}

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

int main(){
  string ss,t;
  cin>>ss>>t;
  
  if(ss.size()<t.size()){
    cout << "UNRESTORABLE" << endl;
    return 0;
  }
  
  vector<string> res;
  for(int i=0;i<=ss.size()-t.size();i++){
    bool flag = false;
    string k = ss;
    rep(j,t.size()){
      if(k[i+j] == '?' || k[i+j] == t[j]){
        k[i+j] = t[j];
      }else{
        flag = true;
        break;
      }
    }
    if(flag) continue;
    rep(i,k.size()){
      if(k[i] == '?') k[i] = 'a';
    }
    res.pb(k);
  }
  
  if(res.size() == 0){
    cout << "UNRESTORABLE" << endl;
    return 0;
  }
  
  sort(res.begin(),res.end());
  
  cout << res[0] << endl;
}

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

#define rep(i,a,b)                for(ll i=a;i<b;i++)
#define re(i,b)                for(ll i=0;i<b;i++)
#define repr(i,n)                for(ll i=n-1;i>=0;i--)
#define ll long long
#define ld long double
#define pll std::pair<ll, ll> 
#define ppll std::pair<ll, pll>
#define vll std::vector<ll> 
#define vpll std::vector<pll> 
#define vppll std::vector<ppll> 
#define mll std::unordered_map<ll, ll> 
#define mpll std::unordered_map<pll, ll>
#define mppll std::unordered_map<ppll, ll>
#define sll std::set<ll>
#define ff first
#define ss second
#define msll std::multiset<ll>
#define all(c) c.begin(), c.end()
#define allr(c) c.rbegin(), c.rend()
#define srt(x) sort(all(x))
#define rsrt(x) sort(allr(x))
#define eb emplace_back
#define pb push_back
#define s(yy) ll yy;cin>>yy
#define len length()
#define sz size()
const ll mod = 1e9 + 7;
const ll INF = 0x7FFFFFFFFFFFFFFF>>1;

/*#################################################### 
#                                                    #
#                     @author                        #
#                  Parth Lathiya                     #
#      https://www.cse.iitb.ac.in/~parthiitb/        #
#                                                    #
####################################################*/

ll dp[87];

ll fun(ll n)
{
	if(dp[n]!=0)
		return dp[n];
	if(n==0)
		return dp[n]=2;	
	if(n==1)
		return dp[n]=1;
	return dp[n]=fun(n-1)+fun(n-2);
}
int main()
{

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

	#ifdef PARTH_LATHIYA_HOME

		freopen("B_in.txt","r",stdin);
	
		ll ttt,bkkk;
		cin>>ttt;
		bkkk=ttt;
		while(ttt--) {
			cout<<"Testcase - "<<bkkk-ttt<<"\n";
	#endif

//--------------------------------------------------------------------------------------

	s(n);
	cout<<fun(n);

//--------------------------------------------------------------------------------------
	
	#ifdef PARTH_LATHIYA_HOME
		cout<<"\n"; }
	#endif

	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 all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

const int MOD = 1e9 + 7;

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

    int a, b;
    cin >> a >> b;

    if(a <= b){
        cout << a << endl;
    }else{
        cout << a-1 << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
#include <queue>
using namespace std;
#define N 1000

int main(){
    int n,k;
    cin>>n>>k;
    if (n>=10) cout<<k<<endl;
    else cout<<k+100*(10-n)<<endl;
}

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

#define pb push_back
#define fst first
#define snd second
#define fill(a,c) memset(&a, c, sizeof(a))
#define fore(i,x,y) for(ll i=x;i<y;i++)
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

typedef long long ll;
using namespace std;

int main() {FIN;
    string s; cin>>s;
    int l = 0; int r = s.length()-1;
    int ans = 0;
    while(l < r){
        if(s[l] != s[r])
            ans++;
        l++; r--;
    }
    cout<<ans<<"\n";
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
    char S[10];
    int y,m,d;

    scanf("%s",S);
    y=atoi(strtok(S,"/"));
    m=atoi(strtok(NULL,"/"));
    d=atoi(strtok(NULL,"/"));
    if(y>=2019&&m>=5)
        printf("TBD");
    else
        printf("Heisei");

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n, m, L, R, a;
    cin>>n>>m;
    L=1;
    R=n;
    vector<int> l(m),r(m);
    for(int i;i<m;i++){
        cin>>l[i]>>r[i];
        if(L<l[i]){
            L=l[i];
        }
        if(R>r[i]){
            R=r[i];
        }
    }
    a=R-L+1;
    if(a>=0){
        cout<<a<<endl;
    }
    else{
        cout<<0<<endl;
    }
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 4e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

int main() {
    init();
    ll N;
    cin>>N;
    vl S(1 << N);
    rep(i, 1 << N) cin >> S[i], S[i] = -S[i];
    sort(all(S));

    vl P = {S[0]};
    multiset<ll> ms;
    repe(i, 1, 1 << N) ms.emplace(S[i]);

    rep(bit, N) {
        ll pn = P.size();
        rep(i, pn) {
            auto it = ms.upper_bound(P[i]);
            if (it == ms.end()) {
                cout << "No" << endl;
                return 0;
            }
            P.eb(*it);
            ms.erase(it);
        }
    }

    cout << "Yes" << endl;
}

Measured memory_bytes: 19668
x, y = map(int, input().split())

isYes = True

if y % 2 != 0:
    isYes = False

if x * 2 > y:
    isYes = False

if x * 4 < y:
    isYes = False

if isYes:
    print("Yes")
else:
    print("No")


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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
  string s,t="CODEFESTIVAL2016";
  int c=0;
  std::cin >> s;
  rep(i,s.size()){
    if(s[i]!=t[i]) c++;
  }
  cout << c << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define eb(k,v) emplace_back(k,v)
#define ct(res) cout << res << "\n";
#define vi vector<int>
#define vl vector<ll>
using namespace std;
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; }
const int INF = 1e9;
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;
ll gcd(ll a, ll b) {return (a%b) ? gcd(b, a%b) : b;}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int k,a,b;cin>>k>>a>>b;
    for(int i=a; i<=b; ++i) {
        if (i%k==0) {
            ct("OK");
            return 0;
        }
    }
    ct("NG");
}


Measured memory_bytes: 3648
#include<iostream>
using namespace std;
int main(){
    int n,b,f,r,v;
    cin>>n;
    int num[4][3][10]={};
    for(int i=0;i<n;i++){
        cin>>b>>f>>r>>v;
        num[b-1][f-1][r-1]+=v;
    }
    for(int x=0;x<4;x++){
        if(x)cout<<"####################"<<endl;
        for(int y=0;y<3;y++){
            for(int z=0;z<10;z++){
                cout<<" "<<num[x][y][z];
            }cout<<endl;
        }
    }return 0;
}


Measured memory_bytes: 3112
#include <iostream>
#include <stdlib.h>
#include <vector>
using namespace std;

int main(){
  int x, n;
  cin >> x >> n;
  if(n == 0){
    cout << x << endl;
    return 0;
  }
  vector<int> array;
  for(int i=0; i<n; ++i){
    int tmp;
    cin >> tmp;
    array.emplace_back(tmp);
  }
  int count = 0;
  while(true){
    for(int i=0; i<n; ++i){
      if(x-count == array[i]) break;
      if(x-count != array[i] && i == n-1){
        cout << x-count << endl;
        return 0;
      }
    }
    for(int i=0; i<n; ++i) {
      if(x+count == array[i]) break;
      if(x+count != array[i] && i == n-1){
        cout << x+count << endl;
        return 0;
      }
    }
    count ++;
  }
  return 0;
}



Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main() {
  int N;
  cin >> N;
  vector<int> A(N), B(N);
  for (int& i : A) {
    cin >> i;
  }
  for (int& i : B) {
    cin >> i;
  }
  ll res = 0;
  priority_queue<pair<int, int>> Q;
  for (int i = 0; i < N; i++) {
    if (B[i] != A[i]) {
      Q.emplace(B[i], i);
    }
  }
  while (!Q.empty()) {
    int v, p;
    tie(v, p) = Q.top();
    Q.pop();
    int l = B[(p - 1 + N) % N];
    int r = B[(p + 1) % N];
    int w = max(l, r);
    int s = l + r;
    if (A[p] >= w && (B[p] - A[p]) % s == 0) {
      res += (B[p] - A[p]) / s;
      B[p] = A[p];
    } else {
      int x = (v - w) / s + 1;
      B[p] -= x * s;
      res += x;
    }
    if (B[p] < A[p]) {
      return cout << -1 << endl, 0;
    }
    if (B[p] > A[p]) {
      Q.emplace(B[p], p);
    }
  }
  cout << res << endl;

  return 0;
}


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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const llint INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

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

    int ans = 0;
    for(int in=0;in<=100;in++) {
        if(a<=in&&in<=b&&c<=in&&in<=d) {
            ans++;
        }
    }
    if(ans > 0) ans--;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
using ll=long long;
using P=pair<int,int>;
#define rep(i,a,b) for(ll i=a;i<ll(b);i++)
#define repr(i,a,b) for(ll i=a;i>=ll(b);i--)
#define el '\n'
#define ALL(x) x.begin(),x.end()
#define ALLR(x) x.rbegin(),x.rend()
#define INF 1e9
#define DEBUG(x) cout<<"debug: "<<x<<endl
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(){
    int n; cin >> n;
    cout << (n + 1) / 2 << el;
    return 0;
}


Measured memory_bytes: 3140
N,M = map(int,input().split())
A = list(map(int,input().split()))
X = [list(map(int,input().split())) for _ in range(M)]
A.sort()
X.sort(key=lambda x:-x[1])

j = 0
for i in range(N):
    if X[j][1] < A[i]:
        break
    else:
        X[j][0] -= 1
        A[i] = X[j][1]
    if X[j][0] == 0:
        j += 1
    if j == M:
        break

print(sum(A))

Measured memory_bytes: 36076
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)
ll INF = 1LL << 60;

void solve(std::string s, long long K){
    ll N = s.length();
    set<string> rec;
    
    rep(i, N){
        
        for(ll j=1; j<=min(N-i, K); j++){
            rec.insert(s.substr(i, j));
        }
    }

    ll i=0;
    for(auto x:rec){
        if(i == K-1){
            cout << x << endl;
            break;
        }
        i++;
    }
}

int main(){
    std::string s;
    std::cin >> s;
    long long K;
    scanf("%lld",&K);
    solve(s, K);
    return 0;
}


Measured memory_bytes: 1664
#include <iostream>

using namespace std;

int main() {

	int n, p[10];
	cin >> n;

	int max = 100;
	int sum = 0;
	for (int i = 0; i < n; i++) {
	  cin >> p[i];
	  if (p[i] > max) {
	    max = p[i];
	  }
	  sum += p[i];		
	}
	cout << sum - max / 2 << endl;
	return 0;
}


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

void call(int n);
void call2(int n);

int main(void) {
    int n;
    
    cin >> n;
    
    call(n);
    
    return 0;
}


void call(int n){
    int i = 1;
    
CHECK_NUM:
    int x = i;
    if ( x % 3 == 0 ){
        cout << " " << i;
        goto END_CHECK_NUM;
    }
    
INCLUDE3:
    if ( x % 10 == 3 ){
        cout << " " << i;
        goto END_CHECK_NUM;
    }
    x /= 10;
    if ( x ) goto INCLUDE3;
    
END_CHECK_NUM:
    if ( ++i <= n ) goto CHECK_NUM;
    
    cout << endl;
}


void call2(int n) {
    for(int i=1; i<=n; i++) {
        if( (i % 3 == 0) || (i % 10 == 3) ) { //3????????° or 1?????????3
            cout << " " << i;
        } else {
            int x = i/10; //????¨????????????????????????°10??§?????£????¬???????????????§??????
            while(x) { //10??§?????£?????????0????????????x???10???????°????????????????????????§??°????????? => ??¨???????????§?????????????????¨?????????
                if( x % 10 == 3 ) {
                    cout << " " << i;
                }
                x /= 10;
            }
        }
    }
    
    cout << endl;
}

Measured memory_bytes: 3092
///cREATED bY BERNARB.01
#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;
typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
typedef priority_queue<int,vector<int>,greater<int>> pqil;
typedef priority_queue<int> pqig;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef priority_queue<pii> pqiig;
typedef vector<pii> vii;
typedef vector<piii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int, int> mii;
#define mid ((l+r)/2)
#define PB push_back
#define PP pop_back
#define PF push_front
#define DF pop_front
#define F first
#define S second
#define MP make_pair
#define C continue
#define B break
#define R return
#define sz(v) (int)(v).size()
#define len(s) (int)(s).length()
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define clr(arr, x) memset((arr), (x), sizeof (arr))
#define loop(n) for(int i=0; i<(n); i++)
#define lop(a, n) for(int i=(a); i<(n); i++)
#define jloop(n) for(ll j=0; j<(n); j++)
#define rloop(n) for(ll i=(n)-1; i>=0; i--)
#define sgm(y) (((y)*((y)+1))/2)
const ll INF = 2e17+423;
const ll mod = 1e9+7; //998244353;
const ld pi = acos(-1.0);
const ld cmpf = 1e-9;
//__int128_t
//      -ASCII-
//a -> z | A -> Z | 0 -> 9
//97 122 | 65  90 | 48  57
#define endl '\n'
ll po(ll,ll);















int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll k, x;
  cin >> k >> x;
  k*=500;
  if(k>=x) cout << "Yes";
  else cout << "No";
  R 0;
}
/*

*/




























































ll po(ll x, ll n){
  if(n==0) R 1;
  ll y = po(x, n/2);
  y = ((y)*(y));
  if(n%2) y = (y*(x));
  R y;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, K;
	cin >> N >> K;
	vector<int> A(N);
	int res = 0;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	sort(A.begin(), A.end());
	for (int i = 0; i < N; i++) {
		if (A[i] <= K) {
			res++;
			K -= A[i];
		}
		else {
			K = 0;
		}
	}
	if (K > 0)res--;
	if (res < 0)res = 0;
	cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define INF 1<<30
#define endl '\n'
#define maxn 100005
#define tc printf("Case %d: ", cs)
#define tcn printf("Case %d:\n", cs);
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
const double PI = acos(-1.0);

#define dbg1(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;
#define dbg4(w,x, y, z) cerr << #w << " = " << w << ", " <<#x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
	return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
	os << "{";
	for (auto it = v.begin(); it != v.end(); ++it) {
		if ( it != v.begin() ) os << ", ";
		os << *it;
	}
	return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
	os << "[";
	for (auto it = v.begin(); it != v.end(); ++it) {
		if ( it != v.begin()) os << ", ";
		os << *it;
	}
	return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
	os << "[";
	for (auto it = v.begin(); it != v.end(); ++it) {
		if ( it != v.begin() ) os << ", ";
		os << it -> first << " = " << it -> second ;
	}
	return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

clock_t tStart = clock();
#define timeStamp dbg("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)

void faltu () { cerr << endl; }

template <typename T>
void faltu( T a[], int n ) {
	for (int i = 0; i < n; ++i) cerr << a[i] << ' ';
	cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) { cerr << arg << ' '; faltu(rest...); }
// Program showing a policy-based data structure.
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less 
#include <iostream>
using namespace __gnu_pbds;
using namespace std;
// GNU link : https://goo.gl/WVDL6g
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;

/**___________________________________________________**/

map <string, int> mp;

int main()
{
	FASTIO
	/*
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
//*/
	int T;
	//scanf("%d", &T);
	T = 1;
	cin >> T;

	for (int cs = 1; cs <= T; cs++) {
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		mp[s]++;
	}
	ll ans = 0;
	for (auto x : mp) {
		ll cnt = x.second;
		ans += (ll) (cnt * cnt - cnt) / 2ll;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 11264
#include <bits/stdc++.h>
#define VI vector<int>
#define VVI vector<vector<int>>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
#define INF 1e18
#define All(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

int main() {
  int N;
  cin >> N;
  ll ans = 1;
  for (int i = 1; i < N + 1;i++){
    ans *= i;
    ans %= MOD;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
/*
ACplease
　　 ●
　　/⌒ヽ
　 ｜ 　|/⌒ヽ(ヽ
　 (｀　∥ー⌒) |
　|￣||￣￣￣￣￣|
　|―||―――――|
　|　Ｕ　　　　　|
　|￣￣￣￣￣￣￣|
　|＿＿＿＿＿＿＿|
　　|―――――|
　　|―――――|
ｗｗＷｗｗＷｗＷＷｗ
*/
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>
#include <cassert>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repe(i, n) for (int i = 0; i <= (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define KOZYUN(a) sort(all(a),greater<int>())
#define int ll
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORe(i, m, n) for(int i = m;i <= n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
#define IN(a) cin >> a
#define INT(a) int a; cin >> a
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}

//----------------------------------------------
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);
    srand((unsigned)time(NULL));
    
  	int n,m; cin >> n >> m;
    VI s(m);
	VI c(m);
	rep(i,m) cin >> s.at(i) >> c.at(i);
	rep(i,1000){
		string t = to_string(i);
		if(t.size() != n) continue;
		bool ok = true;
		rep(j,m){
			if(t[s[j] - 1] != c[j] + '0') ok = false;
		}
		if(ok){
			OUT(i);
			return 0;
		}
	}
	OUT(-1);

    return 0;
}

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

int main(){
  int s;
  cin >> s;
  if (s<3){
    cout << 4 << endl;
    return 0;
  }
  int n=1;
  while (s!=1){
    s=s%2==0?s/2:s*3+1;
    n++;
  }
  cout << n+1 << endl;
  return 0;
}


Measured memory_bytes: 256