akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

struct Pos {
  int64_t x, y;
  Pos(int a, int b) {
    x = a;
    y = b;
  }
};

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int n, limit;
  cin >> n >> limit;
  std::vector<Pos> point;
  int64_t result = 4000000000000000001LL;
  // cerr << "\033[93m" << result << "\033[m" << endl;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    point.push_back(Pos(x, y));
  }
  for (int h = 0; h < n; h++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        for (int k = 0; k < n; k++) {
          Pos point_a(point[h].x, point[i].y);
          Pos point_b(point[j].x, point[k].y);
          // printf("(%d,%d) (%d,%d)", point_a.x, point_a.y, point_b.x,
          // point_b.y);
          int64_t count = 0;
          int64_t x_min = std::min(point_a.x, point_b.x);
          int64_t x_max = std::max(point_a.x, point_b.x);
          int64_t y_min = std::min(point_a.y, point_b.y);
          int64_t y_max = std::max(point_a.y, point_b.y);
          for (auto target : point) {
            if (x_min <= target.x && target.x <= x_max && y_min <= target.y &&
                target.y <= y_max) {
              count++;
            }
          }
          // cerr << "\033[93m"
          //  << "count: " << k << " " << count << "\033[m" << endl;
          // cerr << "\033[93m" << result << "\033[m" << endl;
          if (limit <= count) {
            // cerr << "k<=count" << endl;
            int64_t area = 0;
            if (y_max == y_min) {
              area = (x_max - x_min);
            } else if (x_max == x_min) {
              area = (y_max - y_min);
            } else {
              area = (y_max - y_min) * (x_max - x_min);
            }
            result = std::min(result, area);
            // cerr << "\033[93m" << result << "\033[m" << endl;
          }
          // cerr << "\033[93m"
          //  << "result: " << result << "\033[m" << endl;
        }
      }
    }
  }

  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <map>
#include <cmath>

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
typedef long long ll;

unsigned nChoosek( unsigned n, unsigned k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;

    int result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

double distance2(int* a, int* b, int d)
{
    double sum = 0;
    rep(i, d)
    {
        sum = sum + (b[i] - a[i]) * (b[i] - a[i]);
    }
    sum = sqrt(sum);
    return sum;
}

int main()
{
    ll a;
    char ch;
    ll b;
    cin >> a >> ch >> b;
    if (ch == '+')
    {
        cout << a + b;
    }
    else
    {
        cout << a - b;
    }

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF
constexpr int INTINF {1000000000};//int = 2*INTINF

#define  rep(i,n)   for(int i = 0; i < (n); ++i)
#define rrep(i,n)   for(int i = 1; i <= (n); ++i)
#define drep(i,n)   for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t;  ++i)

template<typename T>
void maxs(T& x, T&& y) {
  x=std::max(x,y);
}
template<typename T>
void maxs(T& x, T& y) {
  x=std::max(x,y);
}

template<typename T>
void mins(T& x, T&& y) {
  x=std::min(x,y);
}
template<typename T>
void mins(T& x, T& y) {
  x=std::min(x,y);
}

int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::string S;
  cin >> S;

  vector<std::string> answer{"AMBIGUOUS", "MMYY", "YYMM", "NA"};
  int answer_idx {};

  {
    int k = (S[0]-'0')*10 + (S[1]-'0');
    if (1<=k && k<=12) {
      answer_idx += 0; //****
    } else {
      answer_idx += 2; //YY**
    }
  }
  {
    int k = (S[2]-'0')*10 + (S[3]-'0');
    if (1<=k && k<=12) {
      answer_idx += 0; //****
    } else {
      answer_idx += 1; //**YY
    }
  }
  cout << answer[answer_idx] << '\n';
}


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

using namespace std;
#define MAX_N 999999
int n;//n以下の素数がいくつあるか出力する
int ans;//素数の数
int prime[MAX_N];//prime[i]が1ならば素数i+1は素数
int main(){
  while(scanf("%d",&n) != EOF){
    ans = 0;
    for(int i= 0;i < n;i++){
      prime[i]= 1;
    }
    prime[0] = 0;//1は素数でないので
    for(int i = 1;i <sqrt(n);i++){
      if(prime[i] == 1)
	for(int j =(i+1);(i+1)*j <=n;j++){
	  prime[(i+1)*j-1] = 0;
	}
  }
    for(int i = 0;i < n;i++){
      if(prime[i] == 1)
	ans++;
    }
      printf("%d\n",ans);
  }
  return 0;
}

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

int main()
{
  int a,b;
  cin >> a >> b;
  if (a<b)
    for (int i=1;i<=b;i++)
      cout << a;
  else
    for (int i=1;i<=a;i++)
      cout << b;
  return 0;
}

Measured memory_bytes: 256
from collections import deque
N = int(input())
connected = [[] for _ in range(N)]
ans = [0] * (N-1)
for i in range(N-1):
    a,b = (int(x) for x in input().split())
    connected[a-1].append([b,i])
    connected[b-1].append([a,i])
colors = max(len(d) for d in connected)
print(colors)
init = 1
d = deque()
parents = deque()
for edge in connected[0]:
    ans[edge[1]] = init
    init += 1
    d.append(edge)
    parents.append(1)
while d:
    temp = d.popleft()
    parent = parents.popleft()
    l = len(connected[temp[0]-1])
    if l > 1:
        used = deque(range(1,l+1))
        for edge in connected[temp[0]-1]:
            if edge[0] != parent:
                color = used.popleft()
                if color == ans[temp[1]]:
                    ans[edge[1]] = used.popleft()
                else:
                    ans[edge[1]] = color
                d.append(edge)
                parents.append(temp[0])
for i in range(N-1):
    print(ans[i])

Measured memory_bytes: 45596
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S[3];
    rep(i, 3) cin >> S[i];
    rep(i, 3) cout << (char)(S[i][0] + ('A' - 'a'));
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  int N=S.size();
  vector<char>list1((N-1)/2);
  vector<char>list2((N-1)/2);
  vector<char>list3((N-1)/2);
  vector<char>list4((N-1)/2);
  for(int i=0;i<(N-1)/2;i++){
    list1.at(i)=S.at(i);
    list3.at((N-1)/2-1-i)=S.at(i);
    list2.at(i)=S.at(N-1-i);
    list4.at((N-1)/2-1-i)=S.at(N-1-i);
  }
  if(list1==list3&&list2==list4&&list1==list4){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}
  

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
  int N, L;//, s=0;
  cin >> N >> L;
  string S[109], ans = "";
  for (int i = 0; i < N; i++) cin >> S[i];
  
  sort(S, S+N);
  
  for (int j = 0; j < N; j++) ans += S[j];
  
  cout << ans << endl;
}

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

const double eps = 1e-6;

inline int sqr(int x) { return x*x; }

int main() {
	int n, d;
	int x[11][11];
	scanf("%d%d", &n, &d);
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < d; ++j) {
			scanf("%d", &x[i][j]);
		}
	}
	int ans = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = i+1; j < n; ++j) {
			double dist = 0;
			for (int k = 0; k < d; ++k) {
				dist += sqr(x[i][k]-x[j][k]);
			}
			if (sqr((int)(sqrt(dist)+eps)) == dist) ans++;
		}
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 384
#include <stdio.h>

int main(void)
{
  int n, m, c, i, j, x, cnt = 0;
  scanf("%d %d %d", &n, &m, &c);
  int a[n][m], b[m];
  for(i = 0; i < m; ++i) { scanf("%d", &b[i]); }
  for(i = 0; i < n; ++i) {
    for(j = 0; j < m; ++j) { scanf("%d", &a[i][j]); }
  }
  
  for(i = 0; i < n; ++i ) {
    x = c;
    for(j = 0; j < m; ++j) { x += a[i][j] * b[j]; }
    if(x > 0) { ++cnt; }
  }
  printf("%d\n", cnt);
  return 0;
}

Measured memory_bytes: 128
#include<cstdio>
#include<iostream>
using namespace std;
#define Fast ios_base::sync_with_stdio(0), cin.tie(0)
#define ll long long



int main(){
	int a,b;
	cin>>a>>b;
	if(b >= a ){
		cout<<a<<endl;
	}else {
		cout<<a-1<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long 
#define mod 1000000007
int main(){
  ll int n;
  cin>>n;
  stack<char> ans;
  while(n!=0){
  	n--;
  	char c = (char)(n%26+'a');
  	ans.push(c);
  	n/=26;
  }

  while(!ans.empty()){
  	cout<<ans.top();
  	ans.pop();
  }

  return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std; 
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = 1<<29;
typedef long long int ll;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
template<class T> void chmax(T & a, const T & b) { a = max(a, b); }
template<class T> void chmin(T & a, const T & b) { a = min(a, b); }
////////////////////////////////////////////////////////////////////

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);  
  cout.tie(NULL);
  ll x,y,a,b,c;
  cin>>x>>y>>a>>b>>c;
  vector<int> red,green,cols;
  REP(i,a)
  {
    int x;
    cin>>x;
    red.push_back(x);
  }
  REP(i,b)
  {
    int x;
    cin>>x;
    green.push_back(x);
  }
  REP(i,c)
  {
    int x;
    cin>>x;
    cols.push_back(x);
  }
  sort(red.begin(),red.end(),greater<int>());
  sort(green.begin(),green.end(),greater<int>());
  REP(i,x)
  {
    cols.push_back(red[i]);
  }
  REP(i,y)
  {
    cols.push_back(green[i]);
  }
  sort(cols.begin(),cols.end(),greater<int>());
  ll ans=0;
  REP(i,x+y)
  {
    ans+=cols[i];
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3188
import java.io.DataInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;


public class Main {

	class Container {
		String cityName;
		int score;
		int i;

		Container(String cityName, int score, int i) {
			this.cityName = cityName;
			this.score = score;
			this.i = i;
		}
	}

	// invoked from main
	private void solve() throws Exception {
		int N = in.i();
		ArrayList<Container> list = new ArrayList<>(N);
		for (int i = 1; i <= N; i++) {
			Container tmp = new Container(in.s(), in.i(), i);
			list.add(tmp);
		}
		list.stream()
				.sorted((x, y) -> y.score - x.score)
				.sorted((x, y) -> x.cityName.compareTo(y.cityName))
				.map(x -> x.i).forEach(System.out::println);
	}


	public static void main(String[] args) throws Exception {
		instance.solve();
	}

	static PrintStream out = System.out;
	static FastReader in = new FastReader();
	static Main instance = new Main();
}

class FastReader {
	final private int BUF_SIZE = 1 << 16;
	private DataInputStream din = new DataInputStream(System.in);
	private byte[] buffer = new byte[BUF_SIZE];
	private int bufferPointer, bytesRead;

	String s() throws IOException {
		return s(64);
	}

	String s(int capacity) throws IOException {
		byte[] buf = new byte[capacity];
		int cnt = 0, c;
		while ((c = c()) != -1) {
			if (Character.isSpaceChar(c)) break;
			buf[cnt++] = (byte) c;
		}
		return new String(buf, 0, cnt);
	}

	int i() throws IOException {
		int ret = 0;
		byte c = c();
		while (c <= ' ') c = c();
		boolean neg = (c == '-');
		if (neg) c = c();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = c()) >= '0' && c <= '9');
		return neg ? -ret : ret;
	}

	long l() throws IOException {
		long ret = 0;
		byte c = c();
		while (c <= ' ') c = c();
		boolean neg = (c == '-');
		if (neg) c = c();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = c()) >= '0' && c <= '9');
		return neg ? -ret : ret;
	}

	double d() throws IOException {
		double ret = 0, div = 1;
		byte c = c();
		while (c <= ' ') c = c();
		boolean neg = (c == '-');
		if (neg) c = c();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = c()) >= '0' && c <= '9');
		if (c == '.')
			while ((c = c()) >= '0' && c <= '9')
				ret += (c - '0') / (div *= 10);
		return neg ? -ret : ret;
	}

	private void fillBuffer() throws IOException {
		bytesRead = din.read(buffer, bufferPointer = 0, BUF_SIZE);
		if (bytesRead == -1) buffer[0] = -1;
	}

	byte c() throws IOException {
		if (bufferPointer == bytesRead) fillBuffer();
		return buffer[bufferPointer++];
	}
}



Measured memory_bytes: 27348
#include<iostream>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	cout;
	if(a<b){
		cout<<"a < b"<<endl;
	}
	if(a>b){
		cout<<"a > b"<<endl;
	}
	if(a==b){
		cout<<"a == b"<<endl;
	}
}

Measured memory_bytes: 3100
fn getline() -> String{
    let mut __ret=String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

fn main(){
    let s=getline();
    let a:Vec<_>=s.trim().split(' ').collect();
    let n:i32=a[0].parse().unwrap();
    let k:i32=a[1].parse().unwrap();

    let ans:i32=(n-1)/(k-1);
    if (n-1)%(k-1)>0{
        println!("{}", ans+1);
    }else{
        println!("{}", ans);
    }
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, nuint_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set; 
//#define int long long
#define MOD 1000000007
#define what_is(x) cerr << #x << " is " << x << endl;
#define loop(i,a,n) for(int i=a;i<n;i++)
#define pb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, szof(x))
#define sortall(x) sort(aint(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626 
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef pair<int, int> pt;
 
signed main() {
 
	fastio();
//	#define LOCAL_DEFINE	
	#ifdef LOCAL_DEFINE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	string s;
  	cin>>s;
  	int q,bit=0;
  	cin>>q;
  	string L="",R="";
  	while(q--)
    {	
      	int T;
      	cin>>T;
      	if(T==1)
          bit=bit^1;
      	else
        {
          	int F;
          char c;
          cin>>F>>c;
          	if(bit==1)
            {
             	if(F==1)
                  R=R+c;
                else
                  L=c+L;
                  
            }else{
              if(F==1)
                	L=c+L;
                else
                  R=R+c;
                
            }
        }
     
    }
   s=L+s+R;
      //cout<<L<<" "<<R<<endl;
      if(bit)
        reverse(s.begin(),s.end());
      cout<<s;
	return 0;
}

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

using namespace std;

using ll = int_fast64_t;
constexpr ll llmax = INT_FAST64_MAX; // std::numeric_limits<int_fast64_t>::max()
constexpr ll llmin = INT_FAST64_MIN; // std::numeric_limits<int_fast64_t>::min()
using ull = uint_fast64_t;
constexpr ull ullmax = UINT_FAST64_MAX; // std::numeric_limits<uint_fast64_t>::max()

#define FOR(i, b, e) for (int i = (b); i < (e); ++i)
#define RFOR(i, b, e) for (int i = ((e) - 1); (b) <= i; --i)
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define RREP(i, N) for (int i = ((N) - 1); 0 <= i; --i)
#define scanInt(x) int x; scanf("%d", &(x)); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &(x)); getchar();
#define scanVecInt(A, N) vector<int> A(N); REP(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); REP(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanLLInt(N);
    scanLLInt(A);
    scanLLInt(B);
    scanLLInt(C);
    scanLLInt(D);
    scanLLInt(E);
    auto minA = min({A, B, C, D, E});
    cout << (5 + ((N - 1) / minA)) << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int main(){
	int oi=0;
	while(true){
		int fl;
		cin >> fl;			if(!fl) return 0;
		int re=0;
		bool l=false;		//true==upped, false=downed
		bool r=false;
		bool p=false;		//chokuzen no ryouashi sorotta noga
		REP(fi,fl){
			string fc;
			cin>>fc;
			if(fc=="lu") l=true;
			if(fc=="ld") l=false;
			if(fc=="ru") r=true;
			if(fc=="rd") r=false;
			if(l==r){
				if(p!=l){
					re++;
					p=l;
				}
			}
		}
		cout<<re<<endl;//("<<oi++<<")";
	}
}

Measured memory_bytes: 1208
#include<iostream>
void swap(int& a, int& b){
    int t = a; a = b; b = t;
}
using namespace std;
int main(){
  int x1, x2, y1, y2, x, y;
  cin >> x1 >> y1 >> x2 >> y2;
  int dx = x2 - x1, dy = y2 - y1;
  for(int i = 0; i < 2; ++i){
    //x1 = x2; y1 = y2;
    swap(dx, dy);
  	dx = -dx;
    x2 += dx;
    y2 += dy;
    cout << x2 << " " << y2 <<" ";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
//#i#include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <limits.h>
#include <string>
#include <stack>
#include <deque>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <time.h>
#include <stdio.h>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define mapa make_pair
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T>
inline bool chmax(T &a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
template<typename T>
inline bool chmin(T &a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<typename T>
std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); }
template<typename T>
void vdeb(std::vector<T> &da) {
	for (int i = 0;i < da.size();i++) {
		if (i == da.size() - 1) std::cout << da[i];
		else std::cout << da[i] << ' ';
	}
	std::cout << std::endl;
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
	for (int i = 0;i < da.size();i++) vdeb(da[i]);
	std::cout << std::endl;
}

using namespace std;

ll gcd(ll a, ll b){
	if(a<b) swap(a,b);
	while(a%b){
		ll tmp = a%b;
		a = b;
		b = tmp;
	}
	return b;
}

bool solve(){
	ll a,b,c,d;
	cin >> a >> b >> c >> d;
	ll g = gcd(b,d);
	if(a<b) return false;
	if(d<b) return false;
	a%=g;
	ll x = (c-a+g)/g*g+a;
	return x >= b;
}

int main(){
	int t;
	cin >> t;
	vector<bool> ans(t);
	rip(i,t,0) ans[i] = solve();
	rip(i,t,0) printf((ans[i])?"Yes\n":"No\n");
}

Measured memory_bytes: 256
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

class UnionFind():
    def __init__(self, n):
        self.n = n
        # parents[i]: 要素iの親要素の番号
        # 要素iが根の場合、parents[i] = -(そのグループの要素数)
        self.parents = [-1] * n
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    # 要素xが属するグループの要素数を返す
    def size(self, x):
        return -self.parents[self.find(x)]
    def same(self, x, y):
        return self.find(x) == self.find(y)
    # 要素xが属するグループに属する要素をリストで返す
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    # 全ての根の要素をリストで返す
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    # グループの数を返す
    def group_count(self):
        return len(self.roots())
    # 辞書{根の要素: [そのグループに含まれる要素のリスト], ...}を返す
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    # print()での表示用
    # all_group_members()をprintする
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())



N, M = MAP()
L = [LIST() for i in range(M)]

tree = UnionFind(N)
for x, y, z in L:
    tree.union(x-1, y-1)

print(tree.group_count())
    


Measured memory_bytes: 34344
#include <bits/stdc++.h> 
#define MAX 500 
using namespace std; 
void printString(unsigned long long int n) 
{ 
	char str[MAX]; // To store result (Excel column name) 
	int i = 0; // To store current index in str which is result 

	while (n > 0) { 
		// Find remainder 
		int rem = n % 26; 

		// If remainder is 0, then a 'Z' must be there in output 
		if (rem == 0) { 
			str[i++] = 'z'; 
			n = (n / 26) - 1; 
		} 
		else // If remainder is non-zero 
		{ 
			str[i++] = (rem - 1) + 'a'; 
			n = n / 26; 
		} 
	} 
	str[i] = '\0'; 

	// Reverse the string and print result 
	reverse(str, str + strlen(str)); 
	
  cout<<str<<endl;

	return; 
} 


int main() {
unsigned long long int n;
cin>>n;
printString( n);
    
}

Measured memory_bytes: 3644
#include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int arr[n];
    for (int i=0;i<=n-1;i++)
    {
        cin >> arr[i];
    }

    int count=0;
    int base=arr[0];
    for (int i=0;i<=n-1;i++)
    {
        if (arr[i]<=base)
        {
            base=arr[i];
            count++;
           // cout << arr[i] << " ";
        }
    }
    cout << count << endl;

    return 0;
}

Measured memory_bytes: 1024
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<string>
using namespace std;


int main(void){
        int i,j;
        int n,m;
        unsigned int a[200200],b[200200];
        unsigned int k,t;
        scanf("%d%d%d",&n,&m,&k);
        for(i=1;i<=n;i++){
                scanf("%d",&a[i]);
        }
        for(i=1;i<=m;i++){
                scanf("%d",&b[i]);
        }
        int max=0;
        t=0;
        i=1;
        while(t+b[i]<=k && i<=m){
                t+=b[i];
                i++;
        }
        i--;
        max=i;

        j=1;
        while(true){
                t+=a[j];
                while(i>=1 && t>k){
                        t-=b[i];
                        i--;
                }
                if(t>k)break;
                if(max<i+j){
                        max=i+j;
                }
                j++;
                if(j>n)break;
        } 
                
        printf("%d\n",max);               
        return 0;
}


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

using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
template<class T> void chmax(T& a, T b){ if(a<b){a=b;} }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }
template<class T> bool isIn(T a,vector<T> v){ for(T x:v){ if(a==x){return true;}} return false;}
string strReplace(string s,string target, string replacement){
    if (!target.empty()) {
      std::string::size_type pos = 0;
      while ((pos = s.find(target, pos)) != std::string::npos) {
        s.replace(pos, target.length(), replacement);
        pos += replacement.length();
      }
    }
    return s;
}
const ll MOD = 1e9+7;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair


int main(){
    ll a; cin>>a;
    cout << a+ a*a+ a*a*a << "\n";
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#define MOD 1000000007
#define INT long long int
using namespace std;
const long long INF = numeric_limits<long long>::max();
const int MAX = 2000001;

long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main()
{
    INT H,W,A,B;
    cin >> H >> W >> A >> B;
    COMinit();
    INT ans = 0;
    INT tmp ;
    for (int i=0;i<H-A;i++){
        tmp = fac[B-1 + i];
        tmp *= finv[B-1];
        tmp %= MOD;
        tmp *= finv[i];
        tmp %= MOD;

        tmp *= fac[H-i-1 + W-B-1];
        tmp %= MOD;
        tmp *= finv[H-i-1];
        tmp %= MOD;
        tmp *= finv[W-B-1];
        tmp %= MOD;

        ans += tmp;
        ans %= MOD;

    }

    cout << ans << "\n";

    return 0;
}

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

using namespace std;

int main()
{
    long long a;
    int b=0;
    cin>>a;
    cin.get();
    char c;
    c=cin.get();
    while(c!='\n' && c!='EOF'){
        if(c!='.'){
            b=b*10+c-'0';
        }
        c=cin.get();
    }
    cout<<(long long)a*b/100;
    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>

using namespace std;
using ll = long long;
using ld = long double;

namespace NyaGadget
{
	struct NyaStruct {
		ll times = 0;
		ll v = 0;
	};

	auto NyaSort = [](const NyaStruct& l, const NyaStruct& r)
	{	// 昇順は演算子を逆にする, if順の優先でソートされる
		return l.v > r.v;
	};
}

#define all(collection) (collection).begin(), (collection).end()              // begin to end
#define divc(a, b) ceil((ld) a / (ld) b);                                     // div ceiling
#define rep(i, begin, end) for (ll i = begin; i < end; i++)                   // repeat
#define repr(i, begin, end) for (ll i = begin; end < i; i--)                  // repeat reverse
#define size(collection) ((ll) (collection).size())                           // collection size
/********** for each macro **********/
#define fori(i, ...) if(ll i = -1) for(__VA_ARGS__) if(i++, true)
#define each(i, e, v) fori(i, auto& e: v)
#define forir(i, ...) if(ll i = size(v)) for(__VA_ARGS__) if(i--, true)
#define eachr(i, e, v) forir(i, auto& e: boost::adaptors::reverse(v))

using namespace NyaGadget;

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

	vector<ll> A(N);
	each(i, e, A)
		cin >> e;

	vector<NyaStruct> B(M);
	each(i, e, B)
		cin >> e.times >> e.v;
	sort(all(A));
	sort(all(B), NyaSort);

	vector<ll> change;
	[&]
	{
		each(i, e, B)
		{
			rep(j, 0, e.times)
			{
				change.push_back(e.v);
				if (size(change) == N) return;
			}
		}
	}();
	
	each(i, e, change)
		if (A[i] < e) A[i] = e;

	cout << accumulate(all(A), 0LL);
	return 0;
}


Measured memory_bytes: 3704
#include<iostream>
#include<cmath>

using namespace std;

int main() {
  long long X;
  cin >> X;
  int a = 0;
  double b = 0;
  while(true) {
    b = pow(abs(X-(long long)pow(a,5.)),0.2);
    if(pow(a,5)-pow(floor(b),5)==X || pow(a,5)+pow(floor(b),5)==X)
      break;
    a++;
  }

  if(pow(a,5)-pow(floor(b),5)==X)
    cout << a << " " << floor(b) << endl;
  else
    cout << a << " -" << floor(b) << endl;
}


Measured memory_bytes: 4068
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
using lint = long long;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, C;
	cin >> N >> C;
	vector<vector<int>> memo(3, vector<int>(C)), D(C,vector<int>(C));
	for (int i = 0; i < C; i++) {
		for (int j = 0; j < C; j++) {
			cin >> D[i][j];
		}
	}
	int intmp;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			cin >> intmp;
			memo[(i + j) % 3][intmp - 1]++;
		}
	}

	int ans = INF, anstmp = 0;
	for (int c0 = 0; c0 < C; c0++) {
		for (int c1 = 0; c1 < C; c1++) { if (c1 == c0) continue;
			for (int c2 = 0; c2 < C; c2++) { if (c2 == c0 || c2 == c1) continue;

				anstmp = 0;
				for (int i = 0; i < C; i++) {
					anstmp += D[i][c0] * memo[0][i];
					anstmp += D[i][c1] * memo[1][i];
					anstmp += D[i][c2] * memo[2][i];
				}
				ans = min(ans, anstmp);

			}
		}
	}

	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {


    static long ans=0;
    public static void main(String[] args) throws IOException {

        Scanner s= new Scanner(new BufferedInputStream(System.in));
        String str = s.nextLine();

        dfs(0,0,str);
        System.out.println(ans);
    }

    /**
     *  递归拆分的逻辑
     */
    public static void dfs(long sum, int index,String s) {
        if (index == s.length()) {
            ans += sum;
            return;
        }
        for (int i = index + 1; i <= s.length(); i++) {
            dfs(sum + Long.parseLong(s.substring(index, i)), i, s);
        }
    }
}

Measured memory_bytes: 21844
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <string>

using namespace std;

#define N 3
#define N2 9

struct Puzzle {
	int f[N2];
	int space;
	string path;

	bool operator <(const Puzzle &p) const {
		for (int i = 0; i < N2; ++i) {
			if (f[i] == p.f[i])
				continue;
			return f[i] > p.f[i];
		}
		return false;
	}
};

bool isComplete(Puzzle p) {
	for (int i = 0; i < N2; ++i) {
		if (p.f[i] != i + 1)
			return false;
	}
	return true;
}

const int dx[4] = { -1, 0, 1, 0 };
const int dy[4] = { 0, -1, 0, 1 };
const char dir[4] = { 'u', 'l', 'd', 'r' };
string bfs(Puzzle p) {
	queue<Puzzle> Q;
	p.path = "";
	Q.push(p);
	Puzzle u, v;
	map<Puzzle, bool> M;
	M[p] = true;
	while (!Q.empty()) {
		u = Q.front();
		Q.pop();
		if (isComplete(u))
			return u.path;
		int sx = u.space / N;
		int sy = u.space % N;
		for (int r = 0; r < 4; ++r) {
			int tx = sx + dx[r];
			int ty = sy + dy[r];
			if (tx < 0 || ty < 0 || tx >= N || ty >= N)
				continue;
			v = u;
			swap(v.f[u.space], v.f[tx * N + ty]);
			v.space = tx * N + ty;
			if (!M[v]) {
				M[v] = true;
				v.path += dir[r];
				Q.push(v);
			}
		}
	}

	return "unresolved";
}

int main() {

	Puzzle p;
	for (int i = 0; i < N2; ++i) {
		scanf("%d", &p.f[i]);
		if (p.f[i] == 0) {
			p.f[i] = N2;
			p.space = i;
		}
	}

	string ans = bfs(p);
	cout << ans.size() << endl;

	return 0;
}

Measured memory_bytes: 30688
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <math.h>
#include <climits>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <map> 
#include <set>
#include <string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
const ll MD = 1000000007;

/* sample input

*/

int main()
{
	int n;
	int a[101];
	int answer = 0;
	cin >> n;
	int prev = 0;
	int num = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (prev == a[i]) {
			num += 1;
			if (i == n - 1 && num>=2) {
				if (num % 2 == 0) {
					answer += num / 2;
				}
				else {
					answer += (num - 1) / 2;
				}
			}
		}
		else {
			if (num >= 2) {
				if (num % 2 == 0) {
					answer += num / 2;
				}
				else {
					answer += (num - 1) / 2;
				}
				
			}
			prev = a[i];
			num = 1;
		}
	}

	cout << answer << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define oset tree < int ,  null_type ,  less ,  rb_tree_tag ,  tree_order_statistics_node_update >
#define endl '\n'
#define int long long int
#define db long double
#define str string
#define mod 1000000007
#define ff first
#define ss second
#define PQi priority_queue<int>
#define Vi vector<int>
#define Si set<int>
#define Li list<int>
#define mk make_pair
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define pb(x) push_back(x)
#define For(i,s,n) for(int i=s;i<n;i++)
#define mat2D(T,r,c) vector<vector<int> > T(r,vector<int>(c))
#define vec2D vector<vector<int> >
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define getVal(x) {int val;cin>>val;x.pb(val);}
#define debug(x) {for(auto i :x) cout << i << " ";cout << endl;}

void solve() {
	int n;
	cin >> n;
	vector<int> a(n);
	For(i, 0, n)
	cin >> a[i];
	sort(all(a));
	unordered_map<int, int>mp;
	For(i, 0, n)
	mp[a[i] + 1]++;
	For(i, 0, n)
	mp[a[i]]++;
	For(i, 0, n)
	mp[a[i] - 1]++;
	int maxx = 0;
	for (auto x : mp)
		maxx = max(x.ss, maxx);
	cout << maxx;
}

int32_t main() {
	fastIO;
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
# endif
	solve();
	return 0;
}

Measured memory_bytes: 7780
// 方針
// xが書かれたカードの枚数をA[x]とする。
// xをmodMで分類する。x modM = kなるA[x]の和をS[k]とする。(0 <= k < M)
// modMでkとM-kが書かれたカードはペアにできるので，この方法でmin(S[k], S[M-k])個のペアがまず作れる。(0<= k <= M/2)
// ※k=0, M/2 の場合は別に考える。なお，この方法が最適かどうかは棚上げする。
// 仮にS[k]>=S[M-k]とする。合計S[k]-S[M-k]枚のx(x=k modM)のカードのうち，xが書かれたものの枚数をB[x]とする。
// B[x]が奇数であれば，xが書かれたカードは最後に1枚余る。
// そこで，B[x]のうち奇数であるようなxの個数(q[k])が最小になるように，M-k modMが書かれたカードとペアにする。
// A[x]のうち奇数であるものの個数をp[k]とすると，q[k]を以下のようにでき，かつ，これがq[k]のmin。
// (1) p[k] >= S[M-k] のとき，q[k] = p[k] - S[M-k]
// (2) p[k] < S[M-k] かつ S[M-k] - p[k] = 0 のとき，q[k] = 0
// (3) p[k] < S[M-k] かつ S[M-k] - [[k] = 1 のとき，q[k] = 1
// 上記方法により各k(1 <= k < M/2)に対し，q[k](S[k]<S[M-k]であればq[M-k])の最小値の合計に，
// k=0の場合に相当するB[0] mod2 及びB[M/2] mod2(Mが偶数のとき)を加え，
// Nから引いて2で割れば答えが得られる。

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

int main() {
  int N, M;
  cin >> N >> M;
  // cout << "N, M:"; //
  // cout << N << " " << M << endl; //
  vector<int> X(N);
  // cout << "X:"; //
  rep(i, N) cin >> X.at(i);
  // for (int Xi : X) cout << Xi << " "; //
  // cout << endl; //

  map<int, int> A;
  for (int Xi : X) {
    if (!A.count(Xi)) A[Xi] = 1;
    else A[Xi] += 1;
  }
  // cout << "A:";
  // for (pair<int, int>pA : A) cout << "(" << pA.first << ", " << pA.second << ") ";
  // cout << endl; //

  vector<int> S(M); // 0~M-1
  for (pair<int, int>pA : A) {
    S.at(pA.first % M) += pA.second;
  }
  // cout << "S:";
  /* for (int Si : S) cout << Si << " ";
  cout << endl; // */

  vector<int> p(M);
  for (pair<int, int>pA : A) {
    if (pA.second % 2 == 1) p.at(pA.first % M)++;
  }
  // cout << "p:";
  // for (int pi : p) cout << pi << " ";
  // cout << endl;
  
  int r = 0; // 残るカードの総数
  r += p.at(0) % 2;
  rep2(k, 1, (M + 1) / 2) {
    // cout << "k:" << k << endl;
    if (S.at(k) >= S.at(M - k)) {
      if (p.at(k) >= S.at(M - k)) r += p.at(k) - S.at(M - k);
      else if ((S.at(M - k) - p.at(k)) % 2 == 1)  r++;
    } else {
      if (p.at(M - k) >= S.at(k)) r += p.at(M - k) - S.at(k);
      else if ((S.at(k) - p.at(M - k)) % 2 == 1) r++;
    }
    // cout << "r:" << r << endl;
  }
  if (M % 2 == 0) {
    r += p.at(M / 2) % 2;
  }

  int ans = (N - r) / 2;
  cout << ans << endl;
}

Measured memory_bytes: 6144
import math
n,k,q = list(map(int, input().split()))
a=[]
b=[0 for i in range(n)]
for i in range(q):
    a.append(int(input()))
    b[a[i]-1]+=1

point=[k-q+b[i] for i in range(n)]

for i in range(n):
    if(point[i]>=1):
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 60064
n=int(input())
a=[0]*100000
for x in range(1,101):
  ans=0
  for y in range(1,x+1):
    for z in range(1,y+1):
      if x==y:
        if y==z:  
          ans=1
        else:
          ans=3
      else:
        if y==z:
          ans=3
        else:
          ans=6
      a[(x+y+z)**2-(x*y+y*z+z*x)-1]+=ans
for i in range(n):
  print(a[i])

Measured memory_bytes: 9940
#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t N, K;
  cin >> N >> K;
  vector<int64_t> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
  }
  int64_t ans = 0;
  sort(vec.rbegin(),vec.rend());
  for(int i=K; i<N; i++){
    ans += vec.at(i);
  }
  cout << ans << endl;
}

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

int main(){
  int n, k;
  cin >> n >> k;
  vector<int>p(n);
  for(int i = 0; i<n; i++)
    cin >> p.at(i);
  
  sort(p.begin(),p.end());
  int res = 0;
  for(int i = 0; i<k; i++)
    res += p.at(i);
  
  cout << res << endl;
}

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

const ll INF = 1e18;

int main(){
    int N; cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    vector<pair<int,int>> P(N);
    rep(i, N) P[i] = {A[i], i + 1 };
    sort(P.begin(), P.end());
    rep(i, N){
        if(i != 0) cout << " ";
        cout << P[i].second;
    }
    cout << endl;
}

Measured memory_bytes: 2048
#include"bits/stdc++.h"
using namespace std;
namespace whatever{
    int readu(){
		char ch=getchar();
		while(!isdigit(ch))
			ch=getchar();
		int value=ch-'0';
		ch=getchar();
		while(isdigit(ch)){
			value=value*10+ch-'0';
			ch=getchar();
		}
		return value;
	}

	void run(){
	//	freopen(".in","r",stdin);
	//	freopen(".out","w",stdout);
        static bool ok[1010];
        ok[0]=true;
        for(int i=0; i<=100; ++i)
            if(ok[i])
                for(int j=1; j<40; ++j)
                    ok[i+j*4]=true;
        for(int i=0; i<=100; ++i)
            if(ok[i])
                for(int j=1; j<30; ++j)
                    ok[i+j*7]=true;
        int n=readu();
        puts(ok[n]?"Yes":"No");

	}
}
int main(){
	whatever::run();
}


Measured memory_bytes: 256
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

N = int(stdin.readline())
d = {}
for _ in range(N):
	s = input()
	if(s not in d):
		d[s] = 1
	else:
		d[s] += 1
d = sorted(d.items(), key=itemgetter(1))
maxx = 0
# print(d)
for i in d:
	maxx = max(maxx,i[1])
l = []
for i in d:
	if(i[1] == maxx):
		l.append(i[0])
l = sorted(l)
for i in l:
	print(i)



Measured memory_bytes: 44252
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

#ifdef DEBUG
mt19937 mrand(300); 
#else
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count()); 
#endif

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = (int) 2e5 + 5;
int n;
long long k;
int a[maxn];

bool read() {
  if (scanf("%d%lld", &n, &k) < 2) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  return true;
}

int fst[maxn];
int nxt[maxn];
int dp[maxn];
int t[maxn];
int used[maxn];

void solve() {
  for (int i = 0; i < maxn; i++) {
    fst[i] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    nxt[i] = fst[a[i]];
    fst[a[i]] = i;
  }
  dp[n] = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (nxt[i] == n) {
      dp[i] = a[i];
    } else {
      dp[i] = dp[nxt[i] + 1];
    }
  }
  for (int i = 0; i < maxn; i++) {
    t[i] = -1;
  }
  int x = 0;
  k--;
  int curt = 0;
  while (k && t[x] == -1) {
    t[x] = curt++;
    x = (x == 0 ? dp[0] : dp[fst[x] + 1]);
    k--;
  }
  if (k) {
    int per = curt - t[x];
    k %= per;
  }
  while (k) {
    x = (x == 0 ? dp[0] : dp[fst[x] + 1]);
    k--;
  }
  for (int i = 0; i < maxn; i++) {
    used[i] = false;
  }
  vector<int> ans;
  int pos = (x == 0 ? 0 : fst[x] + 1);
  for (int i = pos; i < n; i++) {
    if (!used[a[i]]) {
      used[a[i]] = true;
      ans.push_back(a[i]);
      continue;
    }
    int del = -1;
    while (del != a[i]) {
      del = ans.back();
      ans.pop_back();
      used[del] = false;
    }
  }
  for (int i = 0; i < sz(ans); i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 7156
void main()
{
    long n = readln.chomp.to!long;
    long[] v = readln.split.to!(long[]);

    long[] odd = v.stride(2).array;
    auto og = odd.sort!"a < b".group.array;
    og.sort!((x, y) => x[1] > y[1]);

    long[] even = v[1..$].stride(2).array;
    auto eg = even.sort!"a < b".group.array;
    eg.sort!((x, y) => x[1] > y[1]);

    if (og[0][0] == eg[0][0])
    {
        if (og.length == 1 && eg.length == 1)
            writeln(n / 2);
        else if (og.length == 1)
            writeln(n / 2 - eg[1][1].to!long);
        else if (eg.length == 1)
            writeln(n / 2 - og[1][1].to!long);
        else
            min(
                n-og[0][1].to!long-eg[1][1].to!long,
                n-og[1][1].to!long-eg[0][1].to!long
            ).writeln;
    }
    else
    {
        writeln(n - og[0][1].to!long - eg[0][1].to!long);
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 5312
#include <iostream>

int main(int argc, char const* argv[])
{
	unsigned  n{};
	while (std::cin >> n) {
		unsigned sum{};
		for (int i = 0; i < 10000; i++) {
			auto a = i / 1000;
			auto b = (i - a * 1000) / 100;
			auto c = (i - a * 1000 - b * 100) / 10;
			auto d = i % 10;
			auto e = a + b + c + d;
			if (n == e) {
				sum++;
			}
		}
		std::cout << sum << std::endl;
	}
	return 0;
}

Measured memory_bytes: 3052
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

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

    cout<<180*(n-2)<<endl;

    return 0;
}




Measured memory_bytes: 256
N = int(input())

numbers = list(range(1,N+1))
int_numbers = [int(x) for x in numbers]

#print(int_numbers)
for i in range(len(int_numbers)):
    if int_numbers[i] % 15 == 0:
        int_numbers[i] = 0
    elif int_numbers[i] % 5 == 0:
        int_numbers[i] = 0
    elif int_numbers[i] % 3 == 0:
        int_numbers[i] = 0
        
print(sum(int_numbers))

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

int keta(ll n) {
  int cnt=0;
  while(n > 0) {
    n /= 10;
    cnt++;
  }
  return cnt;
}

int main() {
  ll n; cin >> n;
  ll a, b;
  int mk=11;
  
  rep(i, sqrt(n)) {
    a=i+1;
    if (n%a == 0) {
      b=n/a;
      int na=keta(a);
      int nb=keta(b);
      mk = min(max(na,nb),mk);
    }
  }
  cout << mk << endl;
}


Measured memory_bytes: 256
n = int(input())
s = input()
ans = 0
for i in range(1000):
    i = str(i).zfill(3)
    ind = 0
    a = 0
    for ij in i:
        while(ind < len(s)):
            if s[ind] == ij:
                a += 1
                ind += 1
                break
            ind += 1
    ans += a == 3
print(ans)


Measured memory_bytes: 73656
S = input()
if len(S) == 1:
  print(int(S))
  exit()
else:
  def count(n):
    a = 0
    if len(n) == 1:
      return 0
    else:
      for i in range(1, len(n)):
        a += int(n[:i]) * 2 ** (len(n) - 1 - i) + int(n[i:]) + count(n[i:])
      return a
  print(int(S) + count(S))

Measured memory_bytes: 38384
#include <iostream>
using namespace std;

int main() {

	int a,b,c;
	int cnt = 0;
	cin >> a >> b >> c;
	
	for (int i = a; i <= b; i++) {
	    
	    if (c % i == 0) {
	        cnt++;
	    } 
	}
	cout << cnt << endl;
	
	return 0;
}


Measured memory_bytes: 3104
/* 
	Author: ankrypt
*/
#include <bits/stdc++.h>

using namespace std;

string S;
int maxSize;

int main()
{
	cin >> S;
	maxSize = S.size();
	for(int i = 0; i <= maxSize - 9; i++)
	{
		cout << S[i];
	}

	return 0;
}
/*
	Powered by Buggy Plugin
*/


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

int main(){

  int n, a, v, m_a, m_v;

  cin >> n;

  m_v = 0;
  for(int i=0; i<n; i++){
    cin >> a >> v;

    if(v >= m_v){
      if(v != m_v || v == m_v && a < m_a){
        m_a = a;
        m_v = v;
      }
    }
  }

  cout << m_a << " " << m_v << endl;

  return 0;

}

Measured memory_bytes: 1168
s=str(input())
slist=list(s)

cnt=len(s)-1
ans=0
for i in range(2**cnt):
    ln = [""]*cnt
    tlist=list(slist)
    for j in range(cnt):
        if ((i>>j)&1):
            ln[cnt-j-1]="+"
    for k in range(len(s)-1):
        tlist.insert(k*2+1,ln[k])
    ans+=sum(list(map(int,"".join(tlist).split("+"))))
print(ans)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;

int main() {
	int A, B;
	cin >> A >> B;

	if (A % 3 == 0)
		cout << "Possible" << endl;
	else if (B % 3 == 0)
		cout << "Possible" << endl;
	else if ((A + B) % 3 == 0)
		cout << "Possible" << endl;
	else
		cout << "Impossible" << endl;

	return 0;
}

Measured memory_bytes: 256