akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H& b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H & b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H & b) const { return x == b.x && y == b.y; }
	bool operator!=(const H & b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P& b) const { return cost < b.cost; }
	bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E& b) const { return cost < b.cost; }
	bool operator>(const E& b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T & a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T & a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n, k;
signed main() {
	cin >> n >> k;
	cout << n - k + 1 << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cmath>
#include<ctype.h>
#include<vector>
#include<cstdlib>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
 
const int INF = 100000000;
#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)

using namespace std;
ll N;
ll ans=1000000;
int a[100];

int solve(int num) {
	if (num == 101) return ans;
	int cost=0;
	REP(i, N) cost += (a[i] - num)*(a[i] - num);
	if (ans >= cost) ans = cost;
	solve(num + 1);
}

int main()
{

	cin >> N;
	REP(i, N) {
		cin >> a[i];
	}
	cout << solve(-100) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<cstdio>

using namespace std;

int pic[110][110];
int num[10010];

int main()
{
    int H,W,N;
    scanf("%d%d%d",&H,&W,&N);
    int i,j,k=0;
    for(i=0;i<N;++i)
    {
        scanf("%d",&num[i]);
    }
    for(i=0;i<H;++i)
    {
        if(i%2==0)
        {
            for(j=0;j<W;++j)
            {
                pic[i][j]=k+1;
                num[k]--;
                if(num[k]==0)++k;
            }
        }
        if(i%2==1)
        {
            for(j=W-1;j>=0;--j)
            {
                pic[i][j]=k+1;
                num[k]--;
                if(num[k]==0)++k;
            }
        }
    }
    for(i=0;i<H;++i)
    {
        for(j=0;j<W;++j)
        {
            printf("%d",pic[i][j]);
            if(j==W-1)printf("\n");
            else printf(" ");
        }
    }
    return 0;
}


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

using namespace std;
using ll=long long;

void solve() {
    ll x,y;
    cin >> x >> y;
    cout << x*y/__gcd(x,y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define int long long
using namespace std;

typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    int N;
    cin >> N;
    vector<int> A(1 << N);
    vector<Pii> first(1 << N, Pii(0, -1)), second(1 << N, Pii(0, -1));
    readvec(A);

    REP(i, 1 << N){
        Pii f = Pii(A[i], i);
        Pii s = Pii(0, -1);
        REP(d, 31){
            int x = i & ~(1 << d);
            if(x == i) continue;
            if(first[x].first > f.first){
                s = f;
                f = first[x];
            }else if(first[x].first > s.first && first[x].second != f.second){
                s = first[x];
            }
            if(second[x].first > s.first && second[x].second != f.second){
                s = second[x];
            }
        }
        first[i] = f;
        second[i] = s;
    }

    int ans = 0;
    FOR(i, 1, 1 << N){
        ans = max(ans, first[i].first + second[i].first);
        cout << ans << endl;
    }
    
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 13312
// created on : Sun May 31 2020
 

import java.io.*;
import java.util.*;

public class Main{

    public static void main(String[] args) throws IOException {
        int A = in.nextInt();
        int B = in.nextInt();
        println(A * B);
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static int[] readInt(int N) throws IOException { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    }
    
    static long[] readLong(int N) throws IOException { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    }
    
    static String[] readString(int N) throws IOException { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    }
    
    static void debug(Object ... O) { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    }
}

class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { 
        return Integer.parseInt(next()); 
    }
    
    double nextDouble() throws IOException { 
        return Double.parseDouble(next());
    }
    
    long nextLong() throws IOException { 
        return Long.parseLong(next()); 
    }
    
    String nextLine() throws IOException { 
        return reader.readLine(); 
    }
    
    void close() throws IOException { 
        reader.close(); 
    }
}

Measured memory_bytes: 25428
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cout << "debug "<<i << std::endl;

// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;

//非再帰トポロジカルソート 隣接リストを渡す 返り値のサイズがnじゃないならnot DAG
std::vector<ll> topo_sort(std::vector<std::vector<ll>>& graph) {
  ll n = graph.size();
  std::vector<ll> ret, num(n, 0);
  std::queue<ll> que;
  for(ll i=0;i<n;i++){
    for (ll j : graph[i]) num[j]++;
  }
  for (ll i = 0; i < n; i++) {
    if (num[i] == 0) que.push(i);
  }
  while (!que.empty()) {
    ll u = que.front();
    que.pop();
    ret.push_back(u);
    for (ll i : graph[u]) {
      num[i]--;
      if (num[i] == 0) que.push(i);
    }
  }

  return ret;
}

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  ll n;
  std::cin>>n;

  std::vector<std::vector<ll>> graph(n*(n-1)/2);

  rep(i,0,n){
    ll a;
    std::cin>>a;
    a--;

    ll prev=a;
    rep(j,1,n-1){
      std:: cin>>a;
      a--;
      ll temp=(i<prev)?(i*(2*n-1-i)/2+prev-i-1):(prev*(2*n-1-prev)/2+i-prev-1);
      ll temp2=(i<a)?(i*(2*n-1-i)/2+a-i-1):(a*(2*n-1-a)/2+i-a-1);
      graph[temp].push_back(temp2);
      prev=a;
    }
  }

  std::vector<ll> sort=topo_sort(graph),inv(n*(n-1)/2);

  if(sort.size()!=n*(n-1)/2){
    std::cout<<-1;
    return 0;
  }

  std::vector<ll> dp(n*(n-1)/2,0);

  rep(i,0,n*(n-1)/2){
    inv[sort[i]]=i;
  }

  for(ll i=n*(n-1)/2-1;i>=0;i--){
    ll now=sort[i],cost=0;
    for(ll to:graph[now]){
      cost=std::max(cost,dp[inv[to]]+1);
    }
    dp[i]=cost;
  }

  ll ans=0;

  rep(i,0,n*(n-1)/2){
    ans=std::max(ans,dp[i]+1);
  }

  std::cout<<ans;

  return 0;
}


Measured memory_bytes: 39344
#B

#デバッグ
debug=1
def pront(*n):
    if debug==1:
        print(n)
        
#10**9+7を底とした処理

base=10**9+7

def add(a,b):#a+b
    return (a+b)%base

def sub(a,b):#a-b
    return (a-b)%base

def multi(a,b):#a*b
    return (a*b)%base

def exp(a,b):#a**b
    x=1
    c=a
    d=b
    while d!=0:
        if d%2==1:
            x=multi(x,c)
        c=(c**2)%base
        d=d//2
    return x

def div(a,b):#a/b
    return(multi(a,exp(b,base-2)))

#入力

A,B,C,D=map(int,input().split())


#処理
while True:
    C=C-B
    if C<=0:
        print("Yes")
        break
    A=A-D
    if A<=0:
        print("No")
        break



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

void Rect(int h, int w){
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(i==0 || i==h-1 || j==0 || j==w-1) cout << '#';
			else cout << '.';
			
			if (j==w-1) cout << endl;
		}
	}
}

int main(){
	int H,W;
	
	while(true){
		
		cin >> H >> W;
		if(H==0&&W==0) break;
		Rect(H,W);
		cout << endl;
	}
}

Measured memory_bytes: 3080
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <limits.h>
#include <map>
#include <numeric>

namespace test {
	std::string to_string (char val) {
		return std::string (1, val);
		// return std::string{val};
	}
	//if( str.find ("r") != string::npos)
}

using namespace std;
typedef long long int llint;

int main (void) {
	int n,m; cin >> n >> m;
	cout << (n - 1) * (m - 1) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<vector>
#include<iomanip>
#include<map>
#include<set>
#include<utility>
#include<iterator>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
//#define t ll t;cin>>t;while(t--)
#define nn cout<<endl;
#define ff(a,n) for(ll i=a;i<n;i++)
#define cY cout<<"YES\n"
#define cN cout<<"NO\n"
#define cy cout<<"Yes\n"
#define cn cout<<"No\n"
#define sc second
#define fs first
#define c(a) cout<<a<<endl

void solve()
{
	string n; cin>>n;
	ll ans=0;
	for(auto x:n)
	{
		ans+=(ll)(x)-48;
	}
	if(ans%9==0)cy;
	else cn;
}

int main()
{
	solve();
}
/*




*/


Measured memory_bytes: 3716
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
int main() {
	int A, B, m;
	cin >> A >> B >> m;
	int a[100000];
	int min_a = 100001;
	rep(i, A) {
		cin >> a[i];
		min_a = min(min_a, a[i]);
	}
	int b[100000];
	int min_b = 100001;
	rep(i, B) {
		cin >> b[i];
		min_b = min(min_b, b[i]);
	}
	int ans = min_a + min_b;
	rep(i, m) {
		int x, y, c;
		cin >> x >> y >> c; x--; y--;
		ans = min(ans, a[x] + b[y] - c);
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <math.h>
int main(){

    int N;
    std::cin >> N;
    int sum = 0;
    for(int i= 0;i < 2; ++i){
        int wari = N*pow(10,-i);
        if(wari % 10 == 9){
            sum++;
        }
    }
    if(sum){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }
     
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<math.h>
using namespace std;

int main(){
    int N, D;
    cin >> N >> D;
    
    int point[N][D];
    for (int i = 0; i < N; i++){
        for (int j = 0; j < D; j++){
            cin >> point[i][j];
        }
    }

    int C = 0;
    double dis;

    for (int k = 0; k < N - 1; k++){
        for (int l = k + 1; l < N; l++){
            dis = 0;
            for (int m = 0; m < D; m++){
                dis += pow((point[k][m] - point[l][m]),2);
            }
            dis = sqrt(dis);
            if (ceil(dis) == floor(dis))C++;
        }
    }

    cout << C << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;

ll a_max(ll b, ll e, vector<ll> a)
{
    ll a_max = 1 << 31; //-2147483648  ll型でマジメに書くなら　1LL << 63;
    for (ll i = b; i < e; i++)
    {
        a_max = max(a_max, a[i]);
    }
    return a_max;
}

ll a_min(ll b, ll e, vector<ll> a)
{
    ll a_min = 1 << 31; //2147483648
    a_min *= -1;
    for (ll i = b; i < e; i++)
    {
        a_min = min(a_min, a[i]);
    }
    return a_min;
}

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

    cin >> q;

    for (ll i = 0; i < q; i++)
    {
        ll com, b, e;
        cin >> com >> b >> e;
        if (com == 1)
            cout << a_max(b, e, a) << endl;
        else if (com == 0)
            cout << a_min(b, e, a) << endl;
    }

    return 0;
}


Measured memory_bytes: 3144
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
const int INF = 999999999;

int  H, W;
char S[50][50];

int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int dist[50][50]; //各点の最短距離の配列
int cnt; //白マスの数

int main(){
	cin >> H >> W;
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++){
			cin >> S[i][j];
			if(S[i][j] == '.') cnt++;
			
			dist[i][j] = INF;
		}
	}

	
	queue<pii> Q;
	Q.push(make_pair(0, 0));
	dist[0][0] = 1;
	while(!Q.empty()){
		int x = Q.front().first, y=Q.front().second;
		Q.pop();
		for(int i=0; i<4; i++){
			int nx = x + dx[i], ny = y + dy[i]; //4方向への移動
			//移動かつ未訪問なら移動する
			if(0<=nx && nx < H && 0 <= ny && ny < W && S[nx][ny] != '#' && dist[nx][ny] == INF){
				dist[nx][ny] = dist[x][y] + 1;
				Q.push(make_pair(nx, ny));
			}
		}
	}
	if(dist[H-1][W-1] != INF){
		cout << cnt - dist[H-1][W-1] << endl;
	} else {
		cout << "-1" << endl;
	}
}

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

long long min_ans(const vector<long long>&a) {
    long long res = 2;
    for (auto& e : a) if (res%e != 0) res = res - (res%e) + e;
    return res;
}



int main() {
    int n;
    cin >> n;
    vector<long long> a(n);
    for (auto& e : a) cin >> e;
    reverse(a.begin(), a.end());
    
    auto is_ok = [&](long long k) {
        for (auto e : a) k = k - (k % e);
        return k == 2;
    };
    
    long long mn = min_ans(a);
    reverse(a.begin(), a.end());
    
    if (is_ok(mn)) {
        long long ok = mn, ng = 1e18;
        while (abs(ok - ng) > 1) {
            long long mid = (ok + ng) / 2;
            if (is_ok(mid)) ok = mid;
            else ng = mid;
        }
        cout << mn << " " << ok << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>

using namespace std;

bool Time[24][60];

int main() {
	int N, M;

	cin >> N;
	for (int i = 0; i < N; i++) {
		int h, m;
		cin >> h >> m;
		Time[h][m] = true;
	}

	cin >> M;
	for (int j = 0; j < M; j++) {
		int h, m;
		cin >> h >> m;
		Time[h][m] = true;
	}

	int space = 0;
	for (int k = 0; k < 24; k++) {
		for (int l = 0; l < 60; l++) {
			if (Time[k][l]) {
				if (!space) {
					printf("%d:%02d", k, l);
					space++;
				}
				else
					printf(" %d:%02d", k, l);
			}
		}
	}

	cout << endl;

	return 0;
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
using namespace std;
long long ans;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    long long N;
    cin >> N;
    ans = (N-1) * N / 2;
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
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;
}
 
using namespace std;
//ここから

void solve(){
  int sx,sy,tx,ty;
  cin>>sx>>sy>>tx>>ty;
  rep(i,tx-sx)cout<<"R";
  rep(i,ty-sy)cout<<"U";
  rep(i,tx-sx)cout<<"L";
  rep(i,ty-sy+1)cout<<"D";
  rep(i,tx-sx+1)cout<<"R";
  rep(i,ty-sy+1)cout<<"U";
  cout<<"L";
  cout<<"U";
  rep(i,tx-sx+1)cout<<"L";
  rep(i,ty-sy+1)cout<<"D";
  cout<<"R";
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
#include <tuple>
using namespace std;

long long const MOD = 1000000007LL;

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

    vector<int> height(n);
    for (int i = 0; i < n; i++) cin >> height[i];

    for (int i = n - 2; i >= 0; i--) if (height[i] > height[i + 1]) --height[i];

    string res = "Yes";
    for (int i = 1; i < n; i++) {
        if (height[i] < height[i - 1]) {
            res = "No";
            break;
        }
    }

    cout << res << endl;
}


Measured memory_bytes: 640
w,h,n = gets.chomp.split(" ").map{|str| str.to_i}

#WとHがそんなに大きくないので実際に塗っても問題ない
#塗り方から白い部分は必ず長方形を描く
#したがって白い部分の端の辺の座標だけ求めればよい #猛烈な手のひら返し

left = 0
right = w
down = 0
up = w

n.times do
	x,y,a = gets.chomp.split(" ").map{|str| str.to_i}
	case a
	when 1 then
		left = (left < x ? x : left)
	when 2 then
		right = (x < right ? x : right)
	when 3 then
		down = (down < y ? y : down)
	when 4 then
		up = (y < up ? y : up)
	end
end

if right <= left || up <= down then
	#全部塗りつぶされた
	puts 0
else
	puts (right - left) * (up - down)
end

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#include<string>
using namespace std;
int ac=0,wa=0,tle=0,re=0;
void sol(){
 	string n;
 	cin >> n;
 	if((n=="AC")){
 		ac++;
 	}
 	if(n=="WA"){

 		wa++;
	}
 		if(n=="TLE"){
 			tle++;
 		}
 		if( n=="RE"){
 			re++;
 		}
 			
 	}


int main()
{
	int t;
	cin >> t;
	while(t--){
	sol();
}
cout << "AC " << "x " <<ac<<endl;
cout << "WA " << "x " <<wa<<endl;
cout << "TLE " << "x " <<tle<<endl;
cout << "RE " << "x " <<re<<endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>
#include <string>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

#define REP(i,p,n) for(int i=p;i<n;++i)
#define rep(i,n) REP(i,0,n)

using ll = long long int;
using pll = pair<ll, ll>;

const int MAXN = 100000;
ll C[MAXN];

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

    rep(i, N)
    {
        C[i] = 1;

        ll p = i + 1;
        while (p < K) { C[i] *= 2; p *= 2; }
    }

    double ans = 0.0;

    rep(i, N)
    {
        ans += 1.0 / (static_cast<double>(C[i] * N));
    }

    printf("%0.09lf\n", ans);

    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=100010;
//const ll mod=1e9+7;
const ll mod=998244353;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; }
    mint& operator-=(const mint a) { if ((x += mod-a.x) >= mod) x -= mod; return *this; }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
    mint operator+(const mint a) const { mint res(*this); return res+=a; }
    mint operator-(const mint a) const { mint res(*this); return res-=a; }
    mint operator*(const mint a) const { mint res(*this); return res*=a; }
    mint pow(ll t) const { if (!t) return 1; mint a = pow(t>>1); a *= a; if (t&1) a *= *this; return a; }
    // for prime mod
    mint inv() const { return pow(mod-2); }
    mint& operator/=(const mint a) { return (*this) *= a.inv(); }
    mint operator/(const mint a) const { mint res(*this); return res/=a; }
};

vector<ll> inv,fact,invfact;
void mod_build(int n){  
  fact.resize(n+1); inv.resize(n+1); invfact.resize(n+1);
  fact[0]=inv[0]=invfact[0]=1; inv[1]=1;
  rep(i,n){
    fact[i+1]=fact[i]*(i+1)%mod;
    if(i>0)inv[i+1]=mod-inv[mod%(i+1)]*(mod/(i+1))%mod;
    invfact[i+1]=invfact[i]*inv[i+1]%mod;
  }
}
ll perm(int n,int k){ if(n<0||k<0||k>n){ return 0; } else { return fact[n]*invfact[n-k]%mod; } }
ll comb(int n,int k){ if(n<0||k<0||k>n){ return 0; } else { return (fact[n]*invfact[n-k]%mod)*invfact[k]%mod; }}
ll modpow(ll n,ll k){
  k%=mod-1; if(k<0)k+=mod-1;
  ll ret=1; while(k){ if(k&1)ret=ret*n%mod; n=n*n%mod; k>>=1; }
  return ret;
}
ll modinv(ll a){ return modpow(a, mod-2); }

int main(){
  mod_build(mx);
  int n;
  cin >> n;
  vector<ll> a(n);
  ll sum = 0;
  rep(i,n){
    cin>>a[i];
    sum += a[i];
  }

  vector<vector<mint>> dp1(310, vector<mint>(mx,0));
  vector<vector<mint>> dp2(310, vector<mint>(mx,0));
  dp1[0][0] = dp2[0][0] = 1;
  rep(i,n)rep(j,90010){
    dp1[i+1][j] += dp1[i][j]*2;
    dp1[i+1][j+a[i]] += dp1[i][j];
    dp2[i+1][j] += dp2[i][j];
    dp2[i+1][j+a[i]] += dp2[i][j];
  }

  mint hh = 0;
  if(sum%2==0){ hh = dp2[n][sum/2]; }
  mint aout = 0;
  rep(i,mx)if(i>=(sum+1)/2){
    aout += dp1[n][i];
  }

  mint ans = modpow(3,n);
  ans -= aout*3;
  ans += hh*3;
  cout << ans.x << endl;
  return 0;
}


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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, M = MAP()
XYZ = []
for i in range(N):
    x, y, z = MAP()
    XYZ.append((x, y, z))

# dp[i][j][S] := i個目まで見て、j個選んだ状態で、3つの値をそれぞれ+とみなすか-とみなすかの2^3通りを集合Sで表した時の最大値
dp = list3d(N+1, M+1, 1<<3, -INF)
for S in range(1<<3):
    dp[0][0][S] = 0
for i in range(N):
    for j in range(M+1):
        if i < j:
            break
        for S in range(1<<3):
            # このケーキを選ばない遷移
            dp[i+1][j][S] = max(dp[i+1][j][S], dp[i][j][S])
            if j < M:
                nxt = 0
                for k in range(3):
                    if S & 1<<k:
                        # この値は+とみなす
                        nxt += XYZ[i][k]
                    else:
                        # この値は-とみなす
                        nxt += -XYZ[i][k]
                # このケーキを選ぶ遷移
                dp[i+1][j+1][S] = max(dp[i+1][j+1][S], dp[i][j][S] + nxt)
# N個見てM個選び終わって、+-をどう扱ったかの2^3通りから最大を取る
print(max(dp[N][M]))


Measured memory_bytes: 167388
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int k, x;
  cin >> k >> x;
  int min = x + 1 - k;
  int max = x + k - 1;
  for(int i = min; i < max; i++) {
    cout << i << " ";
  }
  cout << max << endl;
  return 0;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include<iostream>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

using namespace std;

int main() {
  int N;
  cin >> N;
  int mochi[N];
  for(int i = 0; i < N; i++) {
    cin >> mochi[i];
  }
  
  sort(mochi, mochi + SIZE_OF_ARRAY(mochi), greater<>());
  
  int count = 0;
  int prev = 999;
  for(int i = 0; i < N; i++) {
    if(mochi[i] < prev) {
      prev = mochi[i];
      count++;
    }
  }
  
  cout << count << endl;
}


Measured memory_bytes: 3196
using System;
using System.Linq;

namespace B___Five_Dishes
{
    class Program
    {
        static void Main(string[] args)
        {
            var ABCDE = new int[5].Select(_ => int.Parse(Console.ReadLine())).ToList();
            var roundSum = ABCDE.Select(x => Math.Ceiling((double)x / 10) * 10).Sum();
            var ajust = ABCDE.Select(x => x % 10).All(x => x == 0) ? 0 : ABCDE.Select(x => x % 10).Where(x => x != 0).Min() - 10;

            Console.WriteLine(roundSum + ajust);
        }
    }
}


Measured memory_bytes: 13396
s = input()
s = list(s)
k = int(input())

for i in range(len(s)):
  if s[i] != "a" and ord("z") + 1 - ord(s[i]) <= k :
    k -= ord("z") + 1 - ord(s[i])
    s[i] = "a"
    
    
if k > 0:
  k = k % 26
  if ord(s[-1]) + k <= ord("z"):
    s[-1] = chr(ord(s[-1]) + k)
  else:
    s_num = ord("a") +  ord(s[-1]) + k - ord("z")
    s[-1] = chr(s_num)
  
print("".join(s))
  

Measured memory_bytes: 4156
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
typedef vector<vector<int>> Graph;
typedef vector<vector<int>> Mat;
const int inf = 1e9;
const int mod = 1e9 + 7;

int N, M, A, B, C, T;

inline Mat mulMatMat(const Mat& a, const Mat& b) {
    int n = a.size();
    int m = b[0].size();
    assert(a[0].size() == b.size());
    Mat c(n, V(m, 0));
    rep(i, n) {
        rep(j, m) {
            rep(k, a[0].size()) {
                (c[i][j] += a[i][k] * b[k][j]) %= M;
            }
        }
    }
    return c;
}

inline V mulMatVec(const Mat& a, const V& v) {
    int n = a.size();
    assert(a[0].size() == v.size());
    V c(n, 0);
    rep(i, n) {
        rep(j, a[0].size()) {
            (c[i] += a[i][j] * v[j]) %= M;
        }
    }
    return c;
}

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

    while (cin >> N >> M >> A >> B >> C >> T, N) {
        V s(N + 2);
        rep2(i, 1, N + 1) cin >> s[i];

        VV a(N + 2, V(N + 2));
        rep2(i, 1, N + 1) {
            a[i][i - 1] = A,    a[i][i] = B,    a[i][i + 1] = C;
        }

        for (; T > 0; T >>= 1) {
            if (T & 1) {
                s = mulMatVec(a, s);
            }
            a = mulMatMat(a, a);
        }

        rep2(i, 1, N + 1) {
            cout << (i != 1 ? " " : "") << s[i];
        }
        cout << endl;

    }
}

Measured memory_bytes: 3156
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define MAX 1000000


struct node{
  int key;
  struct node *right;
  struct node *left;
  struct node *parent;
};
  typedef struct node Node;
Node *root,*NIL;

void insert(int k){
  Node *y = NIL;
  Node *x = root;
  Node *z;

  z=(Node *)malloc(sizeof(Node));
  z->key =k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    //leafのところまで探索
    y = x;
    if(z->key < x->key){
      x = x->left;
    }
    else{
      x = x->right;
    }
  }
  z->parent = y;
  //右に入るか左に入るかを考える
  if( y == NIL)root = z;
  else{
    if(z->key < y->key ){
      y->left=z;
    }
    else{
      y->right = z;
    }
  }       
}
void inorder(Node *u){ 
  if(u == NIL)return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void print(Node *u){
  if(u == NIL)return;
  printf(" %d",u->key);
  print(u->left);
  print(u->right);
}

Node *find(Node *x,int k){
  while(x != NIL && k != x->key){
    if(k < x->key)x = x->left;
    else x = x->right;
  }
  return x;
}

Node *treeMinimum(Node *x){
  while(x->left !=NIL)x = x->left;
  return x;
}


Node * treeSuccessor(Node *x){
  if(x->right != NIL)return treeMinimum(x->right);
  Node *y = x->parent;
  while(y != NIL && x == y->right){
    x = y;
    y = y->parent;
  }
  return y;
}


void delete(Node *z){
  int i,j;
  Node *y,*x;
  
  if(z->left == NIL || z->right == NIL) y = z;
  else y = treeSuccessor(z);
  //yの子 xを決める
  if(y->left != NIL){
    x = y->left;
  }
  else{
    x = y->right;
  }

  if(x !=NIL){
    x->parent = y->parent;
  }

  if(y->parent == NIL){
    root = x;
  }
  else{
    if(y == y->parent->left){
      y->parent->left = x;
    }
    else{
      y->parent->right = x;
    }
  }

  if(y != z){
    z->key = y->key;
  }

  free(y);
  
}

int main(){
  int i,j,n,k;
  char s[10];
  Node *t;
  
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%s",s);
    if(s[0]=='i'){
      scanf("%d",&k);
      insert(k);
    }
    else if(s[0]=='p'){
      //print
      inorder(root);
      printf("\n");
      print(root);
      printf("\n");
    }
    else if(s[0]=='f'){
      //find
      scanf("%d",&k);
      t = find(root,k);
      if(t != NIL)printf("yes\n");
      else printf("no\n");
    }
    else if(s[0]=='d'){
      //delete
      scanf("%d",&k);
      delete(find(root,k));
    }
  }
  return 0;
}




Measured memory_bytes: 20536
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define MAX_INPUT 100
#define RADIUS 1.0
#define EPS 1e-10
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))

typedef struct {
    double x;
    double y;
} Point;

typedef struct {
    Point start;
    Point end;
} Vector;

Vector cross_point(Point p1, Point p2) {
    double distance = sqrt(pow(p1.x - p2.x, 2.0) + pow(p1.y - p2.y, 2.0));
    double theta = atan2(p2.y - p1.y, p2.x - p1.x);
    double alpha = acos(pow(distance, 2.0) / (2 * distance));
    Vector vec = {};
    vec.start.x = p1.x + cos(alpha + theta);
    vec.start.y = p1.y + sin(alpha + theta);
    vec.end.x = p1.x + cos(alpha - theta);
    vec.end.y = p1.y + sin(alpha = theta);
    return vec;
}

Point sub_point(Point p1, Point p2) {
    Point point = {};
    point.x = p1.x - p2.x;
    point.y = p1.y - p2.y;
    return point;
}

double calc_distance(Point p1, Point p2) {
    Point p = sub_point(p1, p2);
    return sqrt(pow(p.x, 2.0) + pow(p.y, 2.0));
}

bool is_distance(Point p1, Point p2, double d) {
    return calc_distance(p1, p2) - d <= EPS;
}

int count_overlaps(Point* points, int n) {
    int i;
    int j;
    int x;
    Point cross_points[MAX_INPUT*MAX_INPUT*2] = {};
    int cross_len = 0;
    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
            if (i != j && is_distance(points[i], points[j], RADIUS + RADIUS)) {
                Vector res = cross_point(points[i], points[j]);
                cross_points[cross_len] = res.start;
                cross_len++;
                cross_points[cross_len] = res.end;
                cross_len++;
            }
        }
    }
    int max_counts = 1;
    int counts;
    for (i = 0; i < cross_len; i++) {
        counts = 0;
        for (x = 0; x < n; x++) {
            if (is_distance(cross_points[i], points[x], RADIUS)) {
                counts++;
            }
        }
        if (counts > max_counts) {
            max_counts = counts;
        }
    }
    return max_counts;
}

int main() {
    while (true) {
        int n;
        scanf("%d", &n);
        if (n == 0) {
            return 0;
        }
        Point points[MAX_INPUT] = {};
        int i;
        for (i = 0; i < n; i++) {
            scanf("%lf,%lf", &points[i].x, &points[i].y);
        }
        int count = count_overlaps(points, n);
        printf("%d\n", count);
    }
    return 0;
}

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

using ll = long long;

//[1..s]
ll fbfbnum(ll s) {
    ll fizz = s / 3;
    ll buzz = s / 5;
    return (fizz + buzz) * 4;
}

//[n2..n)
ll f(ll n, ll n2, int cnt) {
    n--; n2--;
    ll fbcnt = fbfbnum(n) - fbfbnum(n2);
    ll fbnum = n / 3 + n / 5 - n / 15 - (n2 / 3 + n2 / 5 - n2 / 15);
    return (n - n2 - fbnum) * cnt + fbcnt;
}

int main() {
    ll s;
    cin >> s;
    ll t = s;
    ll cnt = 1;
    ll n = 1;
    while(s - f(10*n, n, cnt) > 0) {
        s -= f(10*n, n, cnt);
        n *= 10;
        cnt++;
    }
    
    ll lb = n, ub = 10*n+1;
    while(ub - lb > 1) {
        ll m = (lb + ub) / 2;
        if(s - f(m, n, cnt) > 0) {
            lb = m;
        } else {
            ub = m;
        }
    }
    s -= f(lb, n, cnt) + 1;
    string res;
    for(ll i=lb; i<lb+20; ++i) {
        if(i % 15 == 0) {
            res += "FizzBuzz";
        } else if(i % 5 == 0) {
            res += "Buzz";
        } else if(i % 3 == 0) {
            res += "Fizz";
        } else {
            res += to_string(i);
        }
    }
    for(int i=s; i<s+20; ++i) {
        cout << res[i];
    }
    cout << endl;
}


Measured memory_bytes: 3268
R,G,B,N = map(int,input().split())
ans = 0
for r in range(N//R+1):
    for g in range(N//G+1):
        if (N-R*r-G*g)%B == 0 and N-R*r-G*g >= 0:
            ans += 1
print(ans)

Measured memory_bytes: 40940
# coding: utf-8
import collections
 
n = int(input())
a_list = list(map(int,input().split()))
 
c = collections.Counter(a_list)
 
#print(len(c.keys()))
ans_list = list(c.keys())
count_list = list(c.values())
 
#print(c.keys())
if len(c.keys()) == 1:
    if list(c.keys()) == [0]:
        print("Yes")
        quit()
    else:
        print("No")
        quit()
elif len(c.keys()) == 2:
    if ans_list[0] == ans_list[0]^ans_list[1] and count_list[0]== 2*count_list[1]:
        print("Yes")
        quit()
    elif ans_list[1] == ans_list[0]^ans_list[1] and count_list[1]== 2*count_list[0]:
        print("Yes")
        quit()
    else:
        print("No")
        quit()
        
if len(c.keys()) != 3:
    print("No")
    quit()

count_list.sort()
if ans_list[0] == ans_list[1] ^ ans_list[2]:
    if count_list[0]==count_list[1]==count_list[2]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Measured memory_bytes: 14468
#include<stdio.h>

#define MAX 100001

typedef struct pros{
    char name[100];
    int time;
}P;
P Q[MAX];
int tail,head;

void enqueue(P x){
    Q[tail]=x;
    tail=(tail+1)%MAX;
}
P dequeue(){
    P x=Q[head];
    head=(head+1)%MAX;
    return x;
}

int min(int a, int b){
    return a<b?a:b;
}

int main(){
    int i, q,n;
int total=0, hiku;
P u;
    scanf("%d%d",&n,&q);
    for(i=1;i<=n;i++){
        scanf("%s",Q[i].name);
        scanf("%d",&Q[i].time);
    }
    head=1;
    tail=n+1;
    while(head!=tail){
        u=dequeue();
        hiku=min(q,u.time);
        u.time-=hiku;
        total+=hiku;
        if(u.time>0) enqueue(u);
        else printf("%s %d\n",u.name,total);
        
    }
    return 0;
}


Measured memory_bytes: 11852
#include <bits/stdc++.h>
#define dbug(x) cout<<#x<<"="<<x<<endl
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while ('0'>ch||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do {(t*=10)+=ch-'0';ch=getchar();} while ('0'<=ch&&ch<='9'); t*=f;
}
const int INF=(1e9);
const int maxn=210;
int n,c[maxn],ans;
int d[maxn][maxn];
char s[maxn];
void dfs(int u) {
	for (int i=1;i<=n;i++)
		if (d[u][i]) {
			if (c[i]&&c[i]!=3-c[u]) { printf("-1\n"); exit(0); }
			if (c[i]) continue;
			c[i]=3-c[u]; dfs(i);
		}
}
int main() {
	//freopen("1.txt","r",stdin);
	read(n);
	for (int i=1;i<=n;i++) {
		scanf("%s",s+1);
		for (int j=1;j<=n;j++) d[i][j]=s[j]-'0';
	}
	dfs(1);
	for (int i=1;i<=n;i++)
	for (int j=1;j<=n;j++) if (i!=j&&!d[i][j]) d[i][j]=INF;
	for (int k=1;k<=n;k++)
	for (int i=1;i<=n;i++)
	for (int j=1;j<=n;j++)
		d[i][j]=min(d[i][k]+d[k][j],d[i][j]);
	for (int i=1;i<=n;i++)
	for (int j=1;j<=n;j++) ans=max(ans,d[i][j]+1);
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int n, a, b; cin >> n >> a >> b;
	int ans = 0;
	int count = 0;
	int x, y;
	for(int i=1;i<=n;i++){
		count = 0;
		x = i;
		while(x!=0){
			y = x%10;
			count += y;
			//cout << y << endl;
			x = x/10;
		}
		if(a<=count && count<=b){
			ans += i;
			//cout << ans << endl;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<cmath>
using namespace std;
int main(){
   int A,B;
   cin >>A>>B;
   int K=(A+B)/2;
   if(abs(A-K)==abs(B-K)){
      cout <<K<<endl;
   } 
   else {
      cout << "IMPOSSIBLE" << endl;
   }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'

using namespace std;
int main() {
    int N,M, get, sum=0;
    vector<int> v;
    ios::sync_with_stdio(false);
    cin>>N>>M;
    for(int i = 0; i < N; i++) {
        cin>>get;
        v.push_back(get);
        sum += get;
    }
    sort(v.begin(), v.end(), greater<int>());
    if(sum % (4*M) != 0) sum = sum/(4*M) + 1;
    else sum = sum/(4*M);
    for(int i = 0; i < M; i++) {
        if(v[i] < sum) {
            cout<<"No"<<endl;
            return 0;
        }
    }



    cout<<"Yes"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip> // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple> // get<n>(xxx)
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set> // S.insert(M);
// if (S.find(key) != S.end()) { }
// for (auto it=S.begin(); it != S.end(); it++) { }
// auto it = S.lower_bound(M);
#include <random> // random_device rd; mt19937 mt(rd());
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib> // atoi(xxx)
using namespace std;

#define DEBUG 0 // change 0 -> 1 if we need debug.
// insert #if<tab> by my emacs. #if DEBUG == 1 ... #end

typedef long long ll;

// const int dx[4] = {1, 0, -1, 0};
// const int dy[4] = {0, 1, 0, -1};

// const int C = 1e6+10;
// const ll M = 1000000007;

int N, M, K;

bool calc(int x, int y) {
  return (x * y + (N - x) * (M - y) == K);
}

int main () {
  cin >> N >> M >> K;
  for (auto i = 0; i <= N; ++i) {
    for (auto j = 0; j <= M; ++j) {
      if (calc(i, j)) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 256
while True:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    
    for line in range(h):
        for char in range(w):
            
            if (char+line) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')
        print()
    print()
    
        


Measured memory_bytes: 7000
import itertools
t = False
num = [s for s in input().split()]
lister = list(itertools.permutations(num))
for i in range(24):
    s = lister[i]
    if s[0] == "1" and s[1] == "9" and s[2] == "7" and s[3] == "4":
        t = True
if t == True:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3060
n,m,c=map(int,input().split())
base = list(map(int,input().split()))
x=[list(map(int, input().split())) for i in range(n)]
ans=0
cnt=0
for i in range(n):
    for k in range(m):
        cnt+=base[k]*x[i][k]
    cnt+=c
    if cnt>0:
        ans+=1
    cnt=0
        
print(ans)

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

int main() { /* ここに書く */
  
  string X ;
  cin >> X ;
  
  if ( X == "a" ){ cout << "b" << endl;}
  if ( X == "b" ){ cout << "c" << endl;}
  if ( X == "c" ){ cout << "d" << endl;}
  if ( X == "d" ){ cout << "e" << endl;}
  if ( X == "e" ){ cout << "f" << endl;}
  if ( X == "f" ){ cout << "g" << endl;}
  if ( X == "g" ){ cout << "h" << endl;}
  if ( X == "h" ){ cout << "i" << endl;}
  if ( X == "i" ){ cout << "j" << endl;}
  if ( X == "j" ){ cout << "k" << endl;}
  if ( X == "k" ){ cout << "l" << endl;}
  if ( X == "l" ){ cout << "m" << endl;}
  if ( X == "m" ){ cout << "n" << endl;}
  if ( X == "n" ){ cout << "o" << endl;}
  if ( X == "o" ){ cout << "p" << endl;}
  if ( X == "p" ){ cout << "q" << endl;}
  if ( X == "q" ){ cout << "r" << endl;}
  if ( X == "r" ){ cout << "s" << endl;}
  if ( X == "s" ){ cout << "t" << endl;}
  if ( X == "t" ){ cout << "u" << endl;}
  if ( X == "u" ){ cout << "v" << endl;}
  if ( X == "v" ){ cout << "w" << endl;}
  if ( X == "w" ){ cout << "x" << endl;}
  if ( X == "x" ){ cout << "y" << endl;}
  if ( X == "y" ){ cout << "z" << endl;}
}

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

typedef long long ll;
typedef pair<int, int> ii;

int h1, s1, h2, s2;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  cin >> h1 >> s1 >> h2 >> s2;
  int t1 = (h2 + s1 - 1) / s1;
  int t2 = (h1 + s2 - 1) / s2;
  if (t1 <= t2)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}


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

int main(){
    int H,W; cin>>H>>W;
    vector<string> S(H);
    for(int i=0;i<H;i++) cin>>S[i];

    int dx[8]={-1,-1,-1,0,0,1,1,1};
    int dy[8]={1,0,-1,1,-1,1,0,-1};
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(S[i][j]=='.'){
                int count=0;
                for(int k=0;k<8;k++){
                    int x=j+dx[k];
                    int y=i+dy[k];
                    if(x>=0&&x<W&&y>=0&&y<H&&S[y][x]=='#') count++;
                }
                S[i][j]='0'+count;
            }
        }
    }
    for(int i=0;i<H;i++) cout<<S[i]<<endl;
}

Measured memory_bytes: 256
//
// Created by INCOMPETENT CODER on 25-08-2020
//https://atcoder.jp/contests/abc179/tasks/abc179_c
#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;
#define debug(...) cout<< " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] " ;
const ll mac=1e5;
ll arr[mac];
ll bin_search(ll a[], ll lb, ll ub, ll item) {
    while (lb <= ub) {
        ll mid = lb + (ub - lb) / 2;
        if (a[mid] == item) return mid;
        if (a[mid] > item) lb = mid + 1;
        else ub = mid - 1;
    }
    return -1;
}

ll power(ll x, ll y) {
    ll res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;

        y = y >> 1;
        x = x * x;
    }
    return res;
}

ll powerp(ll x, ll y, ll p) {
    ll res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0) {
        if (y & 1)
            res = (res * x) % p;

        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}



int main() {
    ll n;
    cin>>n;
    ll count=0;
    for(ll i=1;i<=n-1;i++){
        if(n%i==0){
            count+=(n/i)-1;
        }
        else{
            count+=(n/i);
        }
    }
    cout<<count;
}

Measured memory_bytes: 3596
import sys
readline=sys.stdin.readline

N = int(readline())
cur = 0
for i in range(N):
  a,b = map(int,readline().split())
  if a == b:
    cur += 1
    if cur == 3:
      print("Yes")
      exit(0)
  else:
    cur = 0
print("No")

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int mod = (int)1e9+7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int a,b,c;
	cin >>a >>b >>c;
	
	int ac=a*c;
	if(b>=ac) cout << c <<"\n";
	else cout << b/a <<"\n";
	
	return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>

using namespace std;

int main()
{
	int n,d,x;
	cin >> n >> d >> x;
	vector<int> a(n);
	int ans=0;
	for(int i=0;i<n;i++)
		cin >> a[i];
	for(int i=0;i<n;i++)
	{
		ans+=((d+a[i]-1)/a[i]);
	}
	ans+=x;
	cout << ans << endl;
}


Measured memory_bytes: 256