akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
 
char str[110];
int i,j,k,l,m,n;
int n,e,s,w,un,up;
int a[7],b[7], qu[25],qf[25],ufl[25];
int a2[7],b2[7];
int t;
 
void input() {
  for(i=0;i<6;i++){
    scanf("%d",&a[i+1]);
    b[i+1] = a[i+1];
  }
  for(i=0;i<6;i++){
    scanf("%d",&a2[i+1]);
    b2[i+1] = a2[i+1];
  }
 
}
 
void N() {
  t = a[1];
  a[1] = a[2];
  a[2] = a[6];
  a[6] = a[5];
  a[5] = t;
}
 
void S() {
  t = a[1];
  a[1] = a[5];
  a[5] = a[6];
  a[6] = a[2];
  a[2] = t;
}
 
void E() {
  t = a[1];
  a[1] = a[4];
  a[4] = a[6];
  a[6] = a[3];
  a[3] = t;
}
 
void W() {
  t = a[1];
  a[1] = a[3];
  a[3] = a[6];
  a[6] = a[4];
  a[4] = t;
}
 
void UF() {
 
  if(a2[1] == a[1]) {
    if(a2[2] == a[3]) strcpy( str, "NWS");
    else if(a2[2] == a[5]) strcpy(str ,"NEES");
    else if(a2[2] == a[4]) strcpy(str,"NES");
    else if(a2[2] == a[6]) strcpy(str, "N");
  } 
 
 else if(a2[1] == a[2]) {  
    if(a2[2] == a[3])  strcpy( str, "NWS");
    else if(a2[2] == a[1] ) strcpy(str ,"NEES");
    else if(a2[2] == a[4]) strcpy(str,"NES");
    else if(a2[2] == a[5]) strcpy(str, "N");
    N();
  }
 
 
 else if(a2[1] == a[3]){ 
    if(a2[2] == a[6])  strcpy( str, "NWS");
    else if(a2[2] == a[5])  strcpy(str ,"NEES");
    else if(a2[2] == a[1]) strcpy(str,"NES");
    else if(a2[2] == a[4]) strcpy(str, "N");
    W();
  }
 
 
 else if(a2[1] == a[4]) {
    if(a2[2] == a[1]) strcpy( str, "NWS");
    if(a2[2] == a[5])  strcpy(str ,"NEES");
    if(a2[2] == a[6]) strcpy(str,"NES");
    else if(a2[2] == a[3]) strcpy(str, "N");
    E();
  }
 
 else if(a2[1] == a[5]) {
    if(a2[2] == a[3]) strcpy( str, "NWS");
    else if(a2[2] == a[6])  strcpy(str ,"NEES");
    else if(a2[2] == a[4]) strcpy(str,"NES");
    else if(a2[2] == a[2]) strcpy(str, "N");
    S();
  }
 
 else if(a2[1] == a[6]) {
    if(a2[2] == a[3]) strcpy( str, "NWS");
    else if(a2[2] == a[2])  strcpy(str ,"NEES");
    else if(a2[2] == a[4]) strcpy(str,"NES");
    else if(a2[2] == a[1]) strcpy(str, "N");
    N();
    N();
  }
 
 
}
 
void reset() {
  strcpy(str , "");
  for(i=1;i<=6;i++){
    a[i] = b[i];
  }
}
 
 
void output() {
 
  k = 0;
  for(i=1;i<=6;i++) {
    if(a[i] == a2[i]) k++;
  }
  if(k == 6) printf("Yes\n");
  else printf("No\n");
}
 
void IF() {
 
 
  for(i=0;i<strlen(str);i++) {
 
    if(str[i] == 'N') N();
    else if(str[i] == 'S') S();
    else if(str[i] == 'W') W();
    else if(str[i] == 'E') E();
  }
}
 
int main(void) {
 
 
  input();
 
    UF();
     
    IF();
 
    output();
 
 
 
 
 
  return 0;
}


Measured memory_bytes: 2132
#include<iostream>
#include <cmath>
using namespace std;
int main()
{
    int n ,k;
    
    string t,q,a;
    cin >> t >> q;
    cin >> n >> k;
    cin >> a;
    if(t.compare(a)==0){
        n=n-1;
    }else{
        k=k-1;
    }
    
    cout << n << " " << k;
    
}

Measured memory_bytes: 256
import heapq
V,E=map(int, input().split())
nodes = [[] for i in range(V)]
cost = [[] for i in range(V)]
for i in range(E):
    s,t,w = map(int, input().split())
    nodes[s].append(t)
    cost[s].append(w)
    nodes[t].append(s)
    cost[t].append(w)

visited = [False] * V
total = 0
h = [(0,-1,0)]
while h:
    c,s,t = heapq.heappop(h)
    if visited[t]:
        continue
    total += c
    visited[t] = True
    for i in range(len(nodes[t])):
        nv = nodes[t][i]
        if not visited[nv]:
            heapq.heappush(h,(cost[t][i],t,nv))
print(total)

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

#define ALL(a) (a).begin(), (a).end()
#define llong long long

using namespace std;

signed main(){
	
	int n, t, e; cin >> n >> t >> e;
	vector<int> x(n);
	for(int i = 0; i < n; i++) cin >> x[i];

	for(int i = 0; i < n; i++){
		for(int val = 1; val <= t; val++){
			int num = val * x[i];
			if(t - e <= num && num <= t + e){
				cout << i + 1 << endl;
				return 0;
			}
		}
	}


	cout << -1 << endl;
	return 0;
}




Measured memory_bytes: 3092
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
  string s;
  cin >> s;
  for(int i = 0; i<s.size(); ++i){
      if(i % 2 == 0){
        cout << s.at(i);
      }
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 512
n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

def gcd(x,y):
    if y==0 : return x
    else: return gcd(y,x%y)
#print(gcd(n,x))

ans=new_lst[0]
for i in range(1,n):
	ans =gcd(new_lst[i],ans)
  
print(ans)

Measured memory_bytes: 15020
n, k = map(int, input().split())
p = [0]*n
for i in range(k):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    p[a-1] += 1
ans = 0
for p_i in p:
  if p_i == 0:
    ans += 1
print(ans)

Measured memory_bytes: 9192
from heapq import heappush, heappop
from operator import itemgetter
import sys
input = sys.stdin.readline


class PseudoSet():
    def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

    def insert(self, x):
        heappush(self.s, x)

    def erase(self, x):
        heappush(self.e, x)

    def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None


n, q = map(int, input().split())
events = []
for i in range(n):
    s, t, x = map(int, input().split())
    events.append((s - x, +1, x))
    events.append((t - x, -1, x))
for i in range(q):
    d = int(input())
    events.append((d, 2, i))

ans = [-1] * q
events.sort(key=itemgetter(0, 1))
# print(events)
ps = PseudoSet()
for c, t, z in events:
    if t == 1:
        ps.insert(z)
    elif t == -1:
        ps.erase(z)
    else:
        # t == 2
        m = ps.get_min()
        if m is not None:
            ans[z] = m

print(*ans, sep='\n')


Measured memory_bytes: 132948
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#define my_abs(x) ((x) < 0 ? -(x) : (x))
#define mp std::make_pair
#define pb push_back
typedef long long ll; 
int arr[200005]; 
int main()
{
	// freopen("ARC100-C.in", "r", stdin); 
	int n; 
	scanf("%d", &n); 
	for (int i = 0; i < n; i++)
	{
		scanf("%d", arr + i); 
		arr[i] -= i + 1; 
	}
	std::sort(arr, arr + n); 
	ll ans = 0;
	for (int i = 0; i < n; i++)
		ans += my_abs(arr[i] - arr[n >> 1]); 
	printf("%lld\n", ans);
	return 0; 
}


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int N, K; cin >> N >> K;
    vec a(N, 0);
    rep(i, K){
        int d; cin >> d;
        rep(j, d){
            int x; cin >> x;
            x--;
            a[x]++;
        }
    }

    int res = 0;
    rep(i, N){
        if(a[i] == 0)res++;
    }

    cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7752
#include<stdio.h>
int main(){
  int A,B;
  int plu,sum,mai;
  scanf("%d %d",&A,&B);
  plu=A+B;
  sum=A*B;
  mai=A-B;
  if(plu>sum && plu>mai) printf("%d\n",plu);
  else if(sum>mai) printf("%d\n",sum);
  else printf("%d\n",mai);
  return (0);
}


Measured memory_bytes: 128
#include <map>
#include <set>
#include <list>
#include <array>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	long long n; cin >> n;
	vector<array<long long, 2>> v(n);
	for (long long i = 0; i <= n - 1; i++) {
		cin >> v[i][1] >> v[i][0];
	}

	sort(v.begin(), v.end());

	long long curr_time = 0;
	for (auto i : v) {
		if (curr_time + i[1] > i[0]) {
			cout << "No";
			return 0;
		}

		curr_time += i[1];
	}

	cout << "Yes";

	return 0;
}

Measured memory_bytes: 5932
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>
#include <queue>
#include <set>
#include <bitset>
#include <map>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<long long> vll;
typedef queue<int, int> qii;
typedef pair<int, int> pii;
typedef pair<string, int> psi;

#define PI 3.14159265359
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rept(i,n) rep(i,0,n)

//int型を受け取ってその桁数を返す
int check_digits(int n) {
	int digits = 0;
	while (n != 0) {
		n /= 10;
		digits++;
	}
	return digits;
}

//int型を受け取ってその各桁の和を返す
int sum_digits(int n) {
	int sum=0;
	int N = n;
	while (N) {
		sum += N % 10;
		N /= 10;
	}
	return sum;
}


//最大公約数を返す関数
int gcd(int n, int m) {
	while (n != 0) {
		if (n < m) swap(n, m);
		n = n % m;
	}
	return m;
}


//2点間の距離を返す
float dis(int x1, int y1, int x2, int y2) {
	return sqrt(pow(abs(x1 - x2), 2) + pow(abs(y1 - y2), 2));
}

void yes() {
	cout << "Yes" << endl;
}

void no() {
	cout << "No" << endl;
}

int main() {
	int n, k,count=0;
	cin >> n >> k;
	while (n) {
		n /= k;
		count++;
	}

	cout << count << endl;
	

	//system("pause");
	return 0;
}

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

int main(){
  int n,m;
  cin >> n >> m;
  int a[2*m];
  int num[n]={};
  for(int i=0;i<2*m;i+=2){
    cin >> a[i] >> a[i+1];
  }
  for(int k : a){
    num[k-1]++;
  }
  for(int j=0;j<n;j++){
    cout << num[j] << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <bitset>
#include <tuple>
#include <stack>
#include <utility>

using namespace std;

int func753(int i){
    int c3 = 0, c5 = 0, c7 = 0;
    while(i > 0){
        if(i%10 == 3){
            c3 += 1;
            i = i/10;
        }
        else if(i%10 == 5){
            c5 += 1;
            i = i/10;
        }
        else if(i%10 == 7){
            c7 += 1;
            i = i/10;
        }
        else return 0;
    }
    if(c3*c5*c7 != 0) return 1;
    return 0;
}

int main(){
    int N;
    cin >> N;
    int n = N, keta = 0;
    while(n > 0){
        keta += 1;
        n = n/10;
    }
    int ans = 0, i=357;
    while(i <= N){
        if(func753(i)) ans += 1;
        if(i%10 == 3){
            i += 2;
        }
        else if(i%10 == 5){
            i+= 2;
        }
        else{
            if(i%100 == 37) i += 10;
            if(i%100 == 57) i += 10;
            if(i%100 == 77) i += 50;
            i += 6;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <limits.h>
#include <stdio.h>
using namespace std;
 
int main()
{
    int d,t,s;
    cin >> d>>t>>s;
    /*
    int a[n];
    std::vector<int> v;
    for(int i=0; i<n; i++){
        int tmp;
        cin >> tmp;
        a[i] = tmp;
    }
    */

    if(s*t >= d) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    //cout << a << endl;
    //cout << "Yes" << endl;
    //printf("%d\n", n);
 
    
    return 0;
}

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

struct UnionFind{
    vector<int> root;
    vector<int> sizes;
    UnionFind(int n): root(n + 1), sizes(n + 1,1){
        for(int i = 0; i <= n; i++) root[i] = i;
    }
    int find(int x){
        if(x == root[x]) return x;
        return root[x] = find(root[x]);
    }
    void unite(int x, int y){
        x = find(x);
        y = find(y);
        if(x == y) return;
        if(sizes[x] < sizes[y]) swap(x,y);
        root[y] = x;
        sizes[x] += sizes[y];
    }
    bool same(int x, int y){
        return find(x) == find(y);
    }
};

int main(){
    //input
    long long N,K,L;
    cin >> N >> K >> L;
    UnionFind doro(N), tetsu(N);
    long long p,q,i;
    for(i=1; i<=K; i++){
        cin >> p >> q;
        doro.unite(p,q);
    }
    for(i=1; i<=L; i++){
        cin >> p >> q;
        tetsu.unite(p,q);
    }

    //calc
    for(i=1; i<=N; i++){
        doro.find(i);
        tetsu.find(i);
    }
    map<pair<long long, long long>, long long> pars;
    for(i=1; i<=N; i++){
        pars[make_pair(doro.root[i],tetsu.root[i])]++;
    }

    //output
    for(i=1; i<=N-1; i++){
        cout << pars[make_pair(doro.root[i],tetsu.root[i])] << " ";
    }
    cout << pars[make_pair(doro.root[N],tetsu.root[N])] << endl;
    system("pause");
    return 0;
}

Measured memory_bytes: 17972
#include <bits/stdc++.h>
using namespace std;
#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 {
#ifdef 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__) << "] "
// debug & operator << (debug & dd, P p) { dd << "(" << p.x << ", " << p.y << ")"; return dd; }
#define ll long long

const long long mod = 1e+9 + 7; 

vector<long long>dp_table;

long long solve(long long remain){
    if(remain == 0)return 1;
    else if(remain < 0) return 0;
    if(dp_table[remain] > 0)return dp_table[remain];
    long long ans = 0;
    for(long long i = 3; i <= remain; i++){
        (ans += solve(remain - i)) %= mod;
    }
    
    return dp_table[remain] = ans;
}

bool comp(pair<long long, long long>a, pair<long long, long long>b){
    return (a.first + a.second) < (b.first + b.second);
}


void test_case(){
    int n;
    string s;
    cin >> n >> s;
    
    for(int i = 0; i < (int)s.size() ; i++){
        int value = s[i] - 'A';
        value += n;
        value %= 26;
        s[i] = value + 'A';
    } 
    cout << s << endl;
}


int main(){
    
    int t = 1;
    //cin >> t;
    for(int i = 0; i < t; i++)
        test_case();
    
    return 0;
} 


 


Measured memory_bytes: 3640
ip = lambda : map(int, input().split())
# ##############
N = int(input())
A = list(ip())
B = list(ip())
C = list(ip())
ans = 0
for i in range(N):
    ans+=B[A[i]-1]
    if i>=1 and A[i] - A[i-1] == 1:
        ans += C[A[i-1]-1]
print(ans)

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

using namespace std;

#define repd(i, a, b) for(int i=a; i<b; i++)
#define rep(i, a) repd(i, 0, a)
#define ll long long 

vector<int> s1 = {-1, 0, 1, -1, 1, -1, 0, 1};
vector<int> s2 = {-1, -1, -1, 0, 0, 1, 1, 1};

void check(vector<string>& v, int now_h, int now_w){
  if(v[now_h][now_w] == '#'){
    return;
  }
  int ans = 0;
  rep(d, 8){
    int a = now_h + s1[d];
    int b = now_w + s2[d];
    if(a < 0 || v.size()-1 < a) continue;
    if(b < 0 || v[now_h].size()-1 < b) continue;
    if(v[a][b] == '#') ans++;
  }
  v[now_h][now_w] = ans + '0';
}

int main(){
  int h, w;
  cin >> h >> w;
  vector<string> v;
  rep(i, h){
    string s;
    cin >> s;
    v.push_back(s);
  }
  rep(i, h){
    rep(j, w){
      check(v, i, j);
    }
  }
  rep(i, h){
    cout << v[i] << endl;
  }
  return 0;
}

Measured memory_bytes: 888
# -*- coding: utf-8 -*-
"""



"""
import sys


def solve(A, B):
    if A >= 13:
        return B
    if 6 <= A <= 12:
        return B // 2
    return 0


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 2940
import java.util.*;
import java.io.*;
public class Main{
	public static void main(String sp[])throws IOException{
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int x = sc.nextInt();
		int min = Math.max((x-k+1),-1000000);
		int max = Math.min((x+k-1), 1000000);
		for(int i=min;i<=max;i++)
			System.out.print(i+" ");
		System.out.println();
		
	}
	
	
	static class Reader
		{
			final private int BUFFER_SIZE = 1 << 16;
			private DataInputStream din;
			private byte[] buffer;
			private int bufferPointer, bytesRead;
			BufferedReader br;
			public Reader()
			{
				din = new DataInputStream(System.in);
				buffer = new byte[BUFFER_SIZE];
				bufferPointer = bytesRead = 0;
				br = new BufferedReader(new InputStreamReader(System.in));
			}
	 
			public Reader(String file_name) throws IOException
			{
				din = new DataInputStream(new FileInputStream(file_name));
				buffer = new byte[BUFFER_SIZE];
				bufferPointer = bytesRead = 0;
			}
	 
			public String readLine() throws IOException
			{
				byte[] buf = new byte[64]; // line length
				int cnt = 0, c;
				while ((c = read()) != -1)
				{
					if (c == '\n')
						break;
					buf[cnt++] = (byte) c;
				}
				return new String(buf, 0, cnt);
			}
			
			
			
	 
			public int nextInt() throws IOException
			{
				int ret = 0;
				byte c = read();
				while (c <= ' ')
					c = read();
				boolean neg = (c == '-');
				if (neg)
					c = read();
				do
				{
					ret = ret * 10 + c - '0';
				} while ((c = read()) >= '0' && c <= '9');
	 
				if (neg)
					return -ret;
				return ret;
			}
	 
			public long nextLong() throws IOException
			{
				long ret = 0;
				byte c = read();
				while (c <= ' ')
					c = read();
				boolean neg = (c == '-');
				if (neg)
					c = read();
				do
				{
					ret = ret * 10 + c - '0';
				}
				while ((c = read()) >= '0' && c <= '9');
				if (neg)
					return -ret;
				return ret;
			}
	 
			public double nextDouble() throws IOException
			{
				double ret = 0, div = 1;
				byte c = read();
				while (c <= ' ')
					c = read();
				boolean neg = (c == '-');
				if (neg)
					c = read();
	 
				do
				{
					ret = ret * 10 + c - '0';
				}
				while ((c = read()) >= '0' && c <= '9');
	 
				if (c == '.')
				{
					while ((c = read()) >= '0' && c <= '9')
					{
						ret += (c - '0') / (div *= 10);
					}
				}
	 
				if (neg)
					return -ret;
				return ret;
			}
	 
			private void fillBuffer() throws IOException
			{
				bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
				if (bytesRead == -1)
					buffer[0] = -1;
			}
	 
			private byte read() throws IOException
			{
				if (bufferPointer == bytesRead)
					fillBuffer();
				return buffer[bufferPointer++];
			}
			StringTokenizer st;
			String next() {
				while (st == null || !st.hasMoreTokens()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (Exception r) {
						r.printStackTrace();
					}
				}
				return st.nextToken();
			}
	 
	 
			public void close() throws IOException
			{
				if (din == null)
					return;
				din.close();
			}
		}
}

Measured memory_bytes: 21716
#!/usr/bin/env python3
import sys
from itertools import product
from collections import Counter
# from itertools import combinations


def solve(N, A):
    B = [i - A[i] for i in range(N)]
    C = [i + A[i] for i in range(N)]
    Bc = Counter(B)
    Cc = Counter(C)
    ct = 0
    for k, i in Bc.items():
        if k in Cc:
            ct += i * Cc[k]
    print(ct)
    # bg = []
    # sm = []
    # # cl = set()
    # for i in range(N):
    #     if A[i] <= i - 1:
    #         bg.append(i)
    #         # cl.add(i)
    #     if A[i] >= 1 - i:
    #         sm.append(i)
    #         # cl.add(i)
    # # L = list(combinations(cl, 2))
    # L = list(product(bg, sm))
    # ct = 0
    # for l in L:
    #     if l[0] > l[1]:
    #         if abs(l[0] - l[1]) == A[l[0]] + A[l[1]]:
    #             ct += 1
    # print(ct)
    # # L = list(combinations(range(N), 2))
    # # ct = 0
    # # for l in L:
    # #     if abs(l[0] - l[1]) == A[l[0]] + A[l[1]]:
    # #         ct += 1
    # # print(ct)
    # return

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
            for line in sys.stdin:
                for word in line.split():
                    yield word
    tokens = iterate_tokens()
    N = int(next(tokens))
    A = [int(next(tokens)) for _ in range(N)]
    solve(N, A)

if __name__ == '__main__':
    main()

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

int main(){
    string s;
    cin >> s;
    int n=s.size();
    int ctr=0;
    int ans=0;
    rp(i,n){
        if(s.at(i)=='0') {
            if(ctr<0) ans += 2;
            ctr++;
        }
        if(s.at(i)=='1') {
            if(ctr>0) ans += 2;
            ctr--;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
/************************************************************
/  AUTHOR :  DEVANSHU SINGLA                                /
/  NICK :  DSINGLA                                          /
/  INSTITUTE :  IITK                                        /
************************************************************/
//                     TEMPLATE                            //

#include <bits/stdc++.h>
#define ll long long
#define N 100005
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define F first
#define S second
#define MAX(x, y) (x) > (y) ? (x) : (y)
#define MIN(x, y) (x) < (y) ? (x) : (y)

using namespace std ;

void solve(){
    int a,b,c,d ;
    cin>>a>>b>>c>>d ;
    int x = (c-1)/b ;
    int y = (a-1)/d ;

    if(x>y) cout<<"No" ;
    else cout<<"Yes" ;
}

int main(){
    #ifndef ONLINE_JUDGE 
 
    freopen("/home/devanshu/Desktop/cp/cp_questions/input.txt", "r", stdin);  
    freopen("/home/devanshu/Desktop/cp/cp_questions/output.txt", "w", stdout); 

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

    solve() ;
}

Measured memory_bytes: 3640
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        System.out.println(solve(N));

        sc.close();
    }

    static int solve(int N) {
        int[] primes = IntStream.rangeClosed(2, N).filter(Main::isPrime).toArray();
        int[] counts = new int[primes.length];

        for (int i = 1; i <= N; ++i) {
            int rest = i;
            for (int j = 0; j < primes.length; ++j) {
                while (rest % primes[j] == 0) {
                    rest /= primes[j];
                    ++counts[j];
                }
            }
        }

        return search(counts, 0, 75);
    }

    static boolean isPrime(int n) {
        for (int i = 2; i * i <= n; ++i) {
            if (n % i == 0) {
                return false;
            }
        }

        return true;
    }

    static int search(int[] counts, int index, int rest) {
        if (index == counts.length) {
            return (rest == 1) ? 1 : 0;
        }

        int result = 0;
        for (int i = 0; i <= counts[index]; ++i) {
            if (rest % (i + 1) == 0) {
                result += search(counts, index + 1, rest / (i + 1));
            }
        }

        return result;
    }
}

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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;
typedef tuple<ll, ll, ll, ll, ll> t5;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

using namespace std;

static const ll INF = 1e15;

template<typename T>
static inline void chmin(T & ref, const T  value) {
	if (ref > value) ref = value;
}

template<typename T>
static inline void chmax(T& ref, const T value) {
	if (ref < value) ref = value;
}

const ll mod = 1000000007;

ll mpow(ll x, ll n) {
	ll ans = 1; x %= mod;
	while (n != 0) {
		if (n & 1) ans = ans * x % mod;
		x = x * x % mod;
		n = n >> 1;
	}
	return ans;
}

ll inv_mod(ll a) { return mpow(a, mod - 2); }

class Factorial {
private:
	vector<ll> fac;
	vector<ll> ifac;
public:

	Factorial(ll N) {
		fac.push_back(1);
		for (int i = 0; i < N; i++) fac.push_back(fac[i] * (i + 1) % mod);
		ifac.resize(N + 1);
		ifac[N] = inv_mod(fac[N]);
		for (int i = 0; i < N; i++) ifac[N - 1 - i] = (ifac[N - i] * (N - i)) % mod;
	}

	ll fact(ll a) { return fac[a]; }
	ll ifact(ll a) { return ifac[a]; }

	ll cmb(ll a, ll b) {
		if (a == 0 && b == 0) return 1;
		if (a < b || a < 0 || b < 0) return 0;
		ll tmp = ifact(a - b) * ifact(b) % mod;
		return tmp * fac[a] % mod;
	}
	ll per(ll a, ll b) {
		if (a == 0 && b == 0) return 1;
		if (a < b || a < 0 || b < 0) return 0;
		return fac[a] * ifac[a - b] % mod;
	}
};

void solve1() {
	ll w, h, k;
	cin >> w >> h >> k;
	//xとyで分解する
	const ll all = w * h;
	Factorial f(all);
	ll sum = 0;
	map<ll, ll> memo;
	for (int x1 = 0; x1 < w - 1; x1++) {
		for (int x2 = x1 + 1; x2 < w; x2++) {
			ll dx = x2 - x1;
			//x1, x2... h通りあり
			memo[dx]++;
			dx *= h * h;
			dx %= mod;
			dx *= f.cmb(all - 2, k - 2);
			dx %= mod;
			sum += dx;
			sum %= mod;
		}
	}
	cout << sum << endl;
	ll sum2 = 0;
	for (int y1 = 0; y1 < h - 1; y1++) {
		for (int y2 = y1 + 1; y2 < h; y2++) {
			ll dy = y2 - y1;
			//x1, x2... h通りあり
			dy *= w * w;
			dy %= mod;
			dy *= f.cmb(all - 2, k - 2);
			dy %= mod;
			sum2 += dy;
			sum2 %= mod;
		}
	}
	cout << (sum + sum2) % mod << endl;
}

int main() {
	//solve1();
	ll w, h, k;
	cin >> w >> h >> k;
	//xとyで分解する
	const ll all = w * h;
	Factorial f(all);
	ll wsum = 0;
	for (int i = 1; i < w; i++) {
		wsum += i * (w - i);
		wsum %= mod;
	}
	//cout << wsum << endl;
	wsum %= mod;
	wsum *= h * h;
	wsum %= mod;
	wsum *= f.cmb(all - 2, k - 2);
	wsum %= mod;
	ll hsum = 0;
	for (int i = 1; i < h; i++) {
		hsum += i * (h - i);
		hsum %= mod;
	}
	hsum %= mod;
	hsum *= w * w;
	hsum %= mod;
	hsum *= f.cmb(all - 2, k - 2);
	hsum %= mod;
	ll sum = hsum + wsum;
	sum %= mod;
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 6392
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const ll MOD = 1e9+7; ll LLINF = 1LL << 60; int INF = INT_MAX;

//

int main(){
    string s; cin>>s;
    if(s[0]==s[2]) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
INF=100000000
N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*N
for i in range(1,N):
    dp[i]=min(dp[j]+abs(h[j]-h[i]) for j in range(max(i-K,0),i))
print(dp[N-1])

Measured memory_bytes: 53216
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define int ll
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

signed main(void) {
    int i,j;
    int n;
    cin >> n;
    vi a(n),b(n);
    vector<pii>c(2*n);
    int asum = 0, bsum = 0;
    rep(i,n){
        cin >> a[i] >> b[i];
        c[i] = pii(a[i],i);
        c[n+i] = pii(b[i],i);
        asum += a[i];
        bsum += b[i];
    }
    int tmp = min(asum, bsum);
    sort(all(c));
    int ans = 0;
    vi used(n,0);
    bool r = false;
    rep(i,n){
        ans += c[i].first;
        int ind = c[i].second;
        if(used[ind])r = true;
        used[ind]++;
    }
    if(r == false){
        if(c[n].second == c[n-1].second){
            int t1 = c[n].first-c[n-2].first;
            int t2 = c[n+1].first-c[n-1].first;
            ans += min(t1,t2);
        }else{
            ans += c[n].first;
            ans -= c[n-1].first;
        }
    }
    cout << min(ans,tmp) << endl;
}


Measured memory_bytes: 5760
using System;

class ABC_125_D
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());

        string[] input = Console.ReadLine().Split(' ');
        int[] A = new int[N];
        bool hasZero = false;
        int minusCount = 0;
        int absMin = int.MaxValue;
        for (int i = 0; i < N; i++)
        {
            A[i] = int.Parse(input[i]);
            if(A[i] == 0) hasZero = true;
            if (A[i] < 0) minusCount++;
            if (Math.Abs(A[i]) < absMin) absMin = Math.Abs(A[i]);
        }

        if(hasZero)
        {
            long ans = 0;
            for (int i = 0; i < N; i++)
            {
                ans += Math.Abs(A[i]);
            }
            Console.WriteLine(ans);
            return;
        }

        if (minusCount % 2 == 0)
        {
            long ans = 0;
            for (int i = 0; i < N; i++)
            {
                ans += Math.Abs(A[i]);
            }
            Console.WriteLine(ans);
        }
        else
        {
            long ans = 0;
            for (int i = 0; i < N; i++)
            {
                ans += Math.Abs(A[i]);
            }

            ans -= absMin * 2;
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 26844
let rec codiv a b = 
    if a=0 then b
    else if b=0 then a
    else if a=b then a
    else if a<b then codiv a (b mod a)
    else codiv b (a mod b)
;;

let () = 
    let num = Scanf.scanf "%d %d" codiv in
    print_int num;
    print_newline ();
;;

Measured memory_bytes: 2436
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

# 解説AC
ans, num = 0,1
for i in range(60):
    cnt = sum((ai & num) == num for ai in a)
    ans += (cnt * (n - cnt) * num) % mod
    num <<= 1
print(ans % mod)


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

int main() {
  long long n;
  cin >> n;
  
  int d = 1;
  for(long i=1; i*i<=n; i++) {
    if(n % i == 0) {
      d = i;
    }
  }
  
  cout << n / d + d - 2 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n);++i)
using namespace std;
using ll = long long; 
using P = pair<int,int>;
using vv = vector<vector<ll>>;
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;}

const int INF = 2147483647;
const long long inf = 1ll << 60;
const long long mod = 1000000007;

int dx[4] = {1,0,-1,0};
int dy[4] = {0,-1,0,1};
int main(){
    ll n; cin >> n;
    n--;
    string ans="";
    while(n>=0){
	ans = (char)(n%26 + 'a') + ans;
	n /= 26;
	n--;
    }
    cout << ans << endl;
    return 0;
}


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


signed main()
 {
   int n,z = 0;
   cin>>n;
   if(n == 1000)
   {
     cout<<0<<"\n";
   }
   else if( n < 1000)
   {
     z = 1000-n;
     cout<<z<<"\n";
   }
   else if(n > 1000 && n <=2000)
   {
     z = 2000-n;
     cout<<z<<"\n";
   }
   else if(n > 2000 && n <= 3000)
   {
     z = 3000 - n;
     cout<<z<<"\n";
   }
   else if(n > 3000 && n <= 4000)
   {
     z = 4000 - n;
     cout<<z<<"\n";
   }
   else if(n > 4000 && n <=5000)
   {
     z = 5000 - n;
     cout<<z<<"\n";
   }
   else if(n > 5000 && n <= 6000)
   {
     z = 6000 - n;
     cout<<z<<"\n";
   }
   else if(n > 6000 && n <= 7000)
   {
     z = 7000 - n;
     cout<<z<<"\n";
   }
   else if(n > 7000 && n <= 8000)
   {
     z = 8000 - n;
     cout<<z<<"\n";
   }
   else if(n > 8000 && n <= 9000)
   {
     z = 9000 - n;
     cout<<z<<"\n";
   }
   else if(n > 9000 && n <=10000)
   {
     z = 10000 - n;
     cout<<z<<"\n";
   }

   return 0;
 }


Measured memory_bytes: 3564
using System;
using System.Linq;
class Program
{
    static void Main()
    {
        int[] input = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
        //int input=int.Parse(Console.ReadLine());
        //string a = Console.ReadLine();
        Console.WriteLine((input[0]-1)*(input[1]-1));
        Console.ReadLine();
    }
}


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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
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 MOD = 1000000007;

int main() {
    ll n, k;
    cin >> n >> k;

    vector<ll> a(n);
    map<int, ll> m;
    REP(i, n) {
        cin >> a[i];
        m[a[i]]++;
    }
    vector<int> sum(2001, 0);
    REP(i, 2001) {
        sum[i + 1] = sum[i] + m[i + 1];
    }

    //REP1(i, 10) cout << sum[i] << " "; cout << endl;

    ll ans = 0;
    REP(i, n - 1) {
        FOR(j, i + 1, n) {
            if (a[i] > a[j]) ans++;
        }
    }
    ans = (ans * k) % MOD;

    REP(i, n) {
        ll tmp = ((ll)sum[a[i] - 1] * ((k * (k - 1) / 2) % MOD)) % MOD;
        ans = (ans + tmp) % MOD;
    }

    cout << ans << endl;
}

Measured memory_bytes: 384
// Try SHPC 2018 MT Qual
// author: Leonardone @ NEETSDKASU

fn main() {
	let mut stdin = String::new();
    std::io::Read::read_to_string(
    	&mut std::io::stdin(),
        &mut stdin).unwrap();
	let mut stdin = stdin.split_whitespace();
    let mut get = || stdin.next().unwrap();
    macro_rules! get {
    	($t:ty) => (get().parse::<$t>().unwrap());
        () =>  (get!(i64));
    }
    
    let s = get().as_bytes();
    let w = get!(usize);
    
    let mut i = 0;
    while i < s.len() {
    	print!("{}", s[i] as char);
        i += w;
    }
    println!();
}

Measured memory_bytes: 4352
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include <iostream>
#include <fstream>

#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define RFOR(i,a,b) for(int i = (int)(b-1);i>=(int)(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " <<
#define outdicimal out << fixed << setprecision(10)//TODO 小数点以下の桁数の変更
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;


class BBounding {
public:
	void solve(std::istream& in, std::ostream& out) {
    int n,x;
    in >> n >> x;
    vector<int> l(n);
    REP(i,n) in >> l[i];
    int ans = 1;
    int d = 0;
    REP(i,n){
      d = d + l[i];
      if(d <= x){
        ans++;
      }
      else{
        break;
      }
    }
    out << ans << endl;
	}
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed;
	BBounding solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.nextLine().split(" ");
        int a = Integer.parseInt(str[0]);
        int b = Integer.parseInt(str[1]);
        int c = Integer.parseInt(str[2]);
        int cnt = 0;
        for (int i = a; i <= b; i++) {
            if (c % i == 0) cnt++;
        }
        System.out.println(cnt);
    }
}


Measured memory_bytes: 26360
#include <iostream>

int main()
{
	int n;
	std::cin >> n;
	int count = 0;
	int ans = 0;
	for (int i = 1; i <= n; i++)
	{
		if (i % 2 == 0)
			continue;
		for (int j = 1; j <= i; j++)
		{
			if (i % j == 0 )
				++count; 
		}
		if (count == 8)
			++ans;
		count = 0;
	}
	std::cout << ans << '\n';

}


Measured memory_bytes: 256
// Created by Nandu Vinodan
#include <bits/stdc++.h>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define pi pair<int, int>
#define INF INT_MAX
#define _INF INT_MIN
#define TC 0

using namespace std;
using ll = long long;

void testcase() {
    string s;
     cin >> s;

     if (s[2]==s[3] && s[4]==s[5]) cout << "Yes";
     else cout << "No";
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    if (TC)
        cin>>t;
    while(t--) {
        testcase();
    }
    return 0;
}

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

#pragma warning(disable : 4996)

using namespace std;

int n, k, r[100]; string S;

const string T = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main()
{
	while (true)
	{
		scanf("%d", &n);

		if (n == 0) break;

		for (int i = 0; i < n; i++)
		{
			scanf("%d", &r[i]);;
		}

		cin >> S;

		for (int i = 0; i < S.size(); i++)
		{
			int key;

			for (int j = 52; j < 104; j++)
			{
				if (S[i] == T[j]) key = j;
			}

			key -= r[i % n]; S[i] = T[key];
		}

		cout << S << endl;
	}

	return 0;
}

Measured memory_bytes: 3248
N, M = map(int, input().split())
lst = []

for _ in range(M):
    a, b = map(int, input().split())
    lst.append([a, b])

lst.sort(key = lambda x : x[1])

q = -1
ctr = 0

for i in range(M):
    if lst[i][0] < q: continue
    ctr += 1
    q = lst[i][1]

print(ctr)

Measured memory_bytes: 62616
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    H, W = map(int, readline().split())
    A = [list(map(int, readline().split())) for _ in range(H)]
    B = [list(map(int, readline().split())) for _ in range(H)]

    M = 0
    G = [[0] * W for _ in range(H)]
    for i in range(H):
        for j in range(W):
            G[i][j] = abs(A[i][j] - B[i][j])
            if M < G[i][j]:
                M = G[i][j]

    M = 20000
    dp = [[0] * W for _ in range(H)]
    dp[0][0] = 1 << (M + G[0][0]) | 1 << (M - G[0][0])

    for i in range(H):
        for j in range(W):
            if i + 1 < H:
                dp[i + 1][j] |= (dp[i][j] >> G[i + 1][j]) | (dp[i][j] << G[i + 1][j])
            if j + 1 < W:
                dp[i][j + 1] |= (dp[i][j] >> G[i][j + 1]) | (dp[i][j] << G[i][j + 1])

    ans = INF
    for i in range(2 * M + 2):
        if dp[H - 1][W - 1] & (1 << i) and ans > abs(i - M):
            ans = abs(i - M)

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 93840
#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <deque>
#include <iterator>
#include <iomanip>
#include <queue>
using namespace std;


int main(){
    long long n, m;
    cin >> n >> m;
    long long a = n / 2;
    long long b = a + 1;
    while(m){
        if(n == 2 * (b - a) || n == 2 * (b - a - 1)) b++; 
        m--;
        cout << a << " " << b << endl;
        a--, b++;
    }
}

Measured memory_bytes: 3648
n,h=map(int,input().split())
a=[0 for _ in range(n)]
b=a[:]
for i in range(n):
  a[i],b[i]=map(int,input().split())
mxa=max(a)
b.sort(reverse=1)
dmg=0
ans=0
for x in b:
  if x>=mxa:
    if h>0:
      h-=x
      ans+=1
      if h<=0:
        print(ans)
        exit()
    else:
      print(ans+1)
      exit()
      
  else:
      ans+=(h+mxa-1)//mxa
      h-=(h+mxa-1)//mxa*mxa
      break
if h>0:
  ans+=(h+mxa-1)//mxa
  h-=(h+mxa-1)//mxa*mxa
print(ans)


Measured memory_bytes: 11380
#include <bits/stdc++.h>
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 ll mod=1e9+7;
const ll inf=1ll<<60;

/* */

int main(){

    // 入力スタンダード（複数指定）
    int n;
    cin >> n;
    // **************************************
    ll hi[n];
    ll c[n];
    for(int i=0; i<n; i++){
        cin >> hi[i];
        c[i] = inf;
    } 
    // **************************************
    
    c[0]=0;
    c[1]=abs(hi[1]-hi[0]);
    for(int i=2; i<n; i++){
        chmin(c[i], c[i-2] + abs(hi[i]-hi[i-2]) );
        chmin(c[i], c[i-1] + abs(hi[i]-hi[i-1]) );
    }
    
    cout << c[n-1] <<endl;

    return 0;
}

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    vector<int>nums;
    
    while(n != 0){
        nums.push_back(n%10);
        n = n/10;
    }
    int i = 0;
    int j = nums.size()-1;
    if((nums[i] == nums[i+1] && nums[i] ==  nums[i+2]) || (nums[j] == nums[j-1] && nums[j] == nums[j-2])){
        cout << "Yes" << "\n";
    }
    else{
        cout << "No"<<"\n";
    }
    return 0;
}

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

#define li long long int
#define rep(i, to) for (li i = 0; i < ((li)(to)); i++)
#define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++)



int main(void)
{
	string s;
	cin >> s;
	li n = s.size();

	li res = 0;
	rep(i, 1 << (n - 1)) {
		bitset<12> bs(i);
		li now = 0;
		li tmp = 0;
		rep(j, n - 1) {
			tmp += s[j] - '0';
			if (bs[j]) {
				now += tmp;
				tmp = 0;
			} else {
				tmp *= 10;
			}
		}
		tmp += s[n - 1] - '0';
		now += tmp;
		//cout << i << " : " << now << endl;
		res += now;

	}
	cout << res << endl;



	return 0;
}

Measured memory_bytes: 256