akhauriyash/Code-Regression huggingface dataset:
using System;

class A {
    string[] Rs(){
		return Console.ReadLine().Split(' ');
	}
    public void run(){
        string[] HW = Rs();
        int H = int.Parse(HW[0]), W = int.Parse(HW[1]);
        int[,] A = new int[H,W];
        bool[,] check = new bool[H,W];
        for(int i=0;i<H;i++){
            string inp = Console.ReadLine();
            for(int j=0;j<W;j++){
                A[i,j] = (inp[j]=='#')?1:0;
            }
        }
        Func<int, int, bool> f = null;
        for(int i=0;i<H;i++) for(int j=0;j<W;j++) check[i,j] = false;
        f = (x, y) =>{
            check[x,y] = true;
            if(x==H-1 && y==W-1) return true;
            bool ans = false;
            if( x<H-1 && A[x+1,y]==1 && (y==W-1 || (A[x,y+1]==0))){
                ans = ans || f(x+1, y);
            }
            if( y<W-1&& A[x,y+1]==1 && (x==H-1 || (A[x+1,y] == 0))){
                ans = ans || f(x, y+1);
            }
            return ans;
        };
        bool b1 = f(0,0);
        bool b2 = true;
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                if(!check[i,j] && A[i,j] ==1) b2 = false;
            }
        }
        if(b1 && b2){
            Console.WriteLine("Possible");
        } else {
            Console.WriteLine("Impossible");
        }
        
    }
    
}

class Program {
    static void Main(string[] args){
        A a = new A();
        a.run();
    }
}

Measured memory_bytes: 2776
a,b,c = map(int,input().split())
if a%5!=0 and a%7!=0:
  print('NO')
elif b%5!=0 and b%7!=0:
  print('NO')
elif c%5!=0 and c%7!=0:
  print('NO')
elif a%7==0:
  if b%5==0 and c%5==0:
    print('YES')
  else:
    print('NO')
elif b%7==0:
  if a%5==0 and c%5==0:
    print('YES')
  else:
    print('NO')
else:
  if a%5==0 and b%5==0:
    print('YES')
  else:
    print('NO')
    

Measured memory_bytes: 9000
alphabet = [chr(ord('a') + i) for i in range(26)]
s = list(input())
s = sorted(list(set(s)))
if len(s) == 26:
    print("None")
    exit()
for i in range(len(s)):
    if i == len(s) - 1:
        if s[i] == alphabet[i]:
            print(alphabet[i+1])
        else:
            print(alphabet[i])
        exit()
    if s[i] == alphabet[i]:
        pass
    else:
        print(alphabet[i])
        exit()

Measured memory_bytes: 3956
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(register int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(register int i=st,i##end=ed;i>=i##end;--i)
typedef long long ll;
template<typename T>inline bool chkmin(T &x,T y){return (y<x)?(x=y,1):0;}
template<typename T>inline bool chkmax(T &x,T y){return (y>x)?(x=y,1):0;}
inline int read(){
	int x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1)+(x<<3)+(c^'0');
	return x*f;
}
inline ll readll(){
	ll x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1ll)+(x<<3ll)+(c^'0');
	return x*f;
}
const int maxn=2e5+10;
int n,a[maxn],id[maxn];
bool cmp(const int A,const int B){
	return a[A]<a[B];
}
int main(){
	int n=read();
	REP(i,1,n) a[i]=read(),id[i]=i;
	sort(id+1,id+n+1,cmp);
	REP(i,1,n)
		if(a[i]<=a[id[n/2]]) printf("%d\n",a[id[n/2+1]]);
		else printf("%d\n",a[id[n/2]]);
	return 0;
}


Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define MAXN 10000001
int sup[MAXN];
void sol(){
	int i,j;
	for(i=0;i<MAXN;i++) sup[i]=i;
	for(i=4;i<MAXN;i+=2) sup[i]=2;
	for(i=3;i*i<MAXN;i++){
		if(sup[i]==i){
			for(j=i*i;j<MAXN;j+=i){
				if(sup[j]==j)sup[j]=i;
			}
		}
	}
}
int nofac(int n){
    if(n==1)return 1;
    int ans = 1;
    int y = sup[n];
    int cnt = 1;
    int j = n / y;
    while (j != 1) {
        if (sup[j] == y)
            cnt ++;
        else {
            y = sup[j];
            ans = ans*(cnt + 1);
            cnt = 1;
        }
        j = j / sup[j];
    }
    ans = ans *(cnt + 1);
    return ans;
}
int32_t main(){
        int n;
  		sol();
        cin>>n;
        int ans=0;
        for(int i=1;i<=n-1;i++){
            ans+=nofac(n-i);
        }
        cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 81756
from collections import deque


def inpl():
    return list(map(int, input().split()))


N, M = inpl()
UV = [inpl() for i in range(M)]
S, T = inpl()
S -= 1
T -= 1

ans = [[-1, -1, -1] for i in range(N)]

uv = [[] for i in range(N)]
for u, v in UV:
    u -= 1
    v -= 1
    uv[u].append(v)

ans[S][0] = 0
que = deque()
que.append((S, 0))
t = 0
while que:
    v, t = que.popleft()
    nt = (t + 1) % 3
    for nv in uv[v]:
        if ans[nv][nt] != -1:
            continue
        elif nv == T and nt == 0:
            ans[nv][nt] = (ans[v][t] + 1) // 3
            break
        ans[nv][nt] = ans[v][t] + 1
        que.append((nv, nt))

print(ans[T][0])


Measured memory_bytes: 56968
#include <bits/stdc++.h>
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;

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

int main()
{
	//freopen("in.txt", "r", stdin);
	//ios::sync_with_stdio(false); cin.tie(0);

	LL q, h, s, d;
	int n;
	cin>>q>>h>>s>>d>>n;

	s = min(s, q * 4);
	s = min(s, h * 2);

	LL res1 = n * s;
	LL res2 = n / 2 * d + n % 2 * s;

	LL res = min(res1, res2);
	cout<<res<<endl;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
using Graph = vector<vector<ll>>;
#define all(x) (x).begin(), (x).end() //string の sort とかはこれ
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)

const ll MOD = 1000000007;
const ll INF = 1e18; //1*10^18
const ll MAX = 2e5;
const double PI = 3.14159265;

int ctoi(char c)
{
  if (c >= '0' && c <= '9')
  {
    return c - '0';
  }
  return 0;
}

ll gcd(ll x, ll y) { return (x % y) ? gcd(y, x % y) : y; }
//最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//最小公倍数

ll powll(ll a, ll n)
{ //O(log n)
  ll res = 1;
  while (n > 0)
  {
    if (n & 1) //(n & 1)=(n % 2 !=0)
    {
      res = res * a;
    }
    a = a * a;
    n >>= 1; //(n & 1)=(n % 2 !=0)
  }
  return res;
}

ll modpow(ll a, ll n, ll mod) //O(log n)
{
  ll res = 1;
  while (n > 0)
  {
    if (n & 1) //(n & 1)=(n % 2 !=0)
    {
      res = res * a % mod;
    }
    a = a * a % mod;
    n >>= 1; //(n>>=1)=(n/2)
  }
  return res;
}

int ReturnDigit(ll num)
{
  string number = to_string(num);
  return number.length();
}

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() //MODは素数じゃないとだよ！！
{
  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;
}

struct UnionFind
{
  vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

  UnionFind(int N) : par(N)
  { //最初は全てが根であるとして初期化
    for (int i = 0; i < N; i++)
      par[i] = i;
  }

  int root(int x)
  { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (par[x] == x)
      return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y)
  {                   // xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if (rx == ry)
      return;     //xとyの根が同じ(=同じ木にある)時はそのまま
    par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
  }

  bool same(int x, int y)
  { // 2つのデータx, yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};

// const ll MAX = 200000;

pll p[500000];
int main()
{
  // COMinit();
  // srand((unsigned int)time(NULL));//--> rand()
  ll i, j, k, l, ans = 0;
  ll n;
  cin >> n;
  vector<ll> left(n, 0), right(n, 0);
  vector<ll> a(n);
  // cout << left[0] << right[0] << endl;

  for (i = 0; i < n; i++)
  {
    cin >> a[i];
    // cout << a[i];
    if (i + a[i] < n)
    {
      left[i + a[i]]++;
    }
    if (i - a[i] > 0)
    {
      right[i - a[i]]++;
    }
  }

  for (i = 1; i < n; i++)
  {
    ans += left[i] * right[i];
  }
  cout << ans << endl;
}


Measured memory_bytes: 8012
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int x;
    cin >> x;
    cout << (x^1) << endl;
}

Measured memory_bytes: 3628
using System;

namespace _0512
{
    class Program
    {
        static void Main(string[] args)
        {
       //     string[] a = new string { "a" };
            string str = Console.ReadLine();

            for (int i = 0; i < str.Length; i++)
            {
                string a = str.Substring(i, 1);
                if (str.Substring(i, 1) == "A") { Console.Write("X"); }
                if (str.Substring(i, 1) == "B") { Console.Write("Y"); }
                if (a == "C") { Console.Write("Z"); }
                if (a == "D") { Console.Write("A"); }
                if (a == "E") { Console.Write("B"); }
                if (a == "F") { Console.Write("C"); }
                if (a == "G")
                {
                    Console.Write("D");
                }

                if (a == "H") { Console.Write("E"); }

                if (a == "I") { Console.Write("F"); }
                if (a == "J") { Console.Write("G"); }
                if (a == "K") { Console.Write("H"); }
                if (a == "L") { Console.Write("I"); }
                if (a == "M") { Console.Write("J"); }
                if (a == "N") { Console.Write("K"); }
                if (a == "O") { Console.Write("L"); }
                if (a == "P") { Console.Write("M"); }
                if (a == "Q") { Console.Write("N"); }
                if (a == "R") { Console.Write("O"); }
                if (a == "S") { Console.Write("P"); }

                if (a == "T") { Console.Write("Q");
                }

                if (a == "U") { Console.Write("R"); }

                if (a == "V") { Console.Write("S"); }

                if (a == "W") { Console.Write("T"); }

                if (a == "X") { Console.Write("U"); }

                if (a == "Y") { Console.Write("V"); }

                if (a == "Z") { Console.Write("W"); }
                if (i == str.Length - 1) { Console.WriteLine(); }

            }
            Console.ReadLine();
        }

    }
        
     //   }
    //}
}

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

typedef long long ll;
const ll INF = 1e18;
const int BIG = 1e9 + 555;
const int maxN = 1e5 + 55;

string s;
int n, m, fwt[maxN], f[maxN], memo[maxN];
int segTree[4 * maxN];

void upd(int id, int l, int r, int idx, int val){
	if(l == idx && r == idx){
		segTree[id] = val;	
		return;
	}

	if(r < idx || l > idx){
		return;
	}
	
	int mid = (l + r) / 2;
	upd(id * 2, l, mid, idx, val);
	upd(id * 2 + 1, mid + 1, r, idx, val);
	segTree[id] = min(segTree[id * 2], segTree[id * 2 + 1]);
}

int getMn(int id, int l, int r, int L, int R){
	if(L <= l && r <= R){
		return segTree[id];
	}

	if(r < L || l > R){
		return BIG;
	}

	int mid = (l + r) / 2;
	int ans = getMn(id * 2, l, mid, L, R);
	ans = min(ans, getMn(id * 2 + 1, mid + 1, r, L, R));

	return ans;
}

void upd(int idx, int val){
	for(; idx < maxN; idx += idx & -idx){
		fwt[idx] += val;
	}
}

int pre(int idx){
	int ans = 0;
	for(; idx > 0; idx -= idx & -idx){
		ans += fwt[idx];
	}

	return ans;
}

int sum(int l, int r){
	return pre(r) - pre(l - 1);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	cin >> n >> m;

	cin >> s;

	n++;
	s = ' ' + s;

	for(int i = n; i >= 1; i--){
		if(i == n){
			f[i] = 0;
			if(s[i] == '0'){
				f[i] = 1;
			}
		} else {
			f[i] = 0;
			if(s[i] == '0'){
				f[i] = (sum(i + 1, min(n, i + m)) > 0);
			}
		}

		upd(i, f[i]);
	}
	
	if(!f[1]){
		cout << "-1\n";
		return 0;
	}

	for(int i = n; i > 0; i--){
		if(i == n){
			memo[i] = 0;
		} else {
			memo[i] = BIG;
			if(f[i]){
				memo[i] = min(memo[i], 1 + getMn(1, 1, n, i + 1, min(n, i + m)));
			}
		}

		upd(1, 1, n, i, memo[i]);
	}

	//cout << memo[1] << '\n';
	
	int i = 1;
	while(true){
		if(i == n){
			break;
		}

		for(int j = 1; j <= m; j++){
			if(memo[i] == 1 + memo[i + j]){
				cout << j << ' ';
				i = i + j;
				break;
			}
		}
	}
	cout << '\n';

	return 0;
}

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

using namespace std;
using ll = long long;

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define RS(N) resize(N)
#define CINV(v, N) do {\
	v.RS(N);\
	rep(i, N) cin >> v[i];\
} while (0);
#define RCINV(v, N) do {\
	v.RS(N);\
	rrep(i, N) cin >> v[i];\
} while (0);

#define MOD 1000000007

void init();
void solve();

signed main()
{
	init();
	solve();
}

struct edge {
	int a;
	int b;
	int c;
	edge(int x, int y, int z) : a(x), b(y), c(z) {}
	edge() : a(0), b(0), c(0) {}
};

vector<edge> v;
vector<ll> cost;
int N, M;

const ll INF = 1000000000000000;

void init()
{
	cin >> N >> M;
	cost.resize(N, INF);
	rep(i, M) {
		int x, y, z;
		cin >> x >> y >> z;
		v.emplace_back(x-1, y-1, -z);
	}
	cost[0] = 0;
}

bool update()
{
	bool res = false;
	for (edge e : v) {
		int a = e.a;
		int b = e.b;
		int c = e.c;
		if (cost[a] == INF) continue;
		if (cost[b] > cost[a] + c) {
			res = true;
			cost[b] = cost[a] + c;
		}
	}
	return res;
}

void solve()
{
	int cnt = 0;
	rep(i, N-1) update();
	ll res = cost[N-1];
	rep(i, N) update();
	if (res == cost[N-1]) cout << -res << endl;
	else cout << "inf" << endl;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int A,B,C,n;
int arr[1001];
int dfs(int l,int a,int b,int c)
{
	int r1,r2,r3,r4;
	if(l==n)
	{
		if(a==0||b==0||c==0)
		{
			return 10000;
		}	
		else 
		{
			return abs(a-A)+abs(b-B)+abs(c-C);
		}
	}
	r1=dfs(l+1,a+arr[l+1],b,c)+10;
	r2=dfs(l+1,a,b,c+arr[l+1])+10;
	r3=dfs(l+1,a,b+arr[l+1],c)+10;
	r4=dfs(l+1,a,b,c);
	return min(min(r1,r2),min(r3,r4));
}
int main()
{
	int i,j,k;
	scanf("%d %d %d %d",&n,&A,&B,&C);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&arr[i]);
	}
	printf("%d",dfs(0,0,0,0)-30);
	return 0;
}

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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main()
{
    int n,k;cin >> n >> k;
    vector<int> vc(k);rep(i,k) cin >> vc[i];
    int ans = n;
    while(true)
    {
        int temp = ans;
        int flag = 0;
        while(temp!= 0)
        { 
            int target = temp%10;
            for(auto i: vc)
            {
                if(target == i)
                {
                    flag = 1;
                    break;
                }
            }
            if(flag == 1)
            {
                break;
            }
            temp /=10;
        }
        if(flag == 1)
        {
            ans++;
        }else
        {
            break;
        }
        
        
    }

    cout << ans << endl;
}

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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())

#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
#define MOD 1000000007

//cout << (c)?"Yay!":":(" << endl;

// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if (a + b == 15)
        cout << '+' << endl;
    else if (a * b == 15)
        cout << "*" << endl;
    else
        cout << "x" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) std::begin(a), std::end(a)
#define RALL(a) std::rbegin(a), std::rend(a)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

constexpr int INF = 2e9;
constexpr double EPS = 1e-10;
constexpr double PI = acos(-1.0);

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

template <typename T>
constexpr int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
constexpr int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T, typename U>
constexpr void chmax(T& m, U x) {
	m = max(m, x);
}

template <typename T, typename U>
constexpr void chmin(T& m, U x) {
	m = min(m, x);
}

template <typename T>
constexpr T square(T x) {
	return x * x;
}

int main() {
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	int result = 0;
	if(k <= a) {
		cout << k << endl;
		return 0;
	}
	result += a;
	k -= a;
	if(k <= b) {
		cout << result << endl;
		return 0;
	}
	k -= b;
	result -= k;
	cout << result << endl;
	return 0;
}


Measured memory_bytes: 3596
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 1000000007;
//const int MOD = 998244353;

long long int N, M, K, H, W, L, R;
//int N, M, K, H, W, L, R;



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

	cin >> N >> M;
	vector<vector<int>>edge(N);
	for (int i = 0; i < M; i++) {
		cin >> L >> R;
		L--;
		R--;
		edge[L].push_back(R);
		edge[R].push_back(L);
	}
	for (int i = 0; i < N; i++) {
		if (edge[i].size() & 1) {
			cout << "No\n";
			return 0;
		}
	}
	for (int i = 0; i < N; i++) {
		if (edge[i].size() == 4)K++;
		if (edge[i].size() > 4) {
			cout << "Yes\n";
			return 0;
		}
	}
	if (K > 2) {
		cout << "Yes\n";
		return 0;
	}
	if (K <= 1) {
		cout << "No\n";
		return 0;
	}
	R = 0;
	for (int i = 0; i < N; i++) {
		if (edge[i].size() == 4) {
			L = i;
			R ^= i;
		}
	}
	R ^= L;
	vector<int>used(N);
	used[L]++;
	queue<int>Q;
	Q.push(L);
	K = 0;
	while (!Q.empty()) {
		int cn = Q.front();
		Q.pop();
		for (auto i : edge[cn]) {
			if (i == R) {
				K++;
				continue;
			}
			if (used[i])continue;
			used[i]++;
			Q.push(i);
		}
	}
	if (K == 2) {
		cout << "Yes\n";
		return 0;
	}
	cout << "No\n";
	return 0;
}

Measured memory_bytes: 6144
n,m,c = map(int, input().split())
b = list(map(int,input().split()))
a = []

def mul(x, y):
  ret = 0
  for i in range(len(x)):
    ret += x[i]*y[i]
  return ret
    
ans = 0
for i in range(n):
  a = list(map(int, input().split()))
  if mul(a, b) + c > 0:
    ans += 1

print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c=0,d,e,f,g,i,j,k;
    cin>>a>>b>>c;
    d=(a*100)+(b*10)+c;
    if(d%4==0){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }

    return 0;
}


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

int main()
{
    char s[101], t[101];
    char save, ans = 0, judge = 0;
    int i, j, k;
    
    cin >> s >> t;
    
    for(i = 0; s[i] != '\0'; i++) {
        for(j = i; j > 0; j--) {
            
            if(s[j] < s[j-1]) {
                save = s[j];
                s[j] = s[j-1];
                s[j-1] = save;
            }
        }
    }
    
    for(i = 0; t[i] != '\0'; i++) {
        for(j = i; j > 0; j--) {
            
            if(t[j] > t[j-1]) {
                save = t[j];
                t[j] = t[j-1];
                t[j-1] = save;
            }
        }
    }
    
    k = 0;
    do {
        if(t[k] == '\0') {
            ans = 0;
            judge = 1;
        } else if(s[k] == '\0') {
            ans = 1;
            judge = 1;
        } else if(s[k] < t[k]) {
            ans = 1;
            judge = 1;
        } else if(s[k] > t[k]) {
            ans = 0;
            judge = 1;
        }
        
        k++;
    } while(judge == 0);
    
    if(ans == 1) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    
    return 0;
}

Measured memory_bytes: 256
// D - Grid Repainting

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

int H, W;
char field[50][50];
int step[50][50]; // -1は未訪問

struct Loc {
	int r;
	int c;
};

// 四方向への移動ベクトル
const int dr[4] = {1, 0, -1, 0};
const int dc[4] = {0, 1, 0, -1};

// sr: スタート行, cs: スタート列, gr: ゴール行, gc: ゴール列
int bfs(int sr, int sc, int gr, int gc) {
	// 未訪問で初期化
	for (int r=0; r<H; r++) {
		for (int c=0; c<W; c++) {
			step[r][c] = -1;
		}
	}

	queue<Loc> search_queue;
	search_queue.push(Loc{sr, sc});
	step[sr][sc] = 1;

	while(!search_queue.empty()) {
		// キューから探索対象の位置情報を取り出す
		Loc loc = search_queue.front();
		search_queue.pop();

		int r = loc.r;
		int c = loc.c;
		int s = step[r][c];
		//cout << r << ' ' << c << " (" << s << ")" << endl; // **** debug ****

		if (r == gr && c == gc) return s; // ゴールに到達

		// 四方向の探索を予約
		for (int dir = 0; dir < 4; dir++) {
			int next_r = r + dr[dir];
			int next_c = c + dc[dir];

			if (next_r < 0 || next_r >= H || next_c < 0 || next_c >= W) continue; // 外壁がない場合
			if (field[next_r][next_c] == '#') continue; // 壁
			if (step[next_r][next_c] != -1) continue; // 探索済み
			search_queue.push(Loc{next_r, next_c});
			step[next_r][next_c] = s + 1;
		}
	}

	return -1; // ゴールできなかった場合
}

int main(){
	cin >> H >> W;

	int cnt_black = 0;
	for (int r=0; r<H; r++) {
		for (int c=0; c<W; c++) {
			cin >> field[r][c];
			if (field[r][c] == '#') cnt_black++;
		}
	}

	int shortest_step = bfs(0, 0, H-1, W-1);

	int ans;
	if (shortest_step == -1) ans = -1;
	else ans = H * W - cnt_black - shortest_step;

	cout << ans << endl;

	return 0;
}

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

using namespace std;


int main() {
	int s1, s2, sum, index;

	while (1) {
		cin >> s1 >> s2;
		if (s1 == 0 && s2 == 0) {
			break;
		}

		index = 0;
		sum = s1 + s2;
		for (int i = 1; i < 5; i++) {
			cin >> s1 >> s2;
			if (s1 + s2 > sum) {
				sum = s1 + s2;
				index = i;
			}
		}
		 
		cout << (char)('A' + index) << " " << sum << endl;
	}
	

	return 0;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Nondecreasing | diff Nondecreasing.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Nondecreasing.cpp && ./a.out

/*

 7/14/2020

 21:17-22:30 give up

 7/23/2020

 9:40-

 */

const int MAX_N=1e6+1;
LL A[MAX_N];
int N;

void solve() {
  int maxi=0;
  REP(i,N) if(abs(A[i])>abs(A[maxi])) maxi=i;
  vector<II> res;
  if(A[maxi]>0) {
    REP(i,N) if(A[i]<0) res.emplace_back(maxi,i),A[i]+=A[maxi];
    REP(i,N-1) res.emplace_back(i,i+1),A[i+1]+=A[i];
  } else {
    REP(i,N) if(A[i]>0) res.emplace_back(maxi,i),A[i]+=A[maxi];
    for(int i=N-1; i>0; --i) res.emplace_back(i,i-1),A[i-1]+=A[i];
  }

  assert(SZ(res)<=N*2);
  dumpC(A,A+N);
  REP(i,N-1) assert(A[i]<=A[i+1]);
  cout<<SZ(res)<<endl;
  FORR(p,res) cout<<p.first+1<<" "<<p.second+1<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;

  cin>>N;
  REP(i,N) cin>>A[i];
  solve();

  return 0;
}


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

int main() {
  string s;
  	cin>>s;
  int n=s.size();
  
  vector<char>vec(n);
  
  for(int i=0;i<n;i++){
    vec[i]=s.at(i);
  }
  int sum=0;
  int resum=0;
  
  if(vec[0]=='1'){
    for(int i=0;i<n;i+=2){
      if(vec[i]=='1'){
        sum+=1;
      }
    }
    for(int j=1;j<n;j+=2){
      if(vec[j]=='0'){
        resum+=1;
      }
    }
  }
  else{
    for(int j=0;j<n;j+=2){
      if(vec[j]=='0'){
        sum+=1;
      }
    }
    for(int k=1;k<n;k+=2){
      if(vec[k]=='1'){
        resum+=1;
      }
    }
  }
     int S=(n+1)/2;
     int T=n/2;
      if(max(S-sum,sum)==sum){
        cout<<S-sum+T-resum<<endl;
      }
   else{
        cout<<sum+resum<<endl;
      }    
  
}

Measured memory_bytes: 512
#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 main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;

    // rep(i, n) {int a; cin >> a;}
    int ans = ((n-1) + (k-1) - 1) / (k - 1);

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

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int, int>> vpii;
typedef pair<int, int> pii;
#define PB push_back
#define EB emplace_back
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

int main(){
	ll a; scanf("%lld", &a);
	printf("%lld\n", 3*a*a);
}


Measured memory_bytes: 256
a, b = map(int, input().split())

for i in range(65536*4+1):
  x = bin(i)[2:].zfill(a+b)

  if x.count('1') == a and x.count('0') == b and '00' not in x and '11' not in x:
    print("Yay!")
    exit(0)
print(":(")

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

const int MAX_N = 51;
int graph[MAX_N][MAX_N];
int N, M;
bool visited[MAX_N];
int A[MAX_N], B[MAX_N];

bool bfs() {
    fill(visited, visited + N, false);
    stack<int> stk;
    visited[0] = true;
    stk.push(0);
    while(!stk.empty()) {
        int p = stk.top(); stk.pop();
        for(int i = 0; i < N; ++i) {
            if(graph[p][i] && !visited[i]) {
                visited[i] = true;
                stk.push(i);
            }
        }
    }
    for(int i = 0; i < N; ++i)
        if(!visited[i]) return false;
    
    return true;
}

void solve() {
    int cnt = 0;
    for(int i = 0; i < M; ++i) {
        int a = A[i], b = B[i];
        graph[a][b] = graph[b][a] = 0;
        if(!bfs()) ++cnt;
        graph[a][b] = graph[b][a] = 1;
    }
    cout << cnt << endl;
}

int main()
{
    cin >> N >> M;
    for(int i = 0; i < N; ++i) 
        for(int j = 0; j < N; ++j) graph[i][j] = 0;
    
    for(int i = 0; i < M; ++i) {
        cin >> A[i] >> B[i];
        --A[i], --B[i];
        graph[A[i]][B[i]] = graph[B[i]][A[i]] = 1;
    }
    solve();
    return 0;
}

Measured memory_bytes: 256
// Package main provides
//
// File:  main.go
// Author: ymiyamoto
//
// Created on Fri Feb  1 19:23:56 2019
//
package main

import "fmt"

func main() {
	var N, M int
	fmt.Scan(&N, &M)
	if N == 1 && M == 1 {
		fmt.Println(1)
	} else if N == 1 || M == 1 {
		if N > 2 || M > 2 {
			fmt.Println(N*M - 2)
		} else {
			fmt.Println(0)
		}
	} else if N == 2 || M == 2 {
		fmt.Println(0)
	} else {
		fmt.Println(N*M - 2*N - 2*M + 4)
	}
}


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

using namespace std;
int V;
vector<int> G[102];
bool vis[102];
int d[102];
const int inf=0x3f3f3f;

void bfs(int s=1){
    d[s]=0;
    queue<int> que;
    que.push(s);
    while(!que.empty()){
        int t=que.front();
        que.pop();
        vis[t]=true;
        for(int i=0;i<G[t].size();i++){
            if(!vis[G[t][i]]){
                que.push(G[t][i]);
                d[G[t][i]]=min(d[G[t][i]],d[t]+1);
            }
        }
    }
}


int main(){
    cin>>V;
	int i;
	for(int i=1;i<=V;i++){
        d[i]=inf;
        vis[i]=false;
	}
    for(i=1;i<=V;i++){
        int id,k;
        cin>>id>>k;
        while(k--){
            int out;
            cin>>out;
            G[id].push_back(out);
        }
        sort(G[id].begin(),G[id].end());
    }
    bfs();
    for(int i=1;i<=V;i++){
        cout<<i<<" "<<(d[i]==inf?-1:d[i])<<endl;
    }
    return 0;
}

Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x1, x2, x3, x4, x5;
  cin >> x1 >> x2 >> x3 >> x4 >> x5;
 
  cout << 15-(x1+x2+x3+x4+x5) << endl;
  
}

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

long long int n,a,b,c, rs;
int main()
{
	rs=0;
	cin>>n>>a>>b;
	if(n==1&a==b)rs=1;
	else if(n>1&&a<=b)
	{
		rs=(n-2)*(b-a)+1;
	}

	cout<<rs<<endl;
}

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

using namespace std;

typedef long double ld;

class Point {
public:
	ld x, y;
	Point() {
		x = y = 0.0;
	}
	Point(ld x, ld y) :
			x(x), y(y) {
	}
	Point operator +(Point p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator -(Point p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator *(ld a) {
		return Point(x * a, y * a);
	}
	Point operator /(ld a) {
		return Point(x / a, y / a);
	}
};

class Segment {
public:
	Point p1, p2;
	Segment(Point p1, Point p2) :
			p1(p1), p2(p2) {
	}
};

class Circle {
public:
	Point c;
	ld r;
	Circle(Point c = Point(), ld r = 0.0) :
			c(c), r(r) {
	}
};

ld dot(Point p1, Point p2) {
	return p1.x * p2.x + p1.y * p2.y;
}

ld norm(Point p) {
	return p.x * p.x + p.y * p.y;
}

ld abs(Point p) {
	return sqrt(norm(p));
}

Point project(Segment s, Point p) {
	Point base = s.p2 - s.p1;
	ld r = dot(p - s.p1, base) / norm(base);
	return s.p1 + base * r;
}

pair<Point, Point> getCrossPoints(Circle c, Segment l) {
	Point pr = project(l, c.c);
	Point e = (l.p2 - l.p1) / abs(l.p2 - l.p1);
	ld base = sqrt(c.r * c.r - norm(pr - c.c));
	return make_pair(pr + e * base, pr - e * base);
}

int main() {

	int cx, cy, r;
	scanf("%d %d %d", &cx, &cy, &r);
	Point cp(cx, cy);
	Circle c(cp, r);

	int q;
	scanf("%d", &q);

	for (int i = 0; i < q; ++i) {
		int p1x, p1y, p2x, p2y;
		scanf("%d %d %d %d", &p1x, &p1y, &p2x, &p2y);
		Point p1(p1x, p1y);
		Point p2(p2x, p2y);
		Segment s(p1, p2);
		pair<Point, Point> pair = getCrossPoints(c, s);

		bool firstFirst = true;

		if (pair.first.x > pair.second.x) {
			firstFirst = false;
		} else if (pair.first.x == pair.second.x) {
			if (pair.first.y > pair.second.y) {
				firstFirst = false;
			}
		}

		if (firstFirst) {
			cout << fixed << setprecision(8) << pair.first.x << " " << pair.first.y << " " << pair.second.x << " " << pair.second.y << endl;
		} else {
			cout << fixed << setprecision(8) << pair.second.x << " " << pair.second.y << " " << pair.first.x << " " << pair.first.y << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3332
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define inf 1000000007
#define double long double
using namespace std;
typedef pair<ll, ll>P;
bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
ll lcm(ll x, ll y) {
	return x * y / gcd(x, y);
}
ll a[4444];
ll cnt[2222];
ll memo[2222];
signed main() {
	ll n, k, ans = 0;
	cin >> n >> k;
	rep(i, n)cin >> a[i];
	rep(i, n) {
		for (int j = i + 1; j < n; j++) {
			if (a[i] > a[j])memo[a[i]]++;
		}
	}
	rep(i, n) {
		rep(j, n) {
			if (a[i] > a[j])cnt[a[i]]++;
		}
	}
	rep(i, 2002) {
		ans += ((memo[i] * k) % inf + cnt[i] * (((k - 1) * k / 2) % inf)) % inf;
		ans %= inf;
	}
	cout << ans << endl;
	ggr
}





Measured memory_bytes: 256
// luogu-judger-enable-o2
#include<cstdio>
#include<vector>
using namespace std;
int n,x;
vector<int>a;
inline int read(){
	int ret=0;char c=getchar();
	while(c<'0'||c>'9')c=getchar();
	while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();
	return ret;
}
int main()
{
	n=read();
	for(register int i=1;i<=n;++i)x=read(),a.push_back(x);
	for(register int i=n;i>0;i-=2)printf("%d ",a[i-1]);
	for(register int i=(n&1)+1;i<=n;i+=2)printf("%d ",a[i-1]);
	return 0;
}

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
char s[20],t[20]="CODEFESTIVAL2016";
int main() {
    scanf("%s",s);
    int ans=0;
    for (int i=0;i<16;i++) {
        if (s[i]!=t[i]) ans++;
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#define ll long long

using namespace std;


int main() {
	double r;
	cin >> r;
	const double pi = 3.141592653589793238462643383279;

	printf("%lf %lf", pi*r*r, 2 * pi*r);


}




Measured memory_bytes: 3284
#pragma region RegionDefs
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,j,n) for(int i=(j),i##_len=(n);i<i##_len;++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define all(x) begin(x),end(x)
using namespace std;
const int INF = 1e9;
template<class T=int> using P  = pair<T, T>;
template<class T=int> using V  = vector<T>;
template<class T=int> using PQ = priority_queue<T>;
template<class T=int> using PQG = priority_queue<T, V<T>, greater<T>>;
typedef long long ll;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)
//時間が厳しいとき使う
#define INI(...) int __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
template<class T>bool chmax(T &a, const T &b) {if (a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if (a>b) {a=b; return 1;} return 0;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#define YN(e) cout << ((e) ? "YES" : "NO") << endl
#define yn(e) cout << ((e) ? "Yes" : "No") << endl
#pragma endregion RegionDefs

void solve()
{
    int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    IN(k);
    cout << a[k-1] << endl;
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}

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

#define REP(i, n) for (int i = 0; i < n; i++)
int main(void)
{
    int N, M, a;
    cin >> N >> M;
    REP (i, M) {
        cin >> a;
        N -= a;
    }
    if (N < 0) cout << -1 << endl;
    else cout << N << endl;
}

Measured memory_bytes: 3636
K = int(input())
lst = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(lst[K-1])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
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; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){
  int n;
  cin >> n;
  while(true){
    double  b;
    int a;
    a = b  =sqrt(n);
    if(a==b){
      cout << n fin;
      return 0;
    }
    n--;
  }
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(int i = 0; i < n; i++)
using namespace std;
ll MOD = 1000000007;

int main() {
    int x;
    cin >> x;
    if (x < 1200) {
        cout << "ABC" << endl;
    }
    else {
        cout << "ARC" << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(void){
    char s[20];
    fgets(s,20,stdin);
    int len=strlen(s)-1;
    int n;
    scanf("%d",&n);
    //rule1
    int sum=s[0]-'0';
    for(int i=1;i<len-1;i+=2){
        if(s[i]=='+')
            sum+=s[i+1]-'0';
        else
            sum*=s[i+1]-'0';
    }
    //printf("%d\n",sum);
    //rule2
    int num[20]={0};
    int index=0;
    num[0]=s[0]-'0';
    for(int i=1;i<len-1;i+=2){
        if(s[i]=='+')
            num[++index]=s[i+1]-'0';
        else
            num[index]*=s[i+1]-'0';
    }
    int wa=0;
    for(int i=0;i<=index;i++){
        wa+=num[i];
        //printf("%d ",num[i]);
    }//puts("");
    //printf("%d\n",wa);
    if(sum!=n&&wa==n) printf("M\n");
    if(sum==n&&wa!=n) printf("L\n");
    if(sum==n&&wa==n) printf("U\n");
    if(sum!=n&&wa!=n) printf("I\n");
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define R register
#define mp make_pair
#define ll long long
#define pii pair<int, int>
using namespace std;
const int N = 510, mod = 1e9 + 7;

int n, x, a[N], f[2][N][N], comb[N][N], fac[N];

template <class T>
inline void read(T &x) {
	x = 0;
	char ch = getchar(), w = 0;
	while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
	while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	x = w ? -x : x;
	return;
}

int main() {
	read(n), read(x);
	for (R int i = 0; i <= max(n, x); ++i) {
		comb[i][0] = 1, fac[i] = i ? (ll) i * fac[i - 1] % mod : 1;
		for (R int j = 1; j <= i; ++j)
			comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % mod;
	}
	for (R int i = 1; i <= n; ++i) read(a[i]);
	sort(a + 1, a + 1 + n, greater<int>());
	ll ans = x - a[1] + 1;
	f[1][1][a[1]] = 1;
	for (R int i = 2; i <= n; ++i) {
		ans = ans * (x - a[i] + 1) % mod;
		memset(f[i & 1], 0, sizeof (f[i & 1]));
		for (R int j = x / a[i], w = i & 1; j; --j) {
			for (R int k = a[1] + a[i] * (j - 1); k < x; ++k) {
				f[w][j][k] = (f[w ^ 1][j - 1][k - a[i]] + (ll) f[w ^ 1][j][k] * (k - j * (a[i] - 1))) % mod;
				for (R int u = 0; u <= a[i] - 2; ++u)
					f[w][j][k] = (f[w][j][k] + (ll) (j + 1) * j * (a[i] - 1 - u) * f[w ^ 1][j + 1][k - u]) % mod;
				for (R int u = 1; u < a[i]; ++u)
					f[w][j][k] = (f[w][j][k] + 2ll * j * f[w ^ 1][j][k - u]) % mod;
			}
		}
	}
	for (R int i = 1, w = n & 1; i <= n; ++i)
		for (R int j = i; j < x; ++j)
			ans = (ans + mod - (ll) comb[x - j + i][i] * fac[i] % mod * f[w][i][j] % mod) % mod;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a;
    string tb;
    cin >> a >> tb;
    ll b = (tb[0] - '0') * 100 + (tb[2] - '0') * 10 + (tb[3] - '0');
    cout << a * b / 100 << '\n';
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int n, m;
vector<int> graph[100100];
vector<int> memo(100100, 0);
bool visited[100100];

int dfs( int target ){
	if( visited[target] ) return memo[target];
	visited[target] = true;
	if( graph[target].empty() ){
		return memo[target] = 0;
	}
	int len = -1;
	for( auto node : graph[target] ) len = max( len, dfs(node)+1 );
	return memo[target] = len;
}

int main(){
	cin >> n >> m;
	for( int i = 0; i < n+m-1; ++i ){
		int x, y; cin >> x >> y;
		--x; --y;
		graph[x].push_back(y);
	}
	for( int i = 0; i < n; ++i ) dfs(i);
	int ans[n];
	vector<pair<int, int>> sv;
	for( int i = 0; i < n; ++i ){
		sv.emplace_back(memo[i], i);
	}
	sort( sv.begin(), sv.end(), []( const auto &x, const auto &y ){ return x.first > y.first;} );
	ans[sv[0].second] = -1; 
	for( int i = 0; i < n; ++i ){
		for( auto node : graph[sv[i].second] ){
			ans[node] = sv[i].second;
		}
	}
	for( int i = 0; i < n; ++i ){
		cout << ans[i]+1 << endl;
	}
	return 0;
}


// 11:08

Measured memory_bytes: 10864
#include<bits/stdc++.h>
using namespace std;
#define mod 998244353
typedef long long ll;
int gcd(int m,int k){
    if(m<k) swap(m,k);
    if(!k) return m;
    else return gcd(m%k,k);
}


int add(int x,int y){
    x+=y;
    if (x>=mod) x%=mod;
    if(x<0) {
        x%=mod;
        x+=mod;
        if(x==mod) x=0;
    }return x;
}

int mul(int a,int b){
    ll c=ll(a)*ll(b)%mod;
    return c;
}
int a,b,c,d,dp[3001][3001];

int main()
{
    cin>>c>>d>>a>>b;
    for(int i=c;i<=a;i++)
        for (int j=d;j<=b;j++)
            if(i==c){
                if(j==d) dp[i][j]=1;
                else dp[i][j]=mul(dp[i][j-1],i);
            }
            else {
                if(j==d) dp[i][j]=mul(dp[i-1][j],j);
                else dp[i][j]=add(add(mul(dp[i][j-1],i),mul(dp[i-1][j],j)),-mul(mul(dp[i-1][j-1],i-1),j-1));
            }

    cout<<dp[a][b];
    return 0;

}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
const int inf=1010001000;
const ll  INF=1001000100010001000;
const int mod=(int)1e9+7;

int main(){
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    vector<int> num;
    if(s.at(0)=='0')num.push_back(0);

int t=0;
    while(t<n){
        int j=t;
        while(j<n and s.at(j)==s.at(t)){
            j++;
        }
        num.push_back(j-t);
        t=j;
    }

    if(s.at(n-1)=='0')num.push_back(0);

    vector<int> sum(num.size()+1,0);
    rep(i,0,num.size()){
        sum.at(i+1)=sum.at(i)+num.at(i);
    }

    int ans=0;
    for(int i=0; i<sum.size();i+=2){
        int j=i+k*2+1;
        if(j>=sum.size())j=sum.size()-1;
        ans=max(ans,sum.at(j)-sum.at(i));
    }
    cout<<ans<<endl;
return 0;
}

Measured memory_bytes: 1272
import java.util.Scanner;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X=sc.nextInt();
		if(X==1||X==2) {
			System.out.println(2);
		}else {
		for(int i=X;;i++) {
			for(int j=2;j<X;j++) {
				if(i%j==0) {
					break;
				}
				if(j==X-1) {
					System.out.println(i);
					System.exit(0);
				}
			}
		}}

}}


Measured memory_bytes: 23892