akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <unistd.h>
#define ll long long
#define inf 1000000007
#define inf16 0x3f3f3f3f
#define INF 1000000000000000007LL
#define VI vector<int>
#define VPII vector<pair<int, int> >
#define VLL vector<ll>
#define PII pair<int, int>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define endl '\n'
#define ALL(c) (c).begin(), (c).end()
using namespace std;
 
const int N = 1e5+7;

int n;

int x[N];
int y[N];
int t[N];

int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	cin >> n;

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

		if(abs(x[i]-x[i-1])+abs(y[i]-y[i-1])>t[i]-t[i-1] || (abs(x[i]-x[i-1])+abs(y[i]-y[i-1]))%2!=(t[i]-t[i-1])%2)
		{
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;
}

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

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define fst first
#define snd second

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

    if(s == "Sunny")
        cout << "Cloudy";
    else if(s == "Cloudy")
        cout << "Rainy";
    else
        cout << "Sunny";

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

void print(int a[8][8]){
    int i,j;
    for(i=0;i<8;i++){
        for(j=0;j<8;j++){
            if(a[i][j]==0){
                printf(".");
            }else{
                printf("Q");
            }
        }
        printf("\n");
    }
}

int exist(int i,int j,int a[8][8]){
    if(existT(j,a)==1){return 1;}
    if(existN1(i,j,a)==1){return 1;}
    if(existN2(i,j,a)==1){return 1;}
    return 0;
}

int existT(int j,int a[8][8]){
    int i;
    for(i=0;i<8;i++){
        if(a[i][j]==1){
            return 1;
        }
    }
    return 0;
}

int existN1(int i,int j,int a[8][8]){
    if(i>j){
        i-=j;j=0;
    }else{
        j-=i;i=0;
    }
    while(i<8&&j<8){
        if(a[i][j]==1){
            return 1;
        }
        i++;j++;
    }
    return 0;
}

int existN2(int i,int j,int a[8][8]){
    if(i>7-j){
        i-=(7-j);j=7;
    }else{
        j+=i;i=0;
    }
    while(i<8&&j>=0){
        if(a[i][j]==1){
            return 1;
        }
        i++;j--;
    }
    return 0;
}

int search(int i,int a[8][8]){
    int j,flg=0;
    for(j=0;j<8;j++){
        if(a[i][j]==1){
            flg=1;break;
        }
    }
    if(flg==1){
        if(i==7){print(a);return 1;}
        return search(i+1,a);
    }else{
        flg=0;
        for(j=0;j<8;j++){
            if(exist(i,j,a)==1){continue;}
            a[i][j]=1;
            if(i==7){print(a);return 1;}
            if(search(i+1,a)==1){return 1;}
            a[i][j]=0;
        }
    }
    return 0;
}

int main(void){
    int a[8][8];
    int n,i,j,k;
    scanf("%d",&n);
    for(i=0;i<8;i++){
        for(j=0;j<8;j++){
            a[i][j]=0;
        }
    }
    for(i=0;i<n;i++){
        scanf("%d",&j);
        scanf("%d",&k);
        a[j][k]=1;
    }
    search(0,a);
}



Measured memory_bytes: 2144
use std::io;
use std::collections::HashMap;
use std::mem;
use std::cmp;

fn read_line() -> String{
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s
}

fn read_ints() -> Vec<i64>{
    let s = read_line();
    let split:Vec<&str> = s.trim().split(" ").collect();
    split.iter().map(|&x| x.to_string().parse().unwrap()).collect()
}

fn f( n : i64 ) -> i64{
    if n == 0 {
        0
    }else{
        n % 10 + f(n/10)
    }
}

fn main(){
    let n = read_ints()[0];
    
    if n % f(n.clone()) == 0{
        println!("Yes");
    }else{
        println!("No");
    }
}







/*
DOCS


let mut h = HashMap::new();
let a = 5;
h.insert(a,true);
match h.get(&a){
    Some(v) => println!("{}",v),
    None    => println!("none"),
}


use std::mem;

let mut x = 5;
let mut y = 1;
mem::swap(&mut x,&mut y);


let v = vec![0;2]; // [0,0]







*/

Measured memory_bytes: 4352
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const int INF = 10000;

struct edge{int to,cost;};
typedef pair<int,int> P;//firstは最短距離,secondは頂点番号

int main(){
	int n,m;
	int taro[100],hana[100];
	
	while(cin>>n>>m){
		if(n==0&&m==0)break;
		int sumn=0,summ=0;
		REP(i,n){
			cin>>taro[i];
			sumn+=taro[i];
		}
		REP(i,m){
			cin>>hana[i];
			summ+=hana[i];
		}
		PII pi=MP(-1,-1);
		int sum=100000;
		REP(i,n)REP(j,m){
			if(sumn-taro[i]+hana[j]==summ-hana[j]+taro[i]&&taro[i]+hana[j]<sum){
				sum=taro[i]+hana[j];
				pi=MP(taro[i],hana[j]);
			}
		}
		if(pi.first==-1){
			cout<<-1<<endl;
		}else{
			cout<<pi.first<<" "<<pi.second<<endl;
		}
	}
	return 0;
}

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

#define copy(from, to) copy(from.begin(), from.end(), back_inserter(to));
#define sort(a) sort(a.begin(), a.end())

using namespace std;

int main() {
  string s, t;
  cin >> s >> t;
  if (s[0] == t[2] && s[1] == t[1] && s[2] == t[0]) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
 
typedef long long ll;
typedef pair<int, int> ii;

int main() {
	
	int a, l, x;
	while(cin >> a >> l >> x){
		double ans = 0;
		double s = (a + l + l) / 2.0;
		ans += sqrt(s * (s-a) * (s-l) * (s-l));
		s = (4 * l + x + x) / 4.0;
		ans += (2 * sqrt(s * (s-l) * (s-((l + x)/2.0)) * (s-((l + x)/2.0)) ) );

		printf("%.6lf\n", ans);
	}

	return 0;
}

Measured memory_bytes: 3188
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <iomanip>


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define rep(i, a, b) for (int i=a; i<(b); i++)
#define rp(i, a) for (int i=0; i<(a); i++)
#define repd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define rpd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout << std::setprecision(9);
    cout << std::fixed;

    ll w,h,n;
    cin >> w >> h >> n;
    ll x[n],y[n],a[n];
    rp(i,n) cin >> x[i] >> y[i] >> a[i];
    ll xtoInf = w;
    ll xto0 = 0;
    ll ytoInf = h;
    ll yto0 = 0;

    rp(i,n){
        if(a[i] == 1) xto0 = max(xto0,x[i]);
        if(a[i] == 2) xtoInf = min(xtoInf,x[i]);
        if(a[i] == 3) yto0 = max(yto0,y[i]);
        if(a[i] == 4) ytoInf = min(ytoInf,y[i]);
    }
    // cout << "x : " <<xtoInf << " - "<<xto0<<endl;
    // cout << "y : " <<ytoInf << " - "<<yto0<<endl;
    cout << max((xtoInf - xto0),0ll)*max((ytoInf - yto0),0ll)<<endl;

    return 0;
}

// read the question correctly (ll vs int)
// template by super1 derived from bqi343


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define rando mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define fi first
#define se second
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define debugii(x) cerr << " - " << #x << ": " << x.fi<<","<<x.se << endl;
#define sep() cerr << "--------------------" << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define int ll
#define ii pair<int,int>
#define v vector<int>
#define vii vector<ii>
#define vv vector<vector<int> >
#define mp make_pair
#define INF 1000000000
#define pb push_back
#define EPS 1e-9
const int MOD = 1000000007; // 998244353
int32_t main(){
	boost;
	int a,b;
	cin>>a>>b;
	int c=1LL,ans=0;
	for (int i = 0; i <= 1000; ++i)
	{
		c*=a;
		ans+=(pow(a,i));
		if(c>=b){break;}
	}
	for (int i = 0; i <= 1000; ++i){
		if((c-(a-1))<b)break;
		ans--;
		c-=(a-1);
	}
	cout<<ans;
	return 0;
}
//long long
//array bounds
//special cases
//binary search

Measured memory_bytes: 384
//Created Time:2020年03月24日 星期二 09时16分09秒
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long
#define N 200005
#define Print return printf("%lld\n", ans), 0

using namespace std;

struct Node{
	int val, id, op;
	Node(int V = 0, int I = 0, int O = 0){
		val = V, id = I, op = O;
		return ;
	}

	bool operator < (Node x){
		return val < x.val;
	}
}p[N];

int n;
ll ans;
bool vis[N][2];

int main(){
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i){
		int x, y; scanf("%d%d", &x, &y);
		p[i * 2 - 1] = Node(x, i, 0);
		p[i * 2 - 0] = Node(y, i, 1);
	} sort(p + 1, p + 1 + 2 * n);
	bool flag = false;
	for(int i = 1; i <= n; ++i){
		ans += p[i].val, vis[p[i].id][p[i].op] = true;
		if(vis[p[i].id][p[i].op ^ 1]) flag = true;
	}
	if(flag) Print; flag = true;
	for(int i = 2; i <= n; ++i)
		if(vis[i][0] ^ vis[i - 1][0]) flag = false;
	if(flag) Print; ans -= p[n].val;
	if(p[n + 1].id != p[n].id) ans += p[n + 1].val;
	else ans += min(p[n + 1].val + p[n].val - p[n - 1].val, p[n + 2].val);
	Print; return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 i = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define STRINGIFY(n) #n
#define TOSTRING(n) STRINGIFY(n)
#define PREFIX "#" TOSTRING(__LINE__) "| "
#define debug(x) \
{ \
  std::cout << PREFIX << #x << " = " << x << std::endl; \
}

std::ostream& output_indent(std::ostream& os, int ind) {
  for(int i = 0; i < ind; i++) os << " ";
  return os;
}

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p);
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v);

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p) {
  return (os << "(" << p.first << ", " << p.second << ")");
}
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  os << "[";
  for(int i = 0;i < v.size();i++) os << v[i] << ", ";
  return (os << "]");
}

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) { return std::vector<T>(n, std::forward<T>(val)); }
template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}
template<class Cond> struct chain {
  Cond cond; chain(Cond cond) : cond(cond) {}
  template<class T> bool operator()(T& a, const T& b) const { if(cond(a, b)) { a = b; return true; } return false; }
};
template<class Cond> chain<Cond> make_chain(Cond cond) { return chain<Cond>(cond); }

int main() {
  i64 N;
  cin >> N;
  vector<i64> A(N);
  rep(i,0,N) {
    cin >> A[i];
  }
  auto chmin = make_chain(std::greater<i64>());
  auto func = [&chmin](i64 N, const vector<i64>& A, i64 mns) {
    const int H = 16;
    auto dp = ndvec(N + 1, H, i64(1LL << 60));
    rep(i,0,H) {
      dp[N][i] = 0;
      dp[N - 1][i] = 2 * i + mns;
    }
    for(int i = N - 1; i --> 0;) {
      i64 alpha = A[i];
      for(int j = 0; j < H; j++) {
        i64 beta = A[i + 1];
        i64 cnt = 0;
        while(alpha > beta) {
          beta *= 4;
          cnt++;
        }
        i64 bck = 0;
        if(cnt >= H) {
          bck = (cnt - H + 1) * 2 * (N - i - 1);
          cnt = H - 1;
        }
        chmin(dp[i][j], dp[i + 1][cnt] + 2 * j + bck + mns);
        alpha *= 4;
      }
    }
    return dp;
  };
  auto rdp = func(N, A, 0);
  reverse(all(A));
  auto ldp = func(N, A, 1);
  i64 ans = i64(1LL << 60);
  for(int i = 0;i <= N;i++) {
    i64 res = rdp[i][0] + ldp[N - i][0];
    chmin(ans, rdp[i][0] + ldp[N - i][0]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 70572
#include <stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int a[3005];
	int i;
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	int max=0;
	for(i=0;i<n;i++)
		max+=a[i]-1;
	printf("%d\n",max);
	return 0;
}

Measured memory_bytes: 128
// template {{{
#include <bits/stdc++.h>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define sz(c) (static_cast<int>(c.size()))
#define endl "\n"

using ld = long double;
using ll = long long;

inline ll addm(ll __a, ll __b, ll __m);
inline ll subm(ll __a, ll __b, ll __m);
inline ll mulm(ll __a, ll __b, ll __m);
ll powm(ll __a, ll __b, ll __m);
ll inv(ll __x, ll __m);
// }}}

const ll INFL = numeric_limits<ll>::max() / 2;
const ll INF = numeric_limits<int>::max() / 2;
ll MOD;

const int N = 1e5 + 5;
ll cnt[N], ans[N];
vector<int> edge[N];
ll dp(int v, int p = -1)
{
    ll &ret = cnt[v];
    ret = 1;
    for (int u: edge[v]) {
        if (u == p) continue;
        ret = (ret * (1 + dp(u, v))) % MOD;
    }
    return ret;
}

void dfs(int v, ll pc = 0, int p = -1)
{
    /* cerr << "S: " << v << " " << pc << " " << cnt[v] << endl; */
    ans[v] = cnt[v] * (1 + pc) % MOD;

    vector<int> ch;
    for (int u: edge[v]) {
        if (u == p) continue;
        ch.push_back(u);
    }
    int n = sz(ch);
    vector<ll> pre(n), suf(n);
    for (int i = 0; i < n; i++) {
        int u = ch[i];
        pre[i] = 1 + cnt[u];
        if (i) pre[i] = (pre[i] * pre[i-1]) % MOD;
    }
    for (int i = n-1; i >= 0; i--) {
        int u = ch[i];
        suf[i] = 1 + cnt[u];
        if (i+1 < n) suf[i] = (suf[i] * suf[i+1]) % MOD;
    }
    for (int i = 0; i < n; i++) {
        int u = ch[i];
        ll left = (i) ? pre[i-1] : 1, right = (i+1 < n) ? suf[i+1] : 1;
        /* cerr << v << " " << left << " " << right << endl; */
        dfs(u, (1 + pc) * (left * right % MOD) % MOD, v);
    }
}

void solve()
{
    int n; cin >> n >> MOD;
    for (int i = 0; i < n-1; i++) {
        int x, y; cin >> x >> y;
        --x; --y;
        edge[x].push_back(y);
        edge[y].push_back(x);
    }
    dp(0);
    dfs(0);
    for (int i = 0; i < n; i++) {
        cout << ans[i] << endl;
    }
}

// main {{{
int main()
{
    cin.sync_with_stdio(0); cin.tie(NULL);
    solve();
    return 0;
}

inline ll addm(ll __a, ll __b, ll __m = MOD) {
    return ((__a+__b)%__m);
}
inline ll subm(ll __a, ll __b, ll __m = MOD) {
    return (((__a-__b)%__m+__m)%__m);
}
inline ll mulm(ll __a, ll __b, ll __m = MOD) {
    return ((__a*__b)%__m);
}
ll powm(ll __a, ll __b, ll __m = MOD) {
    ll ret = (!__b) ? 1 : powm(__a, __b/2, __m);
    return (!__b) ? 1 : mulm(mulm(ret, ret, __m), (__b%2) ? __a : 1, __m);
}
ll inv(ll __x, ll __m = MOD) {
    return powm(__x, __m-2, __m);
}
// }}}


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

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define F first
#define S second

const int maxn = 102, INF = 1e9;
int n, m, dp[maxn][maxn], ans;
char s[maxn][maxn];

int32_t main() {
	IOS;
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) cin >> s[i][j];//, cout << s[i][j];
	}
	for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) dp[i][j] = INF;
	dp[0][0] = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
	//		cout << dp[i][j] << ' ';
			if(i + 1 < n) {
				int cnt = 0;
				if(s[i][j] != s[i + 1][j]) cnt = 1;
				dp[i + 1][j] = min(dp[i][j] + cnt, dp[i + 1][j]);
			}
			if(j + 1 < m) {
				int cnt = 0;
				if(s[i][j] != s[i][j + 1]) cnt = 1;
				dp[i][j + 1] = min(dp[i][j] + cnt, dp[i][j + 1]);
			}
		}
	//	cout << '\n';
	}
	ans = dp[n - 1][m - 1] / 2;
	ans += ((s[0][0] == '#') |	(s[n - 1][m - 1] == '#'));
	cout << ans;
	return 0;
}



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

using namespace std;

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

    double ans = 0.0;
    for(int i=1; i<=N; ++i){
        if(i>=K){
            ans += 1.0;
        }else{
            ans += 1.0/pow(2, ceil(log2(K*1.0/i)));
        }
    }
    cout<<setprecision(10)<<ans/N<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <list>
#include <string>
int main() {
	int n;
	std::cin >> n;
	std::vector<std::string> strings(n);
	for (auto &s : strings) {
		std::cin >> s;
	}
	std::list<int> list;
	for (auto a = 0; a < n; ++a) {
list.push_back(a);
	}
	for (auto i = 0; i < n; ++i) {
		list.remove_if([i, n, &strings](const int a){ 
			for (auto j = 0; j < n; ++j) {
				if (strings[i][j] != strings[(j + n - a) % n][(i + a + n) % n]) return true;
			}
			return false;
		});
	}
	std::cout << list.size() * n << std::endl;
}

Measured memory_bytes: 384
from itertools import permutations as p


def main():
    N = int(input())
    P = list(map(int, input().split(" ")))
    Q = list(map(int, input().split(" ")))
    l = []
    for i in range(1, N + 1):
        l.append(i)
    ints = []
    for k in p(l, N):
        ints.append(list(k))
    print(abs(ints.index(P) - ints.index(Q)))


if __name__ == '__main__':
    main()

Measured memory_bytes: 10228
#include <bits/stdc++.h>
#define FOR(i,a,b) for(LL i=(a);i<(LL)(b);i++)
#define REP(i,b) FOR(i,0,b)
#define ALL(c) c.begin(),c.end()
#define PB push_back
#define FF first
#define SS second
#define cat //cout << __LINE__ << endl;
using namespace std;
typedef long long LL;
typedef double ld;
typedef LL ut;
typedef vector<ut> VI;
typedef pair<ut,ut> pr;
typedef pair<ut,pr> ppr;
typedef vector<pr> Vpr;
typedef priority_queue<pr,Vpr> PQ;
const ut INF=1LL<<60;
const LL p=3+1e6;
const int SIZE=105;
map<pr,LL> maps;
int main(){
	LL H,W,N,a,b;
	cin >> H >> W >> N;
	LL ans[10]={};
	ans[0]=(H-2)*(W-2);
	cin.tie(0);
	REP(i,N){
		cin >> a >> b;
		FOR(i,a-1,a+2) FOR(j,b-1,b+2){
			if(2<=i && i<=H-1 && 2<=j && j<=W-1)
				maps[pr(i,j)]=maps[pr(i,j)]+1;
		}
	}
	for(auto it=maps.begin();it!=maps.end();++it){
		ans[(*it).second]++;
		ans[0]--;
	}
	REP(i,10) cout << ans[i] << endl;
	return 0;
}


Measured memory_bytes: 56448
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(new InputStreamReader(System.in));
		int a = s.nextInt();
		a = a + (a*a) + (a*a*a);
		System.out.println(a);
	}
}

Measured memory_bytes: 35568
#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
using namespace std;
int main()
{
	//int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
	long a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, ans = 0;
	//cout << LONG_MAX << endl;
	//string s[1001];
	long x[100001];
	cin >> a;
	for ( b = 0; b < a; b++)
	{
		cin >> x[a];
		while (x[a] % 2 == 0)
		{
			x[a] /= 2;
			ans++;
		}
	}


	cout<<ans <<endl;




	//cout << ans << endl;
	return 0;
}

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

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define rep(i,N) for(int i=0;i<(int)N;++i)

ll GCD(ll x, ll y) {
    if (y == 0) return x;
    else return GCD(y, x % y);
}

ll LCM(ll x, ll y) {
    return x / GCD(x, y) * y;
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

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

    vector<ll> A(N);
    rep(i, N) cin >> A[i];

    int j = 0;

    while (1) {
        rep(i, N) { if (A[i] % 2 == 1) { goto xyz; } }
        rep(i, N) { A[i] /= 2; }
        ++j;
    }

    xyz:;

    cout << j << endl;

}

Measured memory_bytes: 256
a,b,c,x,y = map(int,input().split())
ans = 0

if (a + b)/2 > c :
    price_min = c * min(x,y) * 2
    price_max = c * max(x,y) * 2

    if x-y > 0:
        price = a*(x-y) + price_min
    else:
        price = b*(y-x) + price_min

    if price > price_max:
        ans = price_max
    else:
        ans = price

else:
    ans = a * x + b * y

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
typedef long long int ll;
typedef long double ld;
#define PI 3.141592653589793
#define MOD 1000000007
#define ALL(obj) (obj).begin(),(obj).end()
template<class T>inline bool chmax(T& a,T b){if (a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T& a,T b){if (a>b){a=b;return 1;}return 0;}
const ll INF = 1LL << 56;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
bool pairCompareSecond(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.second < secondElof.second;
}
//四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

struct edge{//グラフに使うヤツ
    ll from,to,cost;
};

typedef vector<vector<edge> > G;
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}

int main(){
    ll n;
    cin >> n;
    string s;
    cin >> s;
    ll ans=0;
    ll r=n-1;
    for (ll i=0;i<n;i++){
        if (s[i]=='W'){
            for (;r>i;r--){
                if (s[r]=='R'){
                    s[i]='R';
                    s[r]='W';
                    ans++;
                    break;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) { vec.resize(len); for (auto &v : vec) ndarray(v, args...); }
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;
 

int main()
{
    int N, M;
    cin >> N >> M;
  	int V = stoi(to_string(N) + to_string(M));
    int i = 1;
  while (i * i < V) i++;
  cout << (i * i == V ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
num = [True]*100001
num[0] = num[1] = False
for i in range(2,317):
  if num[i]:
    for j in range(i**2, 100000, i):
      num[j] = False

c = [0]*100002
for i in range(3, 100001, 2):
  if (num[i]) and (num[int((i+1)/2)]):
    c[i] = c[i] + 1

for i in range(3, 100001):
  c[i] = c[i] + c[i-1]

for i in range(int(input())):
  _input = input().split(' ')
  print(c[int(_input[1])] - c[int(_input[0])-1])

Measured memory_bytes: 8948
#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
ll MOD=1e9+7;
#define INF 2*1e9
#define N 200000
using namespace std;

int d[50][N];
int n,x[N];
int a,b;
    bool check(int left,int right){
        int mid=(left+right)/2;
        int t=mid,now=a;
        rep2(i,1,40){
            if(t%2){
                now=d[i][now];
            }
            t>>=1;
        }
        return now>=b;
    }
    void calc(int a){
        rep(i,n){
            d[a][i]=d[a-1][d[a-1][i]];
        }
        return;
    }
main(){
    
    cin>>n;
    rep(i,n) cin>>x[i];
    int l,q;cin>>l>>q;
    
    rep(i,n){
        d[1][i]=upper_bound(x,x+n,x[i]+l)-x;
        d[1][i]--;
    }
    rep2(i,2,40)calc(i);
    rep(iii,q){
        cin>>a>>b;
        a--;b--;
        if(a>b) swap(a,b);
        int m=1,M=2e5;
        while(m+1<M){
            if(check(m,M)) M=(m+M)/2;
            else m=(m+M)/2;
        }
        cout<<(check(m,m)?m:M)<<endl;
    }
    return 0;
}

Measured memory_bytes: 32384
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();
		int count = 0;

		for (int i = A; i <= B; i++) {
			String temp = String.valueOf(i);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		}
		System.out.println(count);
	}
}


Measured memory_bytes: 31188
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <random>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;
typedef long long ll;

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

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N,K;
  cin>>N>>K;
  vector<ll> x(N);
  REP(i,N)cin>>x[i];
  ll ans=INFLL;
  REP(i,N-K+1){
    //左端を0からN-K-1まで探索
    //左端に先に行ってから
    chmin(ans,abs(x[i])+x[i+K-1]-x[i]);
    chmin(ans,abs(x[i+K-1])+x[i+K-1]-x[i]);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

//ok
struct BIT{
    ll N;
    vector<ll> bit;
    BIT(ll N) : bit(N+1),N(N){};

    ll sum(ll i){
        ll s = 0;
        while(i>0){
           s += bit[i];
           i -= i& -i;
        }
        return s;
    }

    void add(ll i,ll x){
        while(i <= N){
            bit[i] += x;
            i += i & -i;
        }
    }
};

//数列の値の範囲を[1,n]に変える
vector<ll> convert_array(vector<ll> z){
    ll n = z.size();
    vector<ll> temp = z;
    sort(all(temp));
    for(int i = 0; i < n; i++){
        z[i] = lower_bound(all(temp), z[i]) - temp.begin() + 1;
    }
    return z;
}

//反転数を求める
ll inverse_number(vector<ll> z){
    ll n = z.size();
    ll inv_num = 0;
    z = convert_array(z);

    BIT b(n);
    for(int i = 0; i <= n; i++){
        b.bit[i] = 0;
    }

    for(int i = 0; i < n; i++){
        inv_num += i - b.sum(z[i]);
        b.add(z[i],1);
    }

    return inv_num;
}

bool check(ll x,vector<ll> z){
    ll n = z.size();
    vector<ll> b(n);
    for(int i = 0; i < n; i++){
        if(z[i] >= x) b[i] = 1;
        else b[i] = -1;
    }
    vector<ll> s(n+1,0);
    for(int i = 1; i <= n; i++){
        s[i] = s[i-1] + b[i-1];
    }

    return (n*(n+1)/2 - inverse_number(s)) >= (n*(n+1)/2+1)/2;
}

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    ll low = *min_element(all(a))-1, high = *max_element(all(a))+1;

    while(high - low > 1){
        ll mid = (low+high)/2;
        if(check(mid,a)) low = mid;
        else high = mid;
    }

    cout << low << endl;

    return 0;
}

Measured memory_bytes: 5760
n = int(input())
MOD = 10**9 + 7

p = [True for i in range(n+1)]
ret = 1
for i in range(2, n+1):
    if not p[i]:
        continue
    for j in range(n//i + 1):
        p[i*j] = False
    j = 1
    cnt = 1
    while i**j <= n:
        cnt += n//(i**j)
        j += 1
    ret = (ret * cnt) % MOD
print(ret)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ll long long
using namespace std;
inline int read(){int w=1,s=0;char ch=getchar();while(!isdigit(ch)){if(ch=='-')w=-1;ch=getchar();}while(isdigit(ch)){s=s*10+ch-'0';ch=getchar();}return w*s;}
inline int digit(ll a)
{
	ll res=0;while(a) res+=(a%10),a/=10;
	return res; 
}
inline bool cmp(ll a,ll b)
{
	if(a*digit(b)!=b*digit(a)) return a*digit(b)<b*digit(a);
	return a<b;
}
inline ll get(ll cur)
{
	vector<ll> ans;
	ll a=10,b=9;
	ll t=cur;
	ans.push_back(cur);
	while(t)
	{
		t/=10;
		ans.push_back(cur-cur%a+b);
		a*=10;
		b*=10;
		b+=9;
	}
	sort(ans.begin(),ans.end(),cmp);return ans[0];
}
int main()
{
	int k; 
	cin>>k;
	ll cur=0;
	while(k--)
	{
		cur=get(cur+1);
		cout<<cur<<"\n";
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define PP pair<P,P>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;
template<class T> inline void chmax(T& a, T b) { a = max(a, b); }
template<class T> inline void chmin(T& a, T b) { a = min(a, b); }

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 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 > 0) {
		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;
}
int get_rand(int MIN, int MAX) {
	random_device rnd;
	mt19937_64 mt64(rnd());
	uniform_int_distribution<int>engine(MIN, MAX);
	return engine(mt64);
}
/*--------Library Zone!--------*/

int n;
set<int>st;
signed main() {
	cin >> n;
	rep(i, n) {
		int a; cin >> a; st.insert(a);
	}
	if (st.size() % 2)cout << st.size() << endl;
	else cout << st.size() - 1 << endl;
}

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

int main() {
    int N, M;
    cin >> N >> M;

    //穴の開いた階段をfalseにする
    vector<int> oks(N + 1, true);
    for (int i = 0; i < N; i++)
    {
        int a;
        cin >> a;
        oks[a] = false;
    }
    
    vector<long long int> dp(N + 1);
    dp[0] = 1;
    for (int i = 0; i < N; i++)
    {
        for (int j = i + 1; j <= min(N, i + 2); j++)
        {
            if (oks[j])
            {
                dp[j] += dp[i];
                dp[j] %= mod;
            }
            
        }
        
    }
    
    cout << dp[N] << endl;
    return 0;
}

Measured memory_bytes: 1408
#include<iostream>
#include<set>
#include <bitset>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include <cstdio>
#include<algorithm>
#include <sstream>
#include<string.h>
#include <cmath>
#include <iomanip>
#include <string>
#include<list>
#include <limits>
#include <numeric>
#include <type_traits>
#define int long long
#define ll long long
#define mod  1000000007
#define MOD  1000000007
#define inf 1e17
#define rep(i,j,n) for(int i=j;i<n;i++)
#define P pair<int,int>
#define ps push_back
#define all(x) x.begin(),x.end()
double pi = 3.141592653589793;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//ここから始めよう
int n,k;
#define mat vector<vector<int>> 
mat mul(mat v,mat t){
    mat ret(n,vector<int>(n));
    rep(i,0,n){
        rep(k,0,n){
            rep(j,0,n)(ret[i][j]+=v[i][k]*t[k][j])%=mod;
        }
    }
    return ret;
}
mat fact(mat v,int k){
    mat ans(n,vector<int>(n));
    rep(i,0,n)ans[i][i]=1;
    while(k>0){
        if(k&1)ans=mul(ans,v);
        v=mul(v,v);k>>=1;
    }
    return ans;
}
signed main(){
    cin>>n>>k;
    mat v(n,vector<int>(n));
    rep(i,0,n)rep(j,0,n)cin>>v[i][j];
    mat ans=fact(v,k);
    int res=0;
    rep(i,0,n)rep(j,0,n){
        res=(res+ans[i][j])%mod;
    }cout<<res<<endl;return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(){
    long long n;
    string s;
    cin >> n >> s;
    vector<long long> v(n+1);
    long long black = 0;
    for(long long i = 0; i < n;i++){
        if(s[i] == '#')
            black++;
    }
    v[n] = black;
    for(long long i = n-1; i >= 0;i--){
        if(s[i] == '.')
            v[i] = v[i+1] + 1;
        if(s[i] == '#')
            v[i] = v[i+1] - 1;
    }
    long long min = n;
    for(long long i = 0; i <= n;i++){
        // cout << v[i] << " ";
        if(v[i] < min)
            min = v[i];
    }
    // cout << endl;
    cout << min << endl;
}


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

using namespace std;
int main()
{
    int y,m,d;
    char a,b;
    cin>>y>>a>>m>>b>>d;
    if(m <= 04){
        cout<<"Heisei";
    }
    else{
        cout<<"TBD";
    }
    return 0;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(int i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[4]={0,1,0,-1},mdy[4]={-1,0,1,0};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n;
vector<Pi> abc[100100];
ll dis[100100];
int q,k;

int main(){
	cin>>n;
	REP(i,100100)dis[i]=-1;
	REP(i,n-1){
		int a,b,c;
		cin>>a>>b>>c;
		abc[a].push_back(Pi(b,c));
		abc[b].push_back(Pi(a,c));
	}
	cin>>q>>k;

	dis[k]=0;
	queue<int> q1;
	q1.push(k);
	while(q1.size()){
		int now=q1.front();q1.pop();
		for(int i=0;i<abc[now].size();i++){
			int _next=abc[now][i].first;
			int cost=abc[now][i].second;
			if(dis[_next]!=-1)continue;
			dis[_next]=dis[now]+cost;
			q1.push(_next);
		}
	}
	REP(i,q){
		int x,y;
		cin>>x>>y;
		cout<<dis[x]+dis[y]<<endl;
		
	}
	return 0;
}

Measured memory_bytes: 9984
N = int(input())
x = 0
y = 0
t = 0
ans = 0
for i in range(N):
    tt,xx,yy = map(int,input().split())
    t1 = tt -t 
    x1 = abs(xx-x)
    y1 = abs(yy-y)
    if x1 + y1 > t1:
        ans = 1
        #break
    elif (t1 - (x1 + y1) ) % 2 == 1:
        ans = 1
        #break
    t = tt
    x = xx
    y = yy
if ans == 0:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>
#include <stdbool.h>
int main(){
 
   char T[11];

  char S[11];
   scanf("%s",S);

   scanf("%s",T);
   


 bool ok = true;
 for (int i = 0; i < strlen(S); i++)
{
   if (S[i] != T[i]) {
      ok = false;
   }
}
if (ok)
{
    printf("Yes");
}else{
  printf("No");
}
   
    return 0;
}


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

using namespace std;

using ll = long long;

#define ALL(A) A.begin(),A.end()

set<ll> divider(ll A)
{
    set<ll> answer;
    for(int i=1;i<=sqrt(A);i++)
    {
        if(A%i==0)
        {
            answer.insert(i);
            answer.insert(A/i);
        } 
    }
    return answer;
}
/*
    120: 24883200000
    119: 23863536599
*/

ll gojou(ll A)
{
    return A*A*A*A*A;
}

int main()
{
    ll X;
    cin >> X;

    set<ll> dividers_of_X = divider(X);

    pair<ll,ll> ans = make_pair(0,0);

    for(auto a : dividers_of_X)
    {
        ll hoge = X/a;
        for(ll i=-120;i<=120;i++)
        {
            if(gojou(i+hoge)-gojou(i)==X)
            {
                ans.first = i+hoge;
                ans.second = i;
            }
        }
    }

    cout << ans.first << ' ' << ans.second << endl;

    return 0;
}

Measured memory_bytes: 3692
#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;
typedef tuple<long long, long long, long long> tllint;

// 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; }
bool compTuple(const tllint& arg1, const tllint& arg2) { return get<2>(arg1) > get<2>(arg2); }
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 x;
    cin >> x;

    int ans;
    ans = 8 - (x-400)/200;

    cout << ans << endl;
    return 0;
}


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

int ctoi(char a){
    return (int)a-'0';
}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	string S;
	cin>>S;
    ll mod13[13][13]={};
    rep(i,13){
        rep(j,10){
            mod13[i][(i*j)%13]+=1;
        }
    }
    // rep(i,13){
    //     rep(j,13){
    //         cout<<mod13[i][j]<<" ";
    //     }
    //     cout<<"\n";
    // }
    ll dp[13]={};
    ll l = S.length();
    if(S[l-1]=='?'){
        rep(i,13){
            dp[i]=mod13[1][i];
        }
    }else{
        dp[ctoi(S[l-1])]=1;
    }
    
    ll m = 1;
    ll num;
    ll tmp_dp[13]= {};
	rep(i,S.length()-1){
        // rep(i,13){
        //     cout<<dp[i];
        // }
        // cout<<"\n";
        rep(j,13){
            tmp_dp[j] = dp[j];
            dp[j] = 0;
        }
        m = (m*10)%13;
        if(S[l-2-i]=='?'){
            rep(j,13){
                if(mod13[m][j]==0) continue;
                rep(k,13){
                    dp[(j+k)%13]= (dp[(j+k)%13]+tmp_dp[k])%MOD;
                }
            }
        }else{
            num = ctoi(S[l-2-i]);
            rep(j,13){
                dp[(j+num*m)%13] = tmp_dp[j];
            }
        }
    }

    cout<<dp[5]<<"\n";
    // rep(i,13){
    //     cout<<dp[i];
    // }
    // cout<<"\n";
	
    return 0;
}

Measured memory_bytes: 512
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

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

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

mod = 1000000007

"""
# 標準入力取得
## 文字列
    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())

## 数値
    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    D, G = map(int, sys.stdin.readline().split())
    L = [list(map(int,list(sys.stdin.readline().split()))) for i in range(D)]
    ans = 10 ** 10
    for bit in range(1 << D):
        total = 0
        num = 0

        for i in range(D):
            if bit & (1 << i):
                total += L[i][1] + L[i][0] * 100 * (i + 1)
                num += L[i][0]

        if total >= G:
            ans = min(ans, num)
            continue

        for i in range(D - 1, -1, -1):

            if bit & (1 << i): continue

            for _ in range(L[i][0]):
                total += (i + 1) * 100
                num += 1
                if total >= G:
                    ans = min(ans, num)
                    break

    print(ans)

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

int main() {
  string r,g,b;
  cin >> r >> g >> b;
  if(atoi((g + b).c_str()) % 4 == 0) {
    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 __gnu_pbds;
using namespace std;
#define int long long
#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                    \
	sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<(c i) \
	{
sim > struct rge
{
	c b, e;
};
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug
{
#ifndef LOCAL
	~debug()
	{
		cerr << endl;
	}
	eni(!=) cerr << boolalpha << i;
	ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair<b, c> d)
{
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d)
{
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
	sim dor(const c &)
	{
		ris;
	}
#endif
}
;
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
template <typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define in insert
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define sz(v) (int)(v.size())
#define all(x) x.begin(), x.end()
#define prec fixed << setprecision(12)
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define repr(i, a, b) for (int i = a; i >= b; i--)
#define test  \
	int t;    \
	cin >> t; \
	while (t--)
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef set<int> si;
typedef map<int, int> mii;
typedef vector<pii> vpi;
int _x[] = {0, 0, -1, 1, -1, 1, -1, 1};
int _y[] = {-1, 1, 0, 0, 1, -1, -1, 1};

void solve()
{
	int n, x, t;
	cin >> n >> x >> t;
	int ans = 0;
	while (n > 0)
	{
		ans += t;
		n -= x;
	}
	cout << ans << "\n";
}

int32_t main()
{
	ios::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	cin.tie(NULL);
	// test
	solve();
	return 0;
}


Measured memory_bytes: 3632
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int[] dice = new int[6];
        int[] dice2 = new int[6];
        int[][] table = new int[100][4];
        for(int i = 0; i < 6; i++)dice[i] = scanner.nextInt();

        table[dice[0]][0] = dice[1];
        table[dice[0]][1] = dice[2];
        table[dice[0]][2] = dice[4];
        table[dice[0]][3] = dice[3];

        table[dice[1]][0] = dice[0];
        table[dice[1]][1] = dice[3];
        table[dice[1]][2] = dice[5];
        table[dice[1]][3] = dice[2];

        table[dice[2]][0] = dice[0];
        table[dice[2]][1] = dice[1];
        table[dice[2]][2] = dice[5];
        table[dice[2]][3] = dice[4];

        table[dice[3]][0] = dice[0];
        table[dice[3]][1] = dice[4];
        table[dice[3]][2] = dice[5];
        table[dice[3]][3] = dice[1];

        table[dice[4]][0] = dice[0];
        table[dice[4]][1] = dice[2];
        table[dice[4]][2] = dice[5];
        table[dice[4]][3] = dice[3];

        table[dice[5]][0] = dice[1];
        table[dice[5]][1] = dice[3];
        table[dice[5]][2] = dice[4];
        table[dice[5]][3] = dice[2];

        for(int i = 0; i < 6; i++)dice2[i] = scanner.nextInt();
        int top, k;
        for(top = 0; top < 6; top++){
            if(dice2[0] == dice[top]){
                for(k = 0; k < 4; k++){
                    if(dice2[1] == table[dice[top]][k]){
                        if(dice2[2] != table[dice[top]][(k+1)%4])break;
                        if(dice2[4] != table[dice[top]][(k+2)%4])break;
                        if(dice2[3] != table[dice[top]][(k+3)%4])break;
                        for(int l = 0; l < 4; l++){
                            if(dice2[5] == table[table[dice[top]][0]][l]){
                                System.out.println("Yes");
                                System.exit(0);
                            }
                        }
                    }
                }
            }
        }
        System.out.println("No");
    }
}



Measured memory_bytes: 26444