akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int BIG = 1000;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W, K;
	cin >> H >> W >> K;
	vector<string> s(H);
	vector < vector<int> >res(H, vector<int>(W, -1));
	vector < vector<int> >m(H, vector<int>(W, 0));
	int a;
	if (K % 2 == 1) {
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				res[i][j] = (i + j) % 2;
			}
		}
	}
	else {
		//K /= 2;
		BIG *= 2 * K;
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				res[i][j] = (((i + j) % (2 * K)) / K) * 2 + (((i - j + BIG) % (2 * K)) / K);
			}
		}
	}
	char  x[4] = { 'R','Y','G','B' };
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cout << x[res[i][j]];
		}
		cout << endl;

	}

}

Measured memory_bytes: 4480
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
#include<complex>
using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;


const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const int MAX = 1000 * 100 + 47;
const int MOD = 1000 * 1000 * 1000 + 7;

int A[MAX];
int DEG[MAX];
int D[MAX];
int FOOT[MAX];
int C[MAX];
int U[MAX];
LL dp[MAX];
queue<int> q;

//#define DEBUG
int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	FOR(i, 0, n)
	{
		cin >> A[i];
		A[i]--;
	}

	FOR(i, 0, n)
	{
		DEG[A[i]]++;
		D[A[i]]++;
	}

	FOR(i, 0, n)
	{
		if (D[i] == 0) q.push(i);
	}

	while (!q.empty())
	{
		int v = q.front();
		q.pop();
		
		int to = A[v];
		D[to]--;
		FOOT[to] = FOOT[v] + 1;
		if (D[to] == 0)
		{
			q.push(to);
		}
	}

	FOR(i, 0, n)
	{
		if (DEG[i] > 2 || (DEG[i] > 1 && D[i] == 0))
		{
			cout << 0 << endl;
			return 0;
		}
	}

#ifdef DEBUG
	cout << "D=";
	FOR(i, 0, n)
	{
		cout << D[i] << " ";
	}
	cout << endl;
#endif
	LL ans = 1;
	FOR(i, 0, n)
	{
		if (D[i] == 1 && !U[i])
		{
			bool isLoop = true;
			int v = i;
			int cnt = 0;
			while (!U[v])
			{
				U[v] = 1;
				cnt++;
				if (FOOT[v]) isLoop = false;
				v = A[v];
			}

			if (isLoop)
			{
				C[cnt]++;
				continue;
			}

			v = i;
			while (FOOT[v] == 0)
			{
				v = A[v];
			}

			LL tmp = 1;
			int l = 0;
			while (1)
			{
				l++;
				v = A[v];
				if (U[v] == 2) break;
				U[v] = 2;
				if (FOOT[v])
				{
					if (FOOT[v] < l) tmp = (tmp * 2) % MOD;
					if (FOOT[v] > l) tmp *= 0;
					l = 0;
				}
			}

			ans = (ans * tmp) % MOD;
		}
	}

#ifdef DEBUG
	cout << "loops" << endl;
	FOR(len, 1, n + 1)
	{
		cout << len << " " << C[len] << endl;
	}
#endif // DEBUG

	
	FOR(len, 1, n + 1)
	{
		if (C[len] == 0) continue;

		LL dob = (len % 2 == 0 || len == 1) ? 1 : 2;
		int cnt = C[len];
		dp[0] = 1;
		dp[1] = dob;

		FOR(i, 2, cnt + 1)
		{
			LL tmp = ((i - 1) * dp[i - 2]) % MOD;
			dp[i] = dp[i - 1] * dob + tmp * len;
			dp[i] %= MOD;
		}
#ifdef DEBUG
		cout << "len=" << len << endl;
		FOR(i, 0, cnt + 1)
		{
			cout << dp[i] << " ";
		}
		cout << endl;
#endif
		ans = (ans * dp[cnt]) % MOD;
	}

	cout << ans << endl;
}

Measured memory_bytes: 2560
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <numeric>
#include <string>
#include <bitset>
#include <functional>

using ld = long double;
using vld = std::vector<ld>;
using vvld = std::vector<vld>;
using vvvld = std::vector<vvld>;
using ll = long long;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vvvll = std::vector<vvll>;
using pll = std::pair<ll, ll>;
using vpll = std::vector<pll>;
using str = std::string;
using vstr = std::vector<str>;

template<typename T> bool chmin(T a, T &b) { return a < b ? b = a, true : false; }
template<typename T> bool chmax(T a, T &b) { return a > b ? b = a, true : false; }

constexpr ld PI = 3.141592653589793L;
constexpr ld EPS = std::numeric_limits<ld>::epsilon();

ll gcd(ll n, ll m) { return m ? gcd(m, n % m) : n; }
ll lcm(ll n, ll m) { return n / gcd(n, m) * m; }
bool is_prime(ll n) {
    if (n == 1) return false;
    for (ll i = 2; i * i <= n; i++)
        if (n % i == 0) return false;
    return true;
}

/*------------------------------------------------------------------------*/

void solve();

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15);

    solve();
}

void solve() {
    str s;
    std::cin >> s;

    s = str(s.rbegin(), s.rend());

    str t = ""; vstr v = { "maerd", "remaerd", "esare", "resare" };
    while (s != t) {
        bool flg = false;
        for (ll i = 0; i < 4; i++)
            if (t + v[i] == s.substr(0, t.length() + v[i].length())) {
                t += v[i]; flg = true; break;
            }
        if (!flg) break;
    }

    std::cout << (s == t ? "YES" : "NO") << '\n';
}


Measured memory_bytes: 4160
//shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);


int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ll n;
  cin >> n;
  dll get = (dll)((dll)(n)/(dll)(3.000));
  dll ans = get * get * get;
  cout << fixed << setprecision(8) << ans << endl;
  return 0;
} //good night.

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
    string s;
    cin >> s;
    if (s =="AAA" || s == "BBB") {
        cout << "No" << endl;
    }
    else cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  int n,m;
  cin >> n >> m;
  if(m == 1){
    cout << 0 << endl;
    return 0;
  }
  vector<int> a(m);
  for(int i = 0;i < m;i++)cin >> a[i];
  //cout << 9 << endl;
  sort(a.begin(),a.end());
  vector<int> sa;
  for(int i = 0;i < m - 1;i++){
    sa.push_back(a[i + 1] - a[i]);
  }
  //cout << 10 << endl;
  sort(sa.begin(),sa.end());
  int res = 0;
  res = a[m - 1] - a[0];
  int s = sa.size();
  //cout << 11<< endl;
  for(int i = s - 1;i >= max(0,s - n + 1);i--)res -= sa[i];
  cout << res << endl;
}




Measured memory_bytes: 1276
import math

k = int(input())

def gcd(x, y):
    if y == 0: return x
    return gcd(y, x % y)

def gcd3(x, y, z):
    return gcd(gcd(x, y), z)

sm = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for l in range(1, k+1):
            sm += gcd3(i, j, l)
print(sm)

Measured memory_bytes: 77896
// Etavioxy
#include<cstdio>
#include<cctype>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#define il inline
#define ll long long
#define rep(i,s,t) for(register int i=(s);i<=(t);i++)
#define rev_rep(i,s,t) for(register int i=(s);i>=(t);i--)
#define each(i,u) for(int i=head[u];i;i=bow[i].nxt)
#define file(s) freopen(s".in" ,"r",stdin),freopen(s".out","w",stdout)
#define pt(x) putchar(x)
using namespace std;
il int ci(){
	register char ch;int f=1;
	while(!isdigit(ch=getchar()))f=ch=='-'?-1:1;
	register int x=ch^'0';
	while(isdigit(ch=getchar()))x=(x*10)+(ch^'0');
	return f*x;
}

// 20:49

enum{N=100023};

struct Edge{ int nxt,to,len; } bow[N*10];
int head[N],tot_e;
il void add(int x,int y,int z){
//	printf("add %d -> %d %d\n",x,y,z);
	bow[++tot_e]=(Edge){head[x],y,z};
	head[x]=tot_e;
}

class node{
public:
	int num; ll dis;
	bool operator<(const node&e)const{
		return dis>e.dis;
	}
};
ll dis[N];
bool vis[N];
void dijkstra(int n){
	priority_queue<node> pq;
	rep(i,1,n-1) dis[i]=i, pq.push((node){i,i});
	dis[0]= 1e9;
	while( !pq.empty() ){
		int u= pq.top().num;
		pq.pop();
		if( vis[u] )continue;
		vis[u]= 1;
		if( u==0 ) return ;
		each(i,u){
			int v= bow[i].to;
			if( dis[v] > dis[u]+bow[i].len ){
				dis[v] = dis[u]+bow[i].len;
//				printf("dis[%d]=%lld, <--- %d\n",v,dis[v],u);
				pq.push((node){v,dis[v]});
			}
		}
	}
}

int main(){
	int k=ci();
	rep(i,1,k-1){
		rep(j,0,9) add(i,(i*10+j)%k,j);
	}
	dijkstra(k);
	printf("%lld\n",dis[0]);
	return 0;
}


Measured memory_bytes: 23404
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
using namespace std;

int main(){
	string s;
	cin>>s;
	
	int jud=-1;
	REP(i,s.size()){
		if(s[i]=='C') jud=0;
		else if(s[i]=='F'&&jud==0) jud=1;
	}
	
	if(jud==1) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main implements Runnable {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Thread(null, new Main(), "", 128 * 1024 * 1024).start();
    }

    public void run() {
        int n = sc.nextInt();
        int[] time = new int[n + 1];
        int[][] coord = new int[n][2];
        for (int i = 0; i < n; i++) {
            time[i + 1] = sc.nextInt();
            coord[i][0] = sc.nextInt();
            coord[i][1] = sc.nextInt();
        }

        int[] c = new int[]{0, 0};
        for (int i = 0; i < n; i++) {
            int t = time[i + 1] - time[i];
            int x = coord[i][0];
            int y = coord[i][1];
            int dist = Math.abs(x - c[0]) + Math.abs(y - c[1]);
            c[0] = x;
            c[1] = y;
            if (dist == t) {
                continue;
            } else if (dist > t || (t - dist) % 2 != 0) {
                System.out.println("No");
                return;
            }

        }
        System.out.println("Yes");
    }
}


Measured memory_bytes: 95460
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    map<int,int> mp;
    for(int i = 0;i < N;i++){
        int a;
        cin >> a;
        mp[a] = i;
    }
    ll sum = 0;
    set<ll> st{-1,N};
    for(auto p:mp){
        int key = p.first,index = p.second;
        ll l,r;
        auto itr = st.lower_bound(index);
        r = *itr,l = *--itr;
        sum += key * (index - l) * (r - index);
        //cout << l << ":" << r << endl;
        //cout << (index - l) <<" " << (r -  index) << endl;
        //cout << key << ":" << index << endl;
        st.insert(index);
    }
    cout << sum << endl;
}

Measured memory_bytes: 18944
#include<stdio.h>

int gcd(int, int);

int min(int, int);

int main(){
	int a,b,d;
	
	scanf("%d%d",&a,&b);

	if(a >= b){
	  
	d = gcd(b,a % b);
	  
	}
	if(a < b){
	  d = gcd(a,b % a);
	  
	}
	
	printf("%d\n",d);
	
	return 0;
}
	
int gcd(a,b){
  int n,d;

	n = min(a,b);

	for(d = n;d >= 1;d--){
	  if(a % d == 0 && b % d == 0){
	    return d;
	  }
	}
	return a;
}

int min(a,b){
  if(a < b){
    return a;
  }
  if(a > b){
    return b;
  }
  else return a;
}




Measured memory_bytes: 2084
input = gets
shurui = input.split(" ")[0].to_i
kona = input.split(" ")[1].to_i
lst = []
sum = 0
for i in 0..shurui - 1
  tmp = gets.chomp.to_i
  lst.push(tmp)
  sum = sum + tmp
end

min = lst.min
maxkazu = shurui + (kona - sum)/min
print maxkazu
print("\n")


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

int X, Y, A, B, C, numA, numB, numC;
long long ans, temp;
vector<pair<long long,int> > V;

int main () {
	cin >> X >> Y >> A >> B >> C;
	for(int i=0; i<A; i++) {
		cin >> temp;
		V.push_back(make_pair(-temp,0));
	}
	for(int i=0; i<B; i++) {
		cin >> temp;
		V.push_back(make_pair(-temp,1));
	}
	for(int i=0; i<C; i++) {
		cin >> temp;
		V.push_back(make_pair(-temp,2));
	}
	sort(V.begin(), V.end());
	for(int i=0; i<V.size(); i++) {
		if (V[i].second == 0 && numA==X) continue;
		if (V[i].second == 1 && numB==Y) continue;
		
		ans -= V[i].first;
		if (V[i].second == 0) numA++;
		if (V[i].second == 1) numB++;
		if (V[i].second == 2) numC++;
		
		if (numA+numB+numC == X+Y)
			break;
	}
	cout << ans << endl;
}


Measured memory_bytes: 10476
#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>;

int main(){
	int h,w;
	cin >> h >> w;
	vector<string> s(h);
	rep(i,h) cin >> s[i];
	int counts = 0;
	rep(i,h)rep(j,w){
		if(s[i][j] == '.'){
			s[i][j] = 0 + '0';
			for(int x = -1; x <=1; x++){
				for(int y = -1; y <= 1; y++){
					int nx = i+x;
					int ny = j+y;
					if(nx >= 0 && nx < h && ny >= 0 && ny < w && s[nx][ny] == '#')	s[i][j]++;
				}
			}
		}
	}
	rep(i,h){
		rep(j,w){
			cout << s[i][j];
		}
		cout << endl;
	}
}

Measured memory_bytes: 3628
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
ll g,l;

ll gcd(int a,int b){
	if(b==0) return a;
	return gcd(b,a%b);
}

ll lcm(int a,int b){
	return a/g*b;
}

int main(){
	ll a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF){
		g=gcd(a,b);
		l=lcm(a,b);
		printf("%lld %lld\n",g,l);
	}
	return 0;
}



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

using namespace std;

const int MAXN = 100010;

int n, m;

int v[MAXN];

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

	for(int i = 1 ; i <= m ; i++)
	{
		int U, V;
		scanf("%d %d",&U,&V);

		v[U] ^= 1;
		v[V] ^= 1;
	}

	int sum = 0;

	for(int i = 1 ; i <= n ; i++)
		sum += v[i];

	if( sum == 0 ) printf("YES\n");
	else printf("NO\n");
}

Measured memory_bytes: 640
H, W = map(int, input().split())
masu = []
for _ in range(H):
  tmp = list(input())
  masu.append(tmp)
  
directions = [(-1, 0), (1, 0), (0, -1), (0, 1)]

for i in range(H):
  for j in range(W):
    if masu[i][j] == ".":
      continue
    is_ok = False
    for dy, dx in directions:
      new_y = i + dy
      new_x = j + dx
      if new_y >= H or new_x >= W:
        continue
      if masu[new_y][new_x] == "#":
        is_ok = True
        break
    if is_ok == False:
      print('No')
      quit()
print('Yes')
      
    

Measured memory_bytes: 3064
from itertools import product
N = int(input())
ans = 0
for k in range(3,11):
    for i in product([0,3,5,7],repeat=k):
        if set(i) != {3,5,7}:
            continue
        if sum([10**j*v for j,v  in enumerate(i)]) <= N:
            ans += 1
print(ans)

Measured memory_bytes: 53980
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
//#include <intrin.h>

#define fore(i,a,b) for(int i = a; i < (b); i++)
#define fr(i,a,b) for(int i = a - 1; i >= b; i--)
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define N 300005
#define inf 2000000000
#define MOD (ll)1e15
#define __builtin_popcount(x) __popcnt(x)

using namespace std;

typedef long long ll;
typedef pair<int, int> pr;
typedef pair<pair<int, int>, int> tup;

inline void solve()
{
	int n, m;
	cin >> n >> m;
	int ac = 0, wa = 0;
	vector<int> c(n, 0);
	fore(i, 0, m)
	{
		int t;
		string d;
		cin >> t >> d;
		if (d == "AC" && c[t - 1] != -1)
		{
			ac++;
			wa += c[t - 1];
			c[t - 1] = -1;
		}
		else if (c[t - 1] != -1)
		{
			c[t - 1]++;
		}
	}
	cout << ac << ' ' << wa;
}

int main()
{
	fast;
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve();
}

Measured memory_bytes: 640
s = list(input())
ans = []
answer = ''
# print(s)
# print(type(s))
for i in range(len(s)):
    if s[i] == '0':
        ans.append(0)
    elif s[i] == '1':
        ans.append(1)
    else:
        if len(ans) == 0:
            continue
        else:
            del ans[-1]

for i in range(len(ans)):
    answer = answer + str(ans[i])
print(answer)

Measured memory_bytes: 3064
S = list(input())
N = len(S)

if N % 2 == 0:
    n = int(N // 2)
    K = n
    i = 0
    while i < n:
        if S[n - 1 - i] == S[n + i]:
            i += 1
        else:
            break

    print(K + i)
else:
    n = int((N - 1) // 2)
    if N == 1:
        print(1)

    else:
        K = n + 1
        i = 0
        if S[n] == S[n + 1]:
            while i < n:
                if S[n - i - 1] == S[n + i + 1]:
                    i += 1
                else:
                    break
        print(K + i)

Measured memory_bytes: 3956
#include<iostream>
#include<vector>
#include<algorithm>
#include<list>
#include<map>
using namespace std;
typedef unsigned long long int  ull;


int main(){
	ull c[100] ;
	for(int i=0;i<100;++i) c[i] = 0;
	string s;
	cin >> s;
	ull res = s.size()*(s.size()-1)/2 + 1;
	for(int i=0;i<s.size();++i){
		int index = s[i] -'a';
		c[index]++;
	}
	
	for(int i=0;i<100;++i){
		res -= c[i]*(c[i]-1)/2;
	}
	
	cout << res <<endl;
	
	
	return 0;
}


Measured memory_bytes: 640
import java.util.*;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] values = line.split(" ");
        long a = Long.parseLong(values[0]);
        HashMap<String,Long> item = new HashMap<>();
        long max = 0;
        for (int i = 0; i < a; i++) {
            String b = scanner.nextLine().split(" ")[0];
            if (item.containsKey(b)) {
                long v = item.get(b) + 1L;
                item.replace(b,v);
                if (max <= v) {
                    max = v;
                }
            } else {
                if (max == 0) max = 1L;
                item.put(b,1L);
            }
        }
        item = item.entrySet().stream()
                .sorted(Map.Entry.<String,Long>comparingByValue().reversed())
                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,(e1, e2)->e1, LinkedHashMap::new));
        TreeSet<String> list = new TreeSet<>();
        for (Map.Entry<String, Long> entry : item.entrySet()) {
            if (entry.getValue() >= max) {
                list.add(entry.getKey());
            } else {
                break;
            }
        }
        for (String s : list) {
            System.out.println(s);
        }
    }
}

Measured memory_bytes: 184516
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <stack> // s.top()
#include <bitset>
#include <queue> // s.front()
using namespace std;

typedef long long Int;
typedef pair<Int,Int> P;
#define print(x) cout<<(x)<<endl

#define INF10 10000000000
#define INF5 100000
#define EPS 1e-10
#define MOD 1000000007


int main() {
	int N, M;
	vector<Int> a;
	vector<Int> b;
	vector<Int> c;
	vector<Int> d;
	cin >> N >> M;

	for (int i = 0; i < N; i++) {
		int inpa, inpb;
		cin >> inpa >> inpb;
		a.push_back(inpa);
		b.push_back(inpb);
	}
	for (int i = 0; i < M; i++) {
		int inpa, inpi;
		cin >> inpa >> inpi;
		c.push_back(inpa);
		d.push_back(inpi);
	}

	for (int i = 0; i < N; i++) {
		Int score = 1e9;
		Int num = 100;
		for (int j = 0; j < M; j++) {
			Int candidate = abs(a[i] - c[j]) + abs(b[i] - d[j]);
			if (candidate < score) {
				score = candidate;
				num = j + 1;
			}
		}
		print(num);
	}





	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <cmath>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;

int dfs(ll parent,ll node,map<ll,set<ll>> &G){
    // cout << parent << "-" << node << endl;
    vector<ll> children;

    while(!G[node].empty()){
        ll p = *G[node].begin();
        G[node].erase(p);
        G[p].erase(node);
        ll count = dfs(node,p,G);
        if (count != 0){
            children.push_back(p);
        }
        if (children.size() == 2){
            cout << node << " " << children[0] << endl;
            cout << node << " " << children[1] << endl;
            children.clear();
        }
    }

    if (children.size()  == 0){
        return 1;
    }else{
        cout << node << " " << children[0] << endl;
        cout << node << " " << parent << endl;
        return 0;
    }
}
int main()
{
    // 整数の入力
    ll N,M;
    cin >> N >> M;
    map<ll,set<ll>> G;

    for (int i = 0;i<M;i++){
        ll a,b;
        cin >> a >> b;
        G[a].insert(b);
        G[b].insert(a);
    }

    // cout << "-" << endl;
    if (M % 2 != 0){
        cout << -1 << endl;
    }else{
        dfs(0,1,G);
    }
    return 0;
}

Measured memory_bytes: 38912
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

#define int long long
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpii vector<pii> 
#define vvpii vector<vpii>
#define mii map<int, int>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, a, b) for(int i = a; i < b; i++)
#define repd2(i, a, b) for(int i = b - 1; i >= a; i--)
#define repd(i, n) for(int i = n-1; i >= 0; i--)
#define F first
#define S second
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(v) v.begin(),v.end()
#define INF 1e9
#define EPS 1e-9
#define PI acosl(-1)

void solve(){
    int a, b;
    cin >> a >> b;
    cout << a * b << "\n";
}

signed main(){
    fastio;
    cout << setprecision(20) << fixed;
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
} 


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

#define rep(i, n) for(int i = 0; (int)(i) < n; i++)
 
using namespace std;
 
int main() {
  int n, x, y;
  cin >> n >> x >> y;
  vector<int> k(n);
  
 
  for(int i = 1; i < n; i++){
    for(int j = i + 1; j <= n; j++){
      int dist1 = j - i;
      int dist2 = abs(x - i) + abs(y - j) + 1;
      
      k.at(min(dist1, dist2))++;
      
    }
  }
  
 
  for(int i = 1; i <= n - 1; i++){
    cout << k.at(i) << endl;
  }
    
    
    
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 17:01:05 2020

@author: shinba
"""

a,b = map(int,input().split())

if a == 1:
    if b == 1:
        print("Draw")
    else:
        print("Alice")
elif b == 1:
    print("Bob")
else:
    if a > b:
        print("Alice")
    elif b > a:
        print("Bob")
    else:
        print("Draw")


Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;
vector<int> a;


// index が条件を満たすかどうか
bool isOK(int index, int key) {
    if (a[index] >= key) return true;
    else return false;
}

// 汎用的な二分探索のテンプレ
int binary_search(int key) {
    int ng = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
    int ok = (int)a.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

    /* ok と ng のどちらが大きいかわからないことを考慮 */
    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;

        if (isOK(mid, key)) ok = mid;
        else ng = mid;
    }
    return ok;
}


int main(){
  int N,ans=0;
  cin>>N;
  REP(i,N){
    int s;
    cin>>s;
    a.push_back(s);
  }
  SORT(a);
  
  for(int i=0; i<N-2; ++i){
    for(int j=i+1; j<N-1; ++j){
      ans+=binary_search(a.at(i)+a.at(j))-j-1;
    }
  }
  
  cout<<ans<<endl;
}


Measured memory_bytes: 3596
#include<iostream>
#include<string.h>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#define  ll long long
using namespace std;

int main()
{
int a,n,x,t,sum=0;
string name;
cin>>n>>x;
queue<pair<string,int> > q;
for(int i=1;i<=n;i++)
{
	cin>>name>>t;
	q.push(make_pair(name,t));
}
pair<string,int> u;
while(!q.empty())
{
	u=q.front();
	q.pop();
	a=min(u.second,x);
	u.second-=a;
	sum=sum+a;
	if(u.second>0)
	q.push(u);
	else
	{
		cout<<u.first<<" "<<sum<<"\n";
	}
}
return 0;
}


Measured memory_bytes: 6244
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
def main():
    N = int(input())
    A_lsit = list(map(int, input().split()))

    answer = 1
    if 0 in A_lsit:
        answer = 0

    for A in A_lsit:
        answer *= A
        if answer > pow(10, 18):
            answer = -1
            break
    print(answer)

if __name__ == "__main__":
    main()



Measured memory_bytes: 21648
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/*
    s.find_by_order(k) ---> returns iterator to the element at index(from 0) k
    s.order_of_key(val) ---> number of elements that are strictly smaller than the given value
*/
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long int> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long int>> vvl;
typedef pair<int, int> pii;
typedef pair<long long int, long long int> pll;
typedef vector<pair<int, int>> vii;
typedef vector<pair<long long int, long long int>> vll;
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test() long long int tc; cin >> tc; cin.ignore(); while(tc--) 
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define MOD 1000000007
#define SMOD 998244353
#define pq priority_queue
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sp " "
#define inp(a) ll a;cin>>a;cin.ignore()
#define inps(a,b) ll a,b;cin>>a>>b;cin.ignore()
#define out(a) cout<<SP(20)<<a<<'\n'
#define outs(a,b) cout<<SP(20)<<a<<" "<<b<<'\n'
#define ins insert
#define er erase
#define lb lower_bound
#define ub upper_bound
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define inpa(a,n) ll a[n]; for(int i=0; i<n; i++){cin>>a[i];}
#define inpv(a,n) vl a; for(int i=0; i<n; i++){inp(x);a.pb(x);}
#define outa(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}cout<<'\n';
#define outv(v) for(auto i:v){cout<<i<<" ";}cout<<'\n';
set<char> vow = {'a','e','i','o','u','A','E','I','O','U'};
ll xpow(ll n, ll m){if(m==0){return 1;}else{ll x = xpow(n, m/2);if(m&1){return x*x*n;}else{return x*x;}}}
ll xmod(ll a, ll m){return (((a%m)+m)%m);}
ll xmodpow(ll n, ll m, ll y){if(m==0){return 1;}else{ll x = xmodpow(n, m/2, y);if(m&1){return xmod((xmod((xmod(x,y)*xmod(x,y)),y)*xmod(n,y)),y);}else{return xmod((xmod(x,y)*xmod(x,y)),y);}}}

int main() {
	fast();
 
    /*NA – JEONG – MO – SA – JI – MI – DA – CHAE – TZU*/
    
    int a[2] = {0};
    char x;
    cin >> x;
    a[x-'A']++;
    cin >> x;
    a[x-'A']++;
    cin >> x;
    a[x-'A']++;
    if(a[0]&&a[1]){
        out("Yes");
    }
    else{
        out("No");
    }
}

Measured memory_bytes: 256
#include <stdio.h>

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

int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);

    printf("%d %d\n",min(a,b),max(a + b - n,0));
}

Measured memory_bytes: 128
// Try AtCoder
// author: Loenardone @ 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 a = get!(f64);
    let b = get!(f64);
    let x = get!(f64);
    if x + x < a * a * b {
        let w = 2.0 * x / (a * b);
        let c = (b / w).atan() * 180.0 / std::f64::consts::PI;
        println!("{}", c);
    } else {
        let r = a * a * b - x;
        let h = r * 2.0 / (a * a);
        let c = (h / a).atan() * 180.0 / std::f64::consts::PI;
        println!("{}", c);
    }
}

Measured memory_bytes: 4352
import sys
import bisect
import collections
import fractions
import heapq


def slove():
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    for i in range(n):
        if a[i] % 2 != 0:
            cnt += 1
    if cnt % 2 == 0:
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    slove()


Measured memory_bytes: 88940
object Main {
  def main(args: Array[String]): Unit = {
    val result = func()
    println(result)
  }

  def func() : Long = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val listA = List.fill(n)(sc.nextLong)
    val listB = List.fill(n)(sc.nextLong)
    val diff = listA.zip(listB).map(t => t._1 - t._2)
    if(diff.sum < 0){
      return -1
    }

    var ans = diff.count(_ < 0)
    val negativeSum : Long = diff.filter(_ < 0).sum
    val positiveList = diff.filter(_ > 0).sorted.reverseIterator


    var acc : Long = 0
    while(negativeSum + acc < 0){
      acc += positiveList.next
      ans += 1
    }

    ans
  }
}

Measured memory_bytes: 86588
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;


int main() {
    
    int X , A , B ;
    
    cin >>X >> A >> B;
    
    X = X - A;
    
    X = X % B;
    
        cout << X << endl;
    
    }

Measured memory_bytes: 384
#include <algorithm>
#include <climits>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <string.h>
#include <utility>
#include <vector>
using namespace std;

// デバッグ用
#define _DEBUG
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
// ここまで
#define INF 999999999
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define REPR(i, n) for(int i = n - 1; 0 <= i; i--)
#define FOR(i, s, e) for(int i = s; i <= e; i++)
#define FORR(i, s, e) for(int i = s; e <= i; i--)
#define LLI long long int
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
// int 2.14E±9    lli 9.2E±18    double 1.7E±380
vector<int> v;
int N, A, B, C;
int def(int a, int b, int c, int cur) {
    if(cur == N) {
        if(a == 0 || b == 0 || c == 0)
            return INF;
        return abs(A - a) + abs(B - b) + abs(C - c);
    }

    int temp, ret = INF;
    temp = def(a + v[cur], b, c, cur + 1) + (a == 0 ? 0 : 10);
    chmin(ret, temp);
    temp = def(a, b + v[cur], c, cur + 1) + (b == 0 ? 0 : 10);
    chmin(ret, temp);
    temp = def(a, b, c + v[cur], cur + 1) + (c == 0 ? 0 : 10);
    chmin(ret, temp);
    temp = def(a, b, c, cur + 1);
    chmin(ret, temp);
    return ret;
}

int main() {
    cin >> N >> A >> B >> C;
    v.resize(N);
    REP(i, N) { cin >> v[i]; }
    cout << def(0, 0, 0, 0);
    return 0;
}

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

int main(){
  int a,b;
  string s;
  cin>>a>>b>>s;
  bool ok=false,ok2=false;
  REP(i,s.size()){
    if (i==a)
    {
      /* code */
      i++;
    }
    
    if (s[a]=='-'&&s[i]!='-')
    {
      /* code */
      ok=true;
    }
    else
    {
      ok=false;
      break;
    }
    }
    
    if (ok)
    {
      /* code */
      cout<<"Yes"<<endl;
    }
    else
    {
      cout<<"No"<<endl;
    }
 
  }

Measured memory_bytes: 256
n=int(input())
a=[]
for i in range(n):
    a.append(-int(input()))
dp=[10**10 for i in range(n+1)]
import bisect
for i in a:
    idx=bisect.bisect_right(dp,i)
    dp[idx]=i

ans=bisect.bisect_left(dp,10**10)
print(ans)

Measured memory_bytes: 7932
from heapq import heappop, heappush
def main():
    def push(i, j, k):
        nonlocal ADD, H
        if i >= x or j >= y or k >= z: return
        if (i, j, k) not in ADD:
            heappush(H, (A[i] + B[j] + C[k], i, j, k))
            ADD.add((i, j, k))
    x, y, z, k = map(int, input().split())
    A = sorted(map(lambda x: -int(x), input().split()))
    B = sorted(map(lambda x: -int(x), input().split()))
    C = sorted(map(lambda x: -int(x), input().split()))
    H = []
    ADD = set()
    push(0, 0, 0)
    for _ in range(k):
        ans, i, j, k = heappop(H)
        push(i + 1, j, k)
        push(i, j + 1, k)
        push(i, j, k + 1)
        print(-ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 10480
fun main(args: Array<String>) {
    // var numberTests = readLine()!!.toInt()
    // var results = mutableListOf<String>()

    // for (i in 0..numberTests-1) {
    var tmpLine = readLine()
    var tmps = tmpLine!!.split("\\s+".toRegex()).map {it.toInt()}
    val n = tmps[0]
    val k = tmps[1]
    
    tmpLine = readLine()
    val values = tmpLine!!.split("\\s+".toRegex()).map {it.toInt()} 
    var valuesSorted = mutableListOf<Int>()

    for (value in values) {
        valuesSorted.add(value)
        valuesSorted.sort()
        if (valuesSorted.size > k) valuesSorted = valuesSorted.dropLast(1) as MutableList<Int>
    }

    println(valuesSorted.sum())
}

Measured memory_bytes: 41928
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define sz(a) (int)a.size()
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; }
using namespace std;

vector<vector<int>> G;

vector<bool> seen;
vector<int> v;

void topo(int now, vector<int> &v) {
	rep(i, G[now].size()) {
        if(seen[G[now][i]]) continue;
        seen[G[now][i]]=true;
		topo(G[now][i], v);
	}
	v.push_back(now);
}

int main() {
	int n, m;
	cin >> n >> m;
	G.resize(n);
	seen.resize(n);
	rep(i, m) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		G[a].pb(b);
	}
	rep(i, n) {
		if (!seen[i]) {
			seen[i] = true;
			topo(i, v);
		}
	}
	reverse(v.begin(), v.end());
	vector<int> dp(n);
	rep(i, n - 1) {
		rep(j, sz(G[v[i]])) {
			dp[G[v[i]][j]] = max(dp[G[v[i]][j]], dp[v[i]] + 1);
		}
	}
	int ans = 0;
	rep(i, n) {
		ans = max(ans, dp[i]);
	}
	cout << ans << endl;
}


Measured memory_bytes: 8696
#include <stdio.h>

int main() {
  int i, j;
  int num, ans[26] = {};
  char ch;

  while (scanf("%c", &ch) != EOF) {
    if ('A' <= ch && ch <= 'Z') {
      num = ch - 'A';
    } else if ('a' <= ch && ch <= 'z') {
      num = ch - 'a';
    } else {
      continue;
    }
    ans[num]++;
  }

  for (i = 0; i < 26; i++) {
    printf("%c : %d\n", 'a' + i, ans[i]);
  }

  return 0;
}


Measured memory_bytes: 2040
#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<math.h>
#include<queue>
#include<string.h>
typedef long long ll;
using namespace std;
int main()
{
	string s;
	cin>>s;
	ll n=s.size();
	ll i;
	char ar[300];
	for(i=0;i<n;i++)
		ar[s[i]]=1;
	if(ar['N']==1 && ar['S']==0)
	{
		cout<<"No";
		return 0;
	}
		if(ar['N']==0 && ar['S']==1)
	{
		cout<<"No";
		return 0;
	}
		if(ar['E']==1 && ar['W']==0)
	{
		cout<<"No";
		return 0;
	}
		if(ar['E']==0 && ar['W']==1)
	{
		cout<<"No";
		return 0;
	}
	cout<<"Yes";
	return 0;
		
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int ans = 0;
  for(int i = 0;i<4;i++){
    char s;
    cin >> s;
    if( s == '+'){
      ans++;
    }
    else{
      ans--;
    }
  }
  cout << ans;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
 
 
int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++) scanf("%d",a+i);
  for(int i=0;i<2;i++) scanf("%d",b+i);
  sort(a,a+4);
  sort(b,b+2);
  int ans = 0;
  for(int i=3;i>0;i--) ans+=a[i];
  ans+=b[1];
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 2696
import java.io.*;  

public class Main {
    public static void main(String[] args) throws IOException {
	int hour;                                         
	int min;                                          
	int sec;                                          
    
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String buf = br.readLine();
    String[] str = buf.split(" ",0);
    
    // w???width
    int W = Integer.parseInt(str[0]);
    //H???height
    int H = Integer.parseInt(str[1]);
    //x:??????x??§?¨?,y:??????y??§?¨?,r:????????????
    int x = Integer.parseInt(str[2]);
    int y = Integer.parseInt(str[3]);
    int r = Integer.parseInt(str[4]);
    	
    if((-100 <= x && x <= 100 ) && ( -100 < y && y <= 100 )&&
    	( 0 < W && W <= 100 ) && ( 0 < H && H <= 100 ) && ( 0 < r && r <= 100)){
    	if( 0 <= x+r && x+r <= W && 0 <= y+r && y+r <= H &&
    	    0 <= x-r && x-r <= W && 0 <= y-r && y-r <= H){
    		System.out.println("Yes");
    	}else System.out.println("No");        
    } else System.out.println("No"); 
	}
}

Measured memory_bytes: 24392
n, k = map(int,input().split())
a = list(map(int,input().split()))
d = {}
for i in a:
  if i not in d.keys():
    d[i] = 1
  else:
    d[i] += 1
d = sorted(d.values())
print(sum(d[:len(d)-k]) if len(d) > k else 0)



Measured memory_bytes: 32184
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#define REP(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long LL;

const LL MOD = 1000000007;

int main() {
  LL N, M;
  cin >> N >> M;
  vector<LL> X(N), Y(M);
  REP(i, N) { cin >> X[i]; }
  REP(i, M) { cin >> Y[i]; }
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  LL h = 0, v = 0;
  for(LL i = 1; i < N; ++i) {
    h += (X[i] - X[i-1]) * (i * (N-i) % MOD) % MOD;
    h %= MOD;
  }
  for(LL i = 1; i < M; ++i) {
    v += (Y[i] - Y[i-1]) * (i * (M-i) % MOD) % MOD;
    v %= MOD;
  }
  cout << v * h % MOD << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>

#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;
using vi = vector<int64_t>;
using vvi = vector<vi>;

int main(int argc, const char * argv[]) {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int64_t n;
    cin >> n;
    string res = "No";
    for(int i=0; i<26; i++){
        for(int j=0; j<16; j++){
            if(4*i + 7*j == n){
                res = "Yes";
                break;
            }
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 384
package main

import (
	"fmt"
	"math"
	"math/big"
)

func main() {
	solve()
}

func solve() {
	var a, b int
	fmt.Scan(&a, &b)
	if a > b {
		for i := 0; i < a; i++ {
			fmt.Print(b)
		}
	}
	if a <= b {
		for i := 0; i < b; i++ {
			fmt.Print(a)
		}
	}
}

func max(x int, y ...int) int {
	res := float64(x)
	for _, z := range y {
		res = math.Max(res, float64(z))
	}
	return int(res)
}

func min(x int, y ...int) int {
	res := float64(x)
	for _, z := range y {
		res = math.Min(res, float64(z))
	}
	return int(res)
}

func abs(x int) int {
	return int(math.Abs(float64(x)))
}

func sqrt(x int) int {
	return int(math.Sqrt(float64(x)))
}

func int2Int(x int) big.Int {
	var res big.Int
	res.SetInt64(int64(x))
	return res
}


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

enum{
	FORWARD,
	BACK,
};

class Train
{
public:
	Train( char first ) : m_conductor( 0 )
	{
		memset( m_train, 0, sizeof(m_train) );
		m_train[ FORWARD ][ 0 ] = first;
	}
	~Train(){}

	void move( int d, char mark ){
		switch( d ){
			case FORWARD:
				++m_conductor;
				break;
			case BACK:
				--m_conductor;
				break;
		}

		int direction, conductor;
		if( m_conductor < 0 ){
			direction = BACK;
			conductor = -( m_conductor + 1 );
		}else{
			direction = FORWARD;
			conductor = m_conductor;
		}
		m_train[ direction ][ conductor ] = mark;
	}

	void output()
	{
		for( int i = 25; i >= 0; --i ){
			char c;
			if( c = m_train[ FORWARD ][ i ] ){
				cout << c;
			}
		}
		for( int i = 0; i < 26; ++i ){
			char c;
			if( !( c = m_train[ BACK ][ i ] ) ){
				break;
			}
			cout << c;
		}
		cout << endl;
	}

private:
	char m_train[ 2 ][ 26 ];
	int m_conductor;
};

int main()
{
	int n;
	while( cin >> n ){
		for( int i = 0; i < n; ++i ){
			string s;
			cin >> s;

			Train train( s[ 0 ] );

			int ptr = 1, size = s.size();

			int d = FORWARD;
			while( ptr < size ){
				d = s[ ptr++ ] == '<' ? FORWARD : BACK;
				ptr++;
				char c = s[ ptr++ ];
				train.move( d, c );
			}
			train.output();
		}
	}
	return 0;
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
using namespace std;
long long n,m;
int main()
{
	
	scanf("%d%d",&n,&m);
	if(n==1 && m==1) {puts("1");return 0;}
	if(n==1 ^ m==1) {printf("%lld\n",abs(n-m)-1);return 0;}
	if(n==2 ^ m==2) {puts("0");return 0;}
	cout<<(n-2)*(m-2)<<endl;
}

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

string s, ans;

int main()
{
  cin >> s;

  if(s == "ABC") ans = "ARC";
  else ans = "ABC";
  
  cout << ans << endl;
}

Measured memory_bytes: 3612
import java.util.*;
    public class Main {
     
    	public static void main(String[] args) {
    			
    		Scanner scan =new Scanner(System.in);
    		
    		int a=Integer.parseInt(scan.next());
    		int b=Integer.parseInt(scan.next());
    		
    		if(b>=a) {
    			System.out.print(a);
    		}else {
    			System.out.print(--a);
    		}


    		
     
    }
    }
// end 

Measured memory_bytes: 21844
#include <bits/stdc++.h>
typedef long long ll;
#define  rep(i,a,b)for(long long i=a;i<b;++i)
#define  rrep(i,a,b)for(int i=a;i>=b;--i)
#define  yesno(flag)if(flag)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
const ll INF=100000000000000LL;
const ll r197=1000000007;
typedef pair<int,int>P;
typedef pair<int,P>Pa;
bool Inframe(int a,int b,int c,int d,int h,int w){
	if(a+b>=0&&a+b<h&&c+d>=0&&c+d<w)return true;
	return false;
}
//void swap(ll a,ll b){
//	ll d;
//	d=a;
//	a=b;
//	b=d;
//	return;
//}
ll mypow(ll x,int m){
	if(m==0)return 1;
	if(m%2==0){
		int x2=mypow(x,m/2);
		return x2*x2;
	}else{
		int x2=mypow(x,m/2);
		return x2*x2*x;
	}
}
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
//    	cout<<b<<endl;
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
int ans[200004]={};
ll total=0;
int a[200000],b[200000];
int n;

vector<P> v[200001];
int main() {
	cin>>n;
	rep(i,0,n-1){
		cin>>a[i]>>b[i];
		v[a[i]-1].push_back(P(b[i]-1,i));
	}
	queue<P> que;
	que.push(P(0,0));
	while(!que.empty()){
		P p=que.front();que.pop();
//		cout<<p.first<<" "<<p.second<<endl;
		int si=1;
		if(si==p.second)si++;
		rep(i,0,v[p.first].size()){
			int g=v[p.first][i].second;
			if(ans[g]==0){
				ans[g]=si;
				que.push(P(v[p.first][i].first,si));
				si++;
				if(si==p.second)si++;
			}
		}
	}
	int masi=0;
	rep(i,0,n-1)masi=max(masi,ans[i]);
	cout<<masi<<endl;
	rep(i,0,n-1){
		cout<<ans[i]<<endl;
	}
	return 0;
}


Measured memory_bytes: 8960
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int,int>;
using Graph = vector<vector<int>>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); ++i)
 
constexpr double PI = acos(-1);
int alre[1000000];
int main() {
    ll n,k;
    cin >> n >> k;
    vector<int> g(n+1,0);
    int a;
    rep(i,n) {
        cin >> a;
        g.at(i+1) = a;
    }
    vector<int> log;
    int nowPos;
    nowPos = 1;
    log.emplace_back(1);
    ll s,flag,loop;
    s = flag = loop = 0;
    rep(i,k+1) {
        int ii = i + 1;
        nowPos = g.at(nowPos);
        log.emplace_back(nowPos);
        if(flag == 0 && alre[nowPos]) {
            s = alre[nowPos];
 			loop=(k-s)%(ii-s);
            flag=true;
            break;
        }
        alre[nowPos]=ii;
    }
    if(!flag) {
        cout << log.at(k) << "\n";
    }
    else{
    	nowPos = log.at(s+loop);
    	cout << nowPos << "\n";
    }
    return 0;
}

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

long long gcd(long long a, long long b){
  if (b==0) return a;
  else return gcd(b,a%b);
}


int main() {
  // ll n,m,x,k=0,sum=0,a=0,b=0,c=0,d=0,ans=10000000,index=1,index_0=1,index_ans=1;
  ll MOD = 1000000007;
  ll INF = 1LL << 60;
  string S="",T="",U="";
  ll n,k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];

  vector<int> s;
  vector<int> ord(n+1,-1);
  int c = 1,l = 0;
  {
    int v = 1;
    while(ord[v] == -1) {
      ord[v] = s.size();
      s.push_back(v);
      v = a[v-1];
    }
    c = s.size() - ord[v];
    l = ord[v];
  }
  if(k<l) cout << s[k] << endl;
  else{
    k -= l;
    k %= c;
    cout << s[l+k] << endl;
  }
  //cout << ans << endl;
}

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

using namespace std;
using ll = long long;
using Lll = list<ll>;
using Vll = vector<ll>;

#define rep(a,x,i,f) for(ll a = i; a < f; a+=x )
#define repR(a,x,i,f) for(ll a = i; a > f; a-=x )

ll frog(Vll& s, Vll& ci, int cur)
{
  ll p1,p2;

  if(cur < 2)
  {
    return ci[cur];
  }
  ci[cur-1] != -1 && ci[cur-2] != -1 ? p1 = ci[cur-1] , p2 = ci[cur-2] :
  ci[cur-1] == -1 && ci[cur-2] == -1 ? p1 = frog(s,ci,cur-1), p2 = frog(s,ci,cur-2) :
  ci[cur-1] != -1 ? p1 = ci[cur-1] , p2 = frog(s,ci,cur-2) :
                    p1 = frog(s,ci,cur-1) , p2 = ci[cur-2];
  
  ci[cur] = min(p1 + abs(s[cur] - s[cur-1]),p2 + abs(s[cur] - s[cur-2]));

  return ci[cur];
}

int main() 
{
  ll n,m;
  cin >> n;
  Vll s(n);
  Vll ci(n,-1);

  rep(i,1,0,n)
    cin >> s[i];

  ci[0] = 0;
  ci[1] = abs(s[0] - s[1]);

  m = frog(s,ci,n-1);

  cout << m << endl;
}

Measured memory_bytes: 9600
while True:

    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        for k in range(W):
            if i == 0 or i == H-1 or k == 0 or k == W-1:
                print("#",end = "")
            else:
                print(".",end = "")
        print()

    print()


Measured memory_bytes: 7000
main = do
  li <- getLine
  let [n,a,b] = map read $ words li
  let ans = compute n a b
  print ans

compute :: Int -> Int -> Int -> Int
compute 0 _ _ = 0
compute 1 a b = if a == b then 1 else 0
compute n a b
  | a > b = 0
  | True  = ub - lb + 1
  where
    n1 = pred n
    lb = a * n1 + b
    ub = a + n1 * b


Measured memory_bytes: 508
// 2014/06/05 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int q1;
		cin >> q1;

		if(q1==0)
			break;

		int b, c1, c2, q2;
		cin >> b >> c1 >> c2 >> q2;

		if((q1-1)*c2>b-c1){
			cout << "NA" << endl;
			continue;
		}

		int Q1, Q2;

		Q1 = b/c1;
		if(Q1>q2){
			Q1 = q2;
		}

		Q2 = (b-c1*Q1)/c2;

		while(Q1+Q2<q1){
			Q1--;
			Q2 = (b-c1*Q1)/c2;
		}

		cout << Q1 << ' ' << Q2 << endl;
	}

	return 0;
}

Measured memory_bytes: 1160