akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
import java.io.*;

import static java.lang.Character.isUpperCase;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        String S = in.next();
        String[] w  = new String[]{"Sunny" , "Cloudy" , "Rainy"};
        String[] w1 = new String[]{"Cloudy" , "Rainy" , "Sunny"};
        for (int i = 0; i<3; i++)
        {
            if(S.equals(w[i]))
            {
                System.out.println(w1[i]);
            }
        }






        }







    }
















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

int main()
{

        long long A, B, M;
        cin >> A >> B >> M;
        int a[A];
        int b[B];
        int x[M];
        int y[M];
        int c[M];
        int a_min = 0;
        for (int i = 0; i < A; ++i) {
                cin >> a[i];
                if (i == 0) {
                        a_min = a[i];
                }
                else {
                        if (a_min > a[i]) {
                                a_min = a[i];
                        }
                }
        }
        int b_min = 0;
        for (int i = 0; i < B; ++i) {
                cin >> b[i];
                if(i == 0) {
                        b_min = b[i];
                }
                else {
                        if (b_min > b[i]){
                                b_min = b[i];
                        }
                }
        }
        for (int i = 0; i < M; ++i) {
                cin >> x[i] >> y[i] >> c[i];
        }

        int sum = a_min + b_min;
        for (int i = 0; i < M; ++i) {

                int biki = a[x[i]-1] + b[y[i]-1] - c[i];
                if (sum > biki) {
                        sum = biki;
                }
        }
        cout << sum << endl;





}


Measured memory_bytes: 2176
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    vector<int>v1 = {1,3,5,7,8,10,12};
    vector<int>v2 = {4,6,9,11};
    vector<int>v3 = {2};

    int x,y = 0;
    cin >> x >> y;

    //探索
    auto resultf = find(v1.begin(),v1.end(),x);
    if(resultf == v1.end()){
        auto resultt = find(v2.begin(),v2.end(),x);
        if(resultt == v2.end()){
            cout << "No" << endl;
        }else{
            auto resultty = find(v2.begin(),v2.end(),y);
            if(resultty == v2.end()){
                cout << "No" << endl;
            }else{
                cout << "Yes" << endl;
            }
        }
    }else{
        auto resultfy = find(v1.begin(),v1.end(),y);
        if(resultfy == v1.end()){
            cout << "No" << endl;
        }else{
            cout << "Yes" << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 256
//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=nxt[i])
#define repvc(i,vc) for(int i=0,Sz=vc.size();i<Sz;++i)
using namespace std;
inline int read()
{
	char ch=getchar();int ret=0,f=1;
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}

inline void print(string name,int *arr,int len){
	rep(i,1,len) printf("%s[%d]=%d\n",name.c_str(),i,arr[i]);puts("");
}
inline void print(string name,int a){
	printf("%s=%d\n",name.c_str(),a);puts("");
}

typedef long long ll;
const int INF=1<<30;

const int maxn=100000+10;
string s[maxn];

int main()
{
	int n;cin>>n;
	rep(i,1,n) {
		cin>>s[i];
		sort(s[i].begin(),s[i].end());
	}
	sort(s+1,s+n+1);
	ll ans=0;
	ll cnt=0;
	rep(i,1,n)
	{
		if(i!=1 && s[i]!=s[i-1])
		{
			ans+=cnt*(cnt-1)/2;
			cnt=1;
		}
		else ++cnt;
	}
	cout<<ans+cnt*(cnt-1)/2<<endl;
	return 0;
}


Measured memory_bytes: 7296
import java.math.BigInteger;
import java.util.Scanner;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		BigInteger a,b;
		Scanner cin=new Scanner(System.in);
		a=cin.nextBigInteger();
		b=cin.nextBigInteger();
		System.out.println(a.divide(b));
	}
}



Measured memory_bytes: 26552
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	long long n, m, i, j, k, aa, bb, cc, x, ct, ans;
	cin >> n >> m;
	vector<long long> a(n), s(n);
	for (i = 0; i < n; i++) cin >> a[i];
	sort(a.begin(), a.end());
	s[n - 1] = a[n - 1];
	for (i = n - 2; i >= 0; i--) s[i] = s[i + 1] + a[i];

	aa = 0; bb = 1LL << 60;
	while (aa < bb) {
		cc = (aa + bb + 1) / 2;
		ct = 0;
		for (i = 0; i < n; i++) {
			x = a.end() - lower_bound(a.begin(), a.end(), cc - a[i]);
			ct += x;
		}

		if (ct >= m) aa = cc;
		else bb = cc - 1;
	}

	ct = 0;
	ans = 0;
	for (i = 0; i < n; i++) {
		x = a.end() - lower_bound(a.begin(), a.end(), aa - a[i]);
		if (x > 0) {
			ans += x * a[i] + s[n - x];
			ct += x;
		}
	}
	if (ct > m) ans -= aa * (ct - m);
	cout << ans << "\n";



	return 0;
}


Measured memory_bytes: 1920
H, W = map(int, input().split())
res = min(H, W)
h = round(H / 3)
w = W // 2
s1 = h * W
s2 = (H-h) * w
s3 = (H-h) * (W-w)
res = min(res, max(s1, s2, s3) - min(s1, s2, s3))
w = round(W / 3)
h = H // 2
s1 = w * H
s2 = (W-w) * h
s3 = (W-w) * (H-h)
res = min(res, max(s1, s2, s3) - min(s1, s2, s3))
if H % 3 == 0 or W % 3 == 0:
    res = 0
print(res)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

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

  vector<vector<int>> jobs(m);

  rep(i,n) {
    int a, b;
    cin >> a >> b;
    if(a > m) { 
        continue;
    }
    jobs[m-a].push_back(b);
  }

  priority_queue<int> prQ;

  ll ans = 0;
  for (int i = m-1; i >= 0; i--) {
    for (int b : jobs[i]) {
      prQ.push(b);
    }
    
    if (!prQ.empty()) {
      ans += prQ.top();
      prQ.pop();
    }
  }

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

Measured memory_bytes: 5504
import io
import os

from collections import Counter, defaultdict, deque


def solve(N, K, A):
    window = deque()
    ans = []
    for x in A:
        window.append(x)

        if len(window) > K:
            if window.popleft() < x:
                ans.append("Yes")
            else:
                ans.append("No")
    return "\n".join(ans)


if __name__ == "__main__":
    input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    ans = solve(N, K, A)
    print(ans)



Measured memory_bytes: 99532
n=int(input())
D={}
for i in range(n):
    s,p=input().split()
    p=int(p)
    if s in D:
        D[s].append([i+1,p])
    else:
        D[s]=[[i+1,p]]
S=sorted(D)
for s in S:
    d=D[s]
    P={}
    for i in d:
        P[i[1]]=i[0]
    p=reversed(sorted(P))
    for q in p:
        print(P[q])

Measured memory_bytes: 3064
def gcd(x, y):
    while y != 0:
        temp = y
        y = x % y
        x = temp
    return x


N, X = map(int, input().split())

x = list(map(int, input().split()))

dist_list = [abs(X - e) for e in x]

ans = dist_list[0]
for e in dist_list:
    ans = gcd(ans, e)


print(ans)


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

using namespace std;

#define MOD 10007

int N,dp[1050][1<<3];
char sch[1050];

int getNum(char c){
  if(c == 'J'){
    return 0;
  }else if(c == 'O'){
    return 1;
  }
  return 2;
}

int main(){
  cin >> N >> sch;
  memset(dp,0,sizeof(dp));
  
  for(int i = 0 ; i < (1<<3) ; i++){
    if((1<<getNum('J') & i) && (1<<getNum(sch[0]) & i)){
      dp[0][i] = 1;
    }
  }
  for(int i = 1 ; i < N ; i++){
    for(int j = 0 ; j < (1<<3) ; j++){
      for(int k = 0 ; k < (1<<3) ; k++){
        if(j & k){
          if(!(k & (1<<getNum(sch[i])))) continue;
          dp[i][k] = dp[i][k] + dp[i-1][j];
          dp[i][k] %= MOD;
        }
      }
    }
  }
  int ans = 0;
  for(int i = 0 ; i < (1<<3) ; i++){
    ans += dp[N-1][i];
    ans %= MOD;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1204
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <complex>
#include <cassert>
#include <random>
#include <cstring>
#include <numeric>
#define ll long long
#define ld long double
#define null NULL
#define all(a) a.begin(), a.end()
#define forn(i, n) for (int i = 0; i < n; ++i)
#define sz(a) (int)a.size()
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
template<class T> int gmax(T &a, T b) { if (b > a) { a = b; return 1; } return 0; }
template<class T> int gmin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
using namespace std;

int main() {
    int x;
    while(~scanf("%d", &x)) {
        printf("%d\n", 3 * x * x);
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 100000000;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
const ll MAX = 200010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h,w,d;
    cin >> h >> w >> d;
    vector<P> place(h*w+1);
    ll a;
    rep(i,h){
        rep(j,w){
            cin >> a;
            place[a] = P(i,j);
        }
    }
    vector<vector<ll>> power(d);
    rep(i,d) power[i].push_back(0);
    rep(i,d,h*w+1){
        ll x,y,nx,ny;
        tie(x,y) = place[i-d];
        tie(nx,ny) = place[i];
        power[i%d].push_back(abs(nx-x)+abs(ny-y));
    }
    rep(i,d){
        rep(j,power[i].size()-1){
            power[i][j+1] += power[i][j];
        }
    }
    ll q;
    cin >> q;
    ll l,r;
    rep(i,q){
        cin >> l >> r;
        PRINT(power[l%d][r/d]-power[l%d][l/d]);
    }
}



Measured memory_bytes: 6784
#include<iostream>
#include<cstdio>
#include<stdio.h>
#include<cstring>
#include<vector>
#include<iostream>
#include<math.h>
#include<map>
#include<algorithm>
#include<set>
#include<string>
#define s(n) scanf("%d",&n)
#define p(n) printf("%d\n",n)
#include <iostream>
#include <fstream>
#define fs(n) fscanf(fin,"%d",&n)
#define fp(n) fprintf(fout,"%d\n",n)
using namespace std;
typedef long long ll;


ll m[300010];
ll a[100010],n,k,q;
void init(ll i,ll l,ll r)
{
if(r<l)
return;
if(r==l)
{
m[i]=l;
return;
}
ll mid=(l+r)/2;
init(2*i,l,mid);
init(2*i+1,mid+1,r);
if(a[m[2*i]]<a[m[2*i+1]])
m[i]=m[2*i];
else
m[i]=m[2*i+1];
return;
  
  }
  
ll find(ll i,ll x,ll y,ll l,ll r)
{
	
if(r<l)
return -1;
if(l>y||r<x)
	  return -1;
if(l>=x&&r<=y)
return m[i];

ll mid=(l+r)/2;
ll p1=find(2*i,x,y,l,mid);
ll p2=find(2*i+1,x,y,mid+1,r);

if(p1==-1&&p2!=-1)
return p2;
else if(p1!=-1&&p2==-1)
return p1;
else if(p1==-1&&p2==-1)
return -1;
else
{
	if(a[p1]<a[p2])
	  return p1;
	else 
	return p2;
}
 
	
}

void update(int i,int x,int y,int l,int r)
{
	if(r<l)
	return;
	if(x<l||x>r)
	  return;

if(x==l&&x==r)
{
m[i]=l;
	a[x]=y;
	return;
}

int mid=(l+r)/2;
update(2*i,x,y,l,mid);

update(2*i+1,x,y,mid+1,r);
if(a[m[2*i]]<a[m[2*i+1]])
m[i]=m[2*i];
else
m[i]=m[2*i+1];
}


int main () {
ll com ,x,y;
scanf("%lld%lld",&n,&q);
for(ll i=0;i<n;i++)
  a[i]=(1<<31)-1;
init(1,0,n-1); 

for(ll i=0;i<q;i++)
{
	scanf("%lld%lld%lld",&com,&x,&y);
if(com==0)
update(1,x,y,0,n-1);
else
	printf("%lld\n",a[find(1,x,y,0,n-1)]);
}
/*	for(ll j=0;j<n;j++)
	printf("%lld ",a[j]);*/
//printf("%lld ",find(0,2));
return 0;
}

Measured memory_bytes: 4016
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

const int N = 1000*1000+10;

long long T[N];
long long A[N];
long long P[N];
vector <long long> R;

void Wczytaj(int n,int q){
	long long d;
	int i;
	for(i=0; i<q; i++){
		scanf("%lld", &d);
		while(R.size() > 0 && R.back() >= d) R.pop_back();
		R.push_back(d);
	}
}

int Next(int p,int k,long long z){
	int s;
	while(p<k){
		s = (p+k+1)/2;
		if(z >= R[s]) p = s;
		else k = s-1;
	}
	if(z >= R[p]) return k;
	return -1;
}

int main(){
	int n,q;
	int i,j,l;
	long long k;
	scanf("%d%d", &n,&q);
	R.push_back(n);
	Wczytaj(n,q);
	T[R.size()-1] = 1;
	for(i=R.size()-1; i>=0; i--){
		k = R[i];
		j = i-1;
		while(j>=0){
			l = Next(0,j,k);
			if(l<0) break;
			T[l] += T[i]*(k/R[l]);
			k = k%R[l];
			j = l-1;
		}
		A[k] += T[i];
	}
	for(i=n; i>=1; i--){
		P[i] = A[i]+P[i+1];
	}
	for(i=1; i<=n; i++) printf("%lld\n", P[i]);
	return 0;
}

Measured memory_bytes: 4980
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
s = a+b+c+d+e
l = []
l.append((10-a%10)%10)
l.append((10-b%10)%10)
l.append((10-c%10)%10)
l.append((10-d%10)%10)
l.append((10-e%10)%10)
l.sort()
print(s+sum(l[:-1]))

Measured memory_bytes: 3064
#include<cmath>
#include<cstdio>
#include<vector>
#include<complex>
#include<algorithm>

#define pb       push_back
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

typedef complex<double> Point;
typedef vector<Point>   Polygon;

const double EPS=1e-9;

class Line:public vector<Point>{
public:
	Line(){}
	Line(const Point &a,const Point &b){ pb(a), pb(b); }
};

class Segment:public Line{
public:
	Segment(){}
	Segment(const Point &a,const Point &b):Line(a,b){}
};

namespace std{
	bool operator <(const Point &a,const Point &b){
		return (real(a)==real(b))?(imag(a)<imag(b)):(real(a)<real(b));
	}
}

double dot(const Point &a,const Point &b){
	return real(a)*real(b)+imag(a)*imag(b);
}

double cross(const Point &a,const Point &b){
	return real(a)*imag(b)-imag(a)*real(b);
}

enum {CCW=1,CW=-1,ON=0};
int ccw(const Point &a,Point b,Point c){
	b-=a,c-=a;
	double rotdir=cross(b,c);
	if(rotdir>EPS)  return CCW;
	if(rotdir<-EPS) return CW;
	return ON;
}

Polygon ConvexHull(vector<Point> ps){
	int n=ps.size();
	sort(ps.begin(),ps.end());

	vector<Point> ch_u(n);
	int n_u=0;
	for(int i=n-1;i>=0;i--){
		ch_u[n_u++]=ps[i];
		while(n_u>=3 && ccw(ch_u[n_u-3],ch_u[n_u-2],ch_u[n_u-1])!=CCW){
			ch_u[n_u-2]=ch_u[n_u-1];
			n_u--;
		}
	}

	vector<Point> ch_l(n);
	int n_l=0;
	for(int i=0;i<n;i++){
		ch_l[n_l++]=ps[i];
		while(n_l>=3 && ccw(ch_l[n_l-3],ch_l[n_l-2],ch_l[n_l-1])!=CCW){
			ch_l[n_l-2]=ch_l[n_l-1];
			n_l--;
		}
	}

	Polygon ch;
	rep(i,n_u-1) ch.pb(ch_u[i]);
	rep(i,n_l-1) ch.pb(ch_l[i]);
	return ch;
}

inline void calc_abc(const Line &l,double &a,double &b,double &c){
	a=imag(l[0])-imag(l[1]);
	b=real(l[1])-real(l[0]);
	c=cross(l[0],l[1]);
}

bool cover(const Polygon &g,const Point &p){
	int n=g.size();
	bool in=false;
	rep(i,n){
		Point v1=g[i]-p,v2=g[(i+1)%n]-p;
		if(imag(v1)>imag(v2)) swap(v1,v2);
		if(imag(v1)<EPS && EPS<imag(v2) && cross(v1,v2)>EPS) in=!in;
		if(abs(cross(v1,v2))<EPS && dot(v1,v2)<EPS) return true;
	}
	return in;
}

bool cover(const Polygon &g1,const Polygon &g2){
	rep(i,g2.size()) if(!cover(g1,g2[i])) return false;
	return true;
}

bool intersect(const Segment &s,const Segment &t){
	if(abs(cross(s[1]-s[0],t[1]-t[0]))<EPS && abs(cross(s[1]-s[0],t[0]-s[0]))<EPS){
		return cover(s,t[0]) || cover(s,t[1]) || cover(t,s[0]) || cover(t,s[1]);
	}

	return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1])<=0
		&& ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1])<=0;
}

bool intersect(const Polygon &g1,const Polygon &g2){
	int n1=g1.size(),n2=g2.size();
	rep(i,n1) rep(j,n2) {
		if(intersect(Segment(g1[i],g1[(i+1)%n1]),Segment(g2[j],g2[(j+1)%n2]))) return true;
	}
	return cover(g1,g2) || cover(g2,g1);
}

int main(){
	for(int nb,nw;scanf("%d%d",&nb,&nw),nb;){
		vector<Point> b(nb),w(nw);
		rep(i,nb){ int x,y; scanf("%d%d",&x,&y); b[i]=Point(x,y); }
		rep(i,nw){ int x,y; scanf("%d%d",&x,&y); w[i]=Point(x,y); }

		Polygon ch_b,ch_w;
		ch_b=(nb>1)?ConvexHull(b):b;
		ch_w=(nw>1)?ConvexHull(w):w;
		puts(intersect(ch_b,ch_w)?"NO":"YES");
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define pb push_back
#define REP(i, n) for (signed long long i = 0; i < (n); i++)
#define MOD long(1e9 + 7)
#define INF 98765431219876543
#define bitcnt(a) (ll) __builtin_popcount((a))
#define lb(a, b) lower_bound((a).begin(), (a).end(), (b))
#define ub(a, b) upper_bound((a).begin(), (a).end(), (b))
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
 
ll gcd(ll a, ll b) {
  if (a == 0 || b == 0) {
    return 0;
  }
  while (a % b) {
    a = a % b;
    swap(a, b);
  }
  return b;
}
 
int main() {
  ll a, b;
  cin >> a >> b;
  string s, t;
  cin >> s >> t;
  for (ll i = 0; i < gcd(a, b); i++) {
    if (s[i * a / gcd(a, b)] != t[i * b / gcd(a, b)]) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << a * b / gcd(a, b) << endl;
}

Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

	private static Scanner sc;

	public static void main(String[] args) {
		Main instance = new Main();
		sc = instance.new Scanner();
		instance.solve();
	}

	private void solve() {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();

			if (b < a) {
				System.out.println(a-1);
			} else {
				System.out.println(a);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private class Scanner {
		String[] s;
		int i;
		BufferedReader br;
		String regex = " ";

		public Scanner() {
			s = new String[0];
			i = 0;
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		@Override
		protected void finalize() throws Throwable {
			try {
				super.finalize();
			} finally {
				destruction();
			}
		}

		private void destruction() throws IOException {
			if (br != null)
				br.close();
		}

		public String next() throws IOException {
			if (i < s.length)
				return s[i++];
			String st = br.readLine();
			while (st == "")
				st = br.readLine();
			s = st.split(regex, 0);
			i = 0;
			return s[i++];
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public Long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public Double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}
	}
}

Measured memory_bytes: 20692
import numpy as np

s=int(input())

rt_s=np.ceil(np.sqrt(s))

a=int(rt_s)
if a*a<s:
    a+=1
if a*(rt_s-1)>=s:
    d=int(a-1)
else:
    d=int(a)

b=1
c=int(a*d-s)

if c<10**9:
    print(0, 0, a, b, c, d)

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

int main() {
  vector<char> yohou(3);
  vector<char> jissai(3);
  
  for(int i = 0;i < 3 ;i++) {
    cin >> yohou.at(i);
  }
  for(int i = 0;i < 3 ;i++) {
    cin >> jissai.at(i);
  }
  
  int x = 0;
  
  for(int i = 0;i < 3 ;i++) {
    if(yohou.at(i) == jissai.at(i)) x++;
  }
  
  cout << x << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int N=100001;
typedef long long ll;
typedef pair<int,int> PLL;
int n;
int a[N];
int main(){
	
	int a,b;
	cin>>a>>b;
	if(a<b)cout<<"0"<<endl;
	else cout<<"10"<<endl;
	//system("pause");
	return 0;
}

Measured memory_bytes: 504
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	c := readS()
	fmt.Println(string(c[0] + 1))
}

/*-----------Input utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const buf = 200100
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, buf), buf)
}

func debug() {
	testFile, err := os.Open("./test/sample-1.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readR() []rune {
	return []rune(readS())
}

func readI() int {
	i, _ := strconv.Atoi(readS())
	return i
}

func readF() float64 {
	f, _ := strconv.ParseFloat(readS(), 64)
	return f
}


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

typedef long long ll;

void print(const std::vector<int> &v)
{
    std::for_each(v.begin(), v.end(), [](int x) {
        std::cout << x << " ";
    });
    std::cout << std::endl;
}

int main()
{
    int N;
    cin >> N;
    vector<pair<int, int>> P;
    for (int i = 0; i < N; ++i)
    {
        int a, b;
        cin >> a >> b;
        pair<int, int> temp = make_pair(a, b);
        P.push_back(temp);
    }
    vector<int> v;
    for (int i = 0; i < N; ++i)
    {
        v.push_back(i);
    }
    double ans = 0;
    int k = 0;
    do
    {
        for (int i = 0; i < N - 1; ++i)
        {
            double x = pow(P[v[i]].first - P[v[i + 1]].first, 2);
            double y = pow(P[v[i]].second - P[v[i + 1]].second, 2);
            ans += sqrt(x + y);
        }
        ++k;
    } while (std::next_permutation(v.begin(), v.end()));
    cout << std::setprecision(10) << (double)(ans / (double)k) << endl;
}


Measured memory_bytes: 3864
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
#include <numeric>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
//#define MOD 998244353
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pint> vpint;
typedef vector<tint> vtint;
typedef vector<vint> vvint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=550;
//↑templete
signed main(){

	int N;
	cin>>N;
	cout<<(N+1)/2<<endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int W,H,x,y,z;
    scanf("%d%d%d%d%d",&W,&H,&x,&y,&z);
    if (0>(x-z) || W<(x+z)){
    printf("No\n");
    }else if(0>(y-z) || H<(y+z) ){
    printf("No\n");
    }else{
    printf("Yes\n");
    }
return 0;
}

Measured memory_bytes: 2616
main :: IO ()
main = do
    line <- getLine
    let n = read (head (splitOn ' ' line)) :: Int
    let y = read (last (splitOn ' ' line)) :: Int
    putStrLn $ showRes $ calc n y

calc :: Int -> Int -> (Int, Int, Int)
calc n y = if length res == 0 then (-1, -1, -1) else snd $ head res
    where
        res = filter (\x -> y == fst x) $ map calcSum [(a, b, n - a - b) | a <- [0..n], b <- [0..(n - a)]]
        calcSum (a, b, c) = (a * 10000 + b * 5000 + c * 1000, (a, b, c))

showRes :: (Int, Int, Int) -> String
showRes (a, b, c) = show a ++ " " ++ show b ++ " " ++ show c

splitOn :: Char -> String -> [String]
splitOn c s
    = current "" [] c $ reverse s
    where
        current :: String -> [String] -> Char -> String -> [String]
        current cur lis c [] = cur:lis
        current cur lis c (x:ss)
            = if c == x then
                  current "" (cur:lis) c ss
              else
                  current (x:cur) lis c ss


Measured memory_bytes: 764
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
const ll mod=1e9+7;
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;
  }
};
int main(void){
    int n;ll k;cin>>n>>k;
    vector<ll> a(n);
    rep(i,n) cin>>a[i];
    vector<mint> b(2010,0),c(2010,0);
    rep(i,n){
        for(int j=i+1;j<n;j++){
            if(a[i]>a[j])b[i]+=1;//見る数内での転倒数
        }
        for(int j=0;j<i;j++){
            if(a[i]>a[j])c[i]+=1;
        }
    }
    mint res=0;
    rep(i,n){
        mint buf=(b[i]*k+(b[i]+c[i])*k*(k-1)/2);
        res+=buf;
    }
    cout<<res.x<<endl;
}


Measured memory_bytes: 3640
#include<stdio.h>
#define WHITE 0
#define BLACK 1
#define GRAY 2


int n,time;
int G[101][101];
int d[101];
int f[101];
int color[101];

void visit(int u){
  int i,j;
  color[u] = GRAY;
  d[u] = ++time;
  for(i=1;i<=n;i++){
    if(G[u][i] == 1){
      if(color[i] == WHITE)
	visit(i);
    }
  }
  color[u] = BLACK;
  f[u] = ++time;
};
    



void dfs(){
  int i;
  for(i=1;i<=n;i++){
    color[i] = WHITE;
  }
  time = 0;
  for(i=1;i<=n;i++){
    if( color[i] == WHITE)
      visit(i);
  }
};


int main(){
  int u,i,j,c,k;


  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d %d",&u,&c);
    for(j=1;j<=c;j++){
      scanf("%d",&k);
      G[u][k] = 1;
    }
  }
  dfs();
 for(i=1;i<=n;i++)
   printf("%d %d %d\n",i,d[i],f[i]);


  return 0;
  
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define pss printf
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#define endl '\n'
#define debug(n1) cout<<n1<<endl
const int N = 1e5;  // limit for array size
ll n;  // array size

/*template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
*/
int main(){
    int n;cin>>n;
    int a[n],b[n],c[n];
    int sum=0;
    
    for(int i=0;i<n;i++){
    	cin>>a[i];
	}
	for(int i=0;i<n;i++){
    	cin>>b[i];
    	sum+=b[i];
	}
	for(int i=0;i<n-1;i++){
    	cin>>c[i];
	}
	
	for(int i=0;i<n-1;i++){
		if(a[i+1]==a[i]+1){
			sum+=c[a[i]-1];
		}
	}
	
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define deb(x) cout<<#x<<" : "<<x<<"\n";
#define debug(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\n";
#define deb_arr(a,n) {cout<<#a<<":";for(int i=0;i<n;i++) {cout<<a[i]<<" ";} cout<<'\n';}
#define deb_mat(dist,n,m) {cout<<#dist<<"\n";for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<dist[i][j]<<" ";}cout<<'\n';}}
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define all(a) (a).begin(),(a).end()
#define bs binary_search
#define sz size()
#define vi vector<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define clr fflush(stdout);
//#define clr cout.flush();
#define N 200001
#define fpr(i,a,b) for(int i=a;i<b;i++)
#define fdr(i,a,b) for(int i=a;i>b;i--)
#define repp(i,a,b,d) for(int i=a;i<b;i+=d)
#define repd(i,a,b,d) for(int i=a;i>b;i-=d)
#define LLMIN LLONG_MIN
#define LLMAX LLONG_MAX
#define AKASH_PATEL ios_base::sync_with_stdio(false);
#define SVNIT_SURAT cin.tie(NULL);cout.tie(NULL);
#define mset(x,a) memset(x,a,sizeof(x));
#define nl cout<<'\n';
#define print(c) cout<<c<<'\n';
#define setp(n) cout << fixed << setprecision(n)
#define take_arr(a,n) fpr(i,0,n) cin>>a[i];
#define print_arr(a,n) for(int i=0;i<n;i++) {cout<<a[i]<<" ";} cout<<'\n';
#define take_mat(mat,n,m) fpr(i,0,n) fpr(j,0,m) cin>>mat[i][j];
#define set_mat(mat,n,m,k) fpr(i,0,n) fpr(j,0,m) mat[i][j]=k;
#define print_mat(dist,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<dist[i][j]<<" ";}cout<<'\n';}
template< class T > bool inside(T a, T b, T c) { return a<=b && b<=c; }
template< class T > bool odd(T a) { return a&1; }
template< class T > bool even(T a) { return !(a&1); }
int main()
{
//#ifndef ONLINE_JUDGE
//    freopen("../ip.txt", "r", stdin);
//    freopen("../op.txt", "w", stdout);
//#endif
    AKASH_PATEL;
    SVNIT_SURAT;
    int t=1;
    //cin>>t;
    while(t--)
    {
        double r;
        cin>>r;
        setp(6)<<2*M_PI*r<<'\n';
    }
    return 0;
}





Measured memory_bytes: 3804
#include <iostream>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>

using namespace std;
typedef long long int ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD = 1000000007;
#define INF (1e9)
#define print(x) cout << x << endl;

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;


int main()
{
    ll N, A;
    cin >> N >> A;
    if (N % 500 <= A){
        print("Yes");
    } else print("No");
    return 0;
}


Measured memory_bytes: 256
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():
    S = readline().strip()
    N = len(S)

    a, b = -1, -1
    for i in range(N):
        if i < N - 1 and S[i] == S[i + 1]:
            a, b = i + 1, i + 2
            break
        elif i < N - 2 and S[i] == S[i + 2]:
            a, b = i + 1, i + 3
            break

    print(a, b)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9204
N,M = map(int,input().split())
k = []
s = []
for i in range(M):
    ks = list(map(int,input().split()))
    k.append(ks[0])
    s.append(ks[1:])
p = list(map(int,input().split()))

ans = 0
for i in range(2**N):
    bin_i = str(bin(i))[2:].zfill(N)
    flag = True
    for m in range(M):
        mm = 0
        for n in range(len(s[m])):
            if bin_i[s[m][n]-1] == '1':
                mm += 1
        if mm % 2 == p[m]:
            pass
        else:
            flag = False
            break
    if flag:
        ans += 1
        
print(ans)
    

Measured memory_bytes: 3064
//By Koios1143
#include<bits/stdc++.h>
#define LL long long
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define pii pair<int,int>
using namespace std;
const int Mod=1e9+7;
int h,w;
char arr[1005][1005];
long long dp[1005][1005];
int main(){
	IOS
	while(cin>>h>>w){
		for(int i=0 ; i<h ; i++){
			for(int j=0 ; j<w ; j++){
				cin>>arr[i][j];
			}
		}
		dp[1][1]=1;
		for(int i=1 ; i<=h ; i++){
			for(int j=1 ; j<=w ; j++){
				if(arr[i-1][j-1]=='#')
					continue;
				dp[i][j] += (dp[i][j-1] + dp[i-1][j])%Mod;
			}
		}
		cout<<dp[h][w]%Mod<<"\n";
	}	
	return 0;
}


Measured memory_bytes: 12312
#include <bits/stdc++.h>
using namespace std;
char in[2100][2100];
int T[2100][2100];
int D[2100][2100];
int L[2100][2100];
int R[2100][2100];
int a,b;
int main()
{
	cin>>a>>b;
	for(int i=0;i<a;i++)
		cin>>in[i];
	for(int i=0;i<a;i++)
	{
		int cur=0;
		for(int j=0;j<b;j++)
		{
			if(in[i][j]=='#')
				cur=0;
			else
				cur++;
			L[i][j]=cur;
		}
		cur=0;
		for(int j=b-1;j>=0;j--)
		{
			if(in[i][j]=='#')
				cur=0;
			else
				cur++;
			R[i][j]=cur;
		}
	}
	for(int i=0;i<b;i++)
	{
		int cur=0;
		for(int j=0;j<a;j++)
		{
			if(in[j][i]=='#')
				cur=0;
			else
				cur++;
			T[j][i]=cur;
		}
		cur=0;
		for(int j=a-1;j>=0;j--)
		{
			if(in[j][i]=='#')
				cur=0;
			else
				cur++;
			D[j][i]=cur;
		}
	}
	int ret=0;
	for(int i=0;i<a;i++)
	{
		for(int j=0;j<b;j++)
		{
			if(in[i][j]=='.')
			{
				ret=max(ret,L[i][j]+R[i][j]+T[i][j]+D[i][j]-3);
			}
		}
	}
	cout<<ret<<"\n";
	return 0;
}


Measured memory_bytes: 73216
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
 
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
ll num[100005];
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m;cin >> n >> m;
  rep(i,m){
      ll l,r;cin >>  l >> r;
      l--;
      num[l]++;
      num[r]--;
  }
  FOR(i,1,n){
      num[i] += num[i-1];
  }
  ll ans = 0;
  rep(i,n){
      if(num[i]==m)ans++;
  }
  cout << ans << endl;

}


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

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector < int > a(n + 1), b(n + 1), c(n + 1);
    for(int i = 1; i <= n; ++i) cin >> a[i];
    for(int i = 1; i <= n; ++i) cin >> b[i];
    for(int i = 1; i < n; ++i) cin >> c[i];
    int ans = 0;
    for(int i = 1; i < n; ++i) {
        ans += b[a[i]];
        if(a[i + 1] == a[i] + 1) ans += c[a[i]];
    }
    ans += b[a[n]];
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
n = int(input())
for i in range(1,12):
    if n <= pow(26,i):
        d = i
        break
    n = n - pow(26,i)
d = d - 1 
n = n - 1
ans =''
for i in range(d):
    tmp = divmod(n,pow(26,d-i))
    ans = ans+ chr(97+tmp[0])
    n = tmp[1]
print(ans + chr(97+n))

Measured memory_bytes: 9200
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,a;
    cin>>n;
    map<ll,ll>m;
    for(ll i=0;i<n-1;i++)
    {
       cin>>a;
       m[a]++;
    }
    ll s=0;
    for(ll i=1;i<=n;i++)
    {
        if(m.find(i)==m.end())
        cout<<0<<'\n';
        else
        cout<<m[i]<<'\n';
    }
}

Measured memory_bytes: 16096
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  cout << fixed << setprecision(10);
  int n; cin >> n;
  vi h(n);
  for(int i=0;i<n;++i) {
    cin >> h[i];
  }
  int ma = 0;
  int cnt = 1;
  for(int i=n-2;i>=0;--i) {
    if(h[i] >= h[i+1]) {
      cnt++;
    } else {
      ma = max(ma, cnt);
      cnt = 1;
    }
  }
  ma = max(ma, cnt);
  cout << ma - 1 << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define REP(i,x) for(int i=0,i##_len=(x);i<i##_len;++i)
#define rep(i,a,b) for(int i=(a),i##_len(b);i<i##_len;++i)
#define All(x) begin(x),end(x)
#define rAll(x) rbegin(x),rend(x)
using namespace std;
using ll = long long;

int main(){
    string s;cin>>s;
    if(s.find('7')!=string::npos) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 3596
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
int main() {
    int n; cin >> n;
    int a[n];
    rep(i, n) cin >> a[i];
    sort(a, a + n, greater<int>());
    int sum1 = 0, sum2 = 0;
    rep(i, n) {
        if (i % 2 == 0) sum1 += a[i];
        else sum2 += a[i];
    }
    cout << abs(sum1 - sum2) << endl;
    
}



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

using namespace std;

int main() {

	int n;
	cin >> n;
	bool hh = false;
	for (int i = 0; i < 100; i++) {
		for (int j = 0; j < 100; j++) {
			if (i * 4 + j * 7 == n) {
				hh = true;
			}
		}
	}

	if (hh) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

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;
int main(){
    int n,m;
    cin>>n>>m;
    vector<int>a(n);
    rep(i,m){
        int k;
        cin>>k;
        rep(j,k){
            int s;
            cin>>s;
            s--;
            a[s]|=1<<i;
        }
    }
    int p=0;
    rep(i,m){
        int x;
        cin>>x;
        p|=x<<i;
    }
    int ans=0;
    for(int s=0; s<(1<<n); ++s){
        int t=0;
        rep(i,n){
            if(s>>i&1){
                t^=a[i];
            }
        }
        if(t==p){
            ans++;
        }
    }
    cout<<ans<<endl;
}

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

int main() {
	int h,w,n,ma=-1;
	cin>>h>>w>>n;
	ma=max(h,w);
	if(n%ma==0){
		cout<<n/ma<<endl;
	}else{
		cout<<n/ma+1<<endl;
	}
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main(){

  char word[100];
  int length=0;
  scanf("%s",word);
  length=strlen(word);

  int sum=0;

  for(int i=1;i<=length/2;i++){
    if(word[i-1]!=word[length-i]){
      sum++;}}

  printf("%d\n",sum);

  return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define show(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using pii = pair<int,int>;
int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    rep(i,n)cin >> a[i];
    sort(a.begin(),a.end());
    int ma = a.back();
    rep(i,n-1){
        ma-=a[i];
    }
    if(ma<0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
#define mp make_pair


int main() {
  int n;
  cin >> n;
  vl a(n), b(n);
  vector<pair<ll, pll> > c;
  ll suma = 0, sumb = 0;
  rep (i, n) {
    cin >> a[i] >> b[i];
    c.push_back(mp(a[i], mp(i, 0)));
    c.push_back(mp(b[i], mp(i, 1)));
    suma += a[i];
    sumb += b[i];
  }
  ll ans = min(suma, sumb);
  sort(all(c));
  bool flag = false;
  ll sum = 0;
  vl p(n, -1);
  rep (i, n) {
    int idx = c[i].second.first;
    if (p[idx] != -1) {
      flag = true;
    }
    p[idx] = c[i].first;
    sum += c[i].first;
  }
  if (flag) {
    ans = min(ans, sum);
    cout << ans << endl;
    return 0;
  }
  rep (i, n) {
    ll temp = sum - p[i];
    if (c[n].second.first != i) {
      temp += c[n].first;
    }
    else {
      temp += c[n + 1].first;
    }
    ans = min(ans ,temp);
  }
  cout << ans << endl;
}


Measured memory_bytes: 10096
N = "0b" + input()
M = "0b" + "1"*(len(N)-2)
a = int(N, 0)^int(M, 0)
if len(N) % 2 == 0:
    K = "0b"+"10"*((len(N)-2)//2) #10101010...10(偶数)
else:
    K = "0b"+"10"*((len(N)-2)//2)+"1" #1010...01(奇数)
uK = bin(int(K, 0)^int(M, 0)) #Kの逆
q = bin(int(N, 0)^int(K, 0))
w = bin(int(N, 0)^int(uK, 0))
q = q[2:]
w = w[2:]
print(min(w.count("1"), q.count("1")))

Measured memory_bytes: 3956
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	r := readInt()
	answer := 3 * math.Pow(float64(r), 2)
	fmt.Println(int(answer))
}

func read() string {
	sc.Scan()
	return sc.Text()
}

func readInt() int {
	i, e := strconv.Atoi(read())
	if e != nil {
		panic(e)
	}
	return i
}


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

int main(){
    int n;
    char s[15];
    map<string,int> flavor;
    cin >> n;
    for(int i=0;i < n; i++){
        cin >> s;
        flavor[s] = 1;
    }
    cout << flavor.size() << endl;

}

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

int main() {
	string a,b,s="";
	cin>>a>>b;
	for(int i=0;i<a.length();i++){
		s+=a.substr(i,1);
		s+=b.substr(i,1);
	}
	cout<<s<<endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n,m;
long long dp[1009][1009];
string s[1009];
int mod = 1000000007;
long long bt(int x,int y){
	if(s[x][y] == '#')return 0;
	if(x > n || y > m)return 0;
	if(x == n-1 && y == m-1)return 1;
	long long &ret = dp[x][y];
	if(ret != -1)return ret;
	ret = (bt(x+1,y)+bt(x,y+1))%mod;
	return ret;
}
int main(){
	memset(dp,-1,sizeof(dp));
	cin>>n>>m;
	for(int i=0;i<n;i++)cin>>s[i];
	cout<<bt(0,0)<<endl;
}


Measured memory_bytes: 9344
# include <bits/stdc++.h>
# define ll long long
using namespace std;
const ll N = 2005, mod = 1e9 + 7;
int dp[N][N];
char a[N][N];
int main(){
    int n, m;
    cin >> n >> m;
    dp[1][1] = 1;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            cin >> a[i][j];
            if(a[i][j] != '#'&& (i != 1 || j != 1)){
                dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
            }
        }
    }
    if(a[1][1] == '#'){
        cout << "0\n";
    }else{
        cout << dp[n][m] << endl;
    }
}   

Measured memory_bytes: 12416
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    if(a==1) a=14;
    if(b==1) b=14;
    if(a==b) cout<<"Draw"<<endl;
    else cout<<(a<b ? "Bob" : "Alice")<<endl;
    return 0;
}


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

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

using ll = long long int;
const ll MOD = 1e9 + 7;

int main() {
  int N, K;
  std::cin >> N >> K;
  std::vector<int> p(N);
  rep(i, N) {
    std::cin >> p[i];
  }

  std::sort(p.begin(), p.end());
  int ans = 0;
  rep(i, K) {
    ans += p[i];
  }

  std::cout << ans << '\n';
}


Measured memory_bytes: 3624
N = int(input())
H = list(map(int,input().split()))

if N == 1:
    print('Yes')
else:
    for i in range(N-1):
        if H[N-1-i] + 2 <= H[N-1-i-1]:
            print('No')
            break
        elif H[N-1-i] + 1 == H[N-1-i-1]:
            H[N-1-i-1] -= 1
        elif i == N-2 and H[0] <= H[1] + 1:
            print('Yes')


Measured memory_bytes: 14224