akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int w[101];
int main(){
	int i,j,n,total=0,s1=0,s2=0,mn=2100000000,diff=0,turn=0;
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>w[i];
		total+=w[i];
	}
	for(i=1;i<=n;i++){
		turn++;
		s1=0;
		for(j=1;j<=turn;j++){
			s1+=w[j];
			//cout<<w[j]<<" ";
		}
		s2=total-s1;
		diff=abs(s1-s2);
		if(diff<mn) mn=diff;
		//cout<<s1<<" "<<s2<<" "<<abs(s1-s2)<<" "<<diff<<endl;
	}
	cout<<mn<<endl;
	return 0;
}

Measured memory_bytes: 256
using System.Collections.Generic;
using System.Linq;
using System;

public class Ba
{
    public int s { get; set; }
    public int t { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var d = new Dictionary<int, List<Ba>>();
        var tmax = 0;
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var C = int.Parse(line[1]);
        for (int i = 0; i < C; i++) d[i] = new List<Ba>();
        for (int i = 0; i < n; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            var s = int.Parse(line[0]);
            var t = int.Parse(line[1]);
            tmax = Math.Max(tmax, t);
            var c = int.Parse(line[2]) - 1;
            d[c].Add(new Ba { s = s, t = t });
        }
        var bas = setData(d, n, C);
        Console.WriteLine(getAns(bas, tmax));
    }
    public static int getAns(List<Ba> bas, int tmax)
    {
        var a = new int[tmax + 1];
        for (int i = 0; i < bas.Count(); i++)
        {
            a[bas[i].s - 1]++;
            a[bas[i].t]--;
        }
        var ret = a[0]; var rw = a[0];
        for (int i = 1; i < a.Length; i++)
        {
            rw = a[i] + rw;
            ret = Math.Max(ret, rw);
        }
        return ret;
    }
    public static List<Ba> setData(Dictionary<int, List<Ba>> d, int n, int C)
    {
        var ret = new List<Ba>();
        for (int i = 0; i < C; i++)
            if (d[i].Count() >= 2)
            {
                var sortd = d[i].OrderBy(x => x.s).ToArray();
                var ns = sortd[0].s; var nt = sortd[0].t;
                var wns = false;
                for (int j = 1; j < sortd.Length; j++)
                {
                    if (sortd[j].s == nt) { nt = sortd[j].t; wns = true; }
                    else { ret.Add(new Ba { s = ns, t = nt }); ns = sortd[j].s; nt = sortd[j].t; }
                    if (j == sortd.Length - 1 && wns) ret.Add(new Ba { s = ns, t = nt });
                    else if (j == sortd.Length - 1 && !wns) ret.Add(new Ba { s = sortd[j].s, t = sortd[j].t });
                }
            }
            else if (d[i].Count() == 1) ret.Add(new Ba { s = d[i][0].s, t = d[i][0].t });
        return ret;
    }
}


Measured memory_bytes: 34108
#include <bits/stdc++.h>
using namespace std;
using graph = vector<vector<int>>;

const int FLAG = -1;

const int mod = 1e9 + 7;

int dp[100000][2];

int calc(int v, int prev, const graph& G, bool flag = false) {
	if (dp[v][flag] != FLAG) return dp[v][flag];
	int res1 = 1, res2 = flag ? 0 : 1;
	for (auto to : G[v]) if (to != prev) {
		res1 = (1LL * res1 * calc(to, v, G, false)) % mod;
		res2 = (1LL * res2 * calc(to, v, G, true)) % mod;
	}
	return dp[v][flag] = (res1 + res2) % mod;
}

int main()
{
	int N;
	cin >> N;
	graph G(N);
	for (int i = 0; i < N - 1; i++) {
		int x, y;
		cin >> x >> y; --x, --y;
		G[x].push_back(y);
		G[y].push_back(x);
	}
	for (int i = 0; i < N; i++) dp[i][0] = dp[i][1] = FLAG;
	cout << calc(0, -1, G) << endl;
	return 0;
}


Measured memory_bytes: 14848
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
//using namespace __gnu_pbds;
//typedef tree<
//        pair<long long, int>, // change type
//        null_type,
//        less<pair<long long, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;
//template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

typedef long long ll;
#define rep(i, start, end) for(int i = start; i < end; ++i)
#define sz(x) (int)(x).size()
#define pb push_back
#define h first
#define p second
#define all(x) x.begin(), x.end()
#define clr(d, v) memset(d, v, sizeof(d))
#define pii pair<int, int>
const double PI = 3.14159265358979323846;
const double eps = (1e-5);
int dcmp(long double x, long double y)
{
    if (abs(x - y) < eps)
        return 0;
    if (x > y)
        return 1;
    return -1;
}

int n;
const int MAX_N = 5005;
pair<int, int> a[MAX_N];
bool cmp(pair<int, int> &x, pair<int, int> &y)
{
    return min(x.h, y.h - x.p) > min(y.h, x.h - y.p);
}

long long mem[MAX_N][MAX_N];
#define INF 0x3F3F3F3F3F3F3F3F

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
//#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
////    freopen("facebook.txt", "w", stdout);
//#endif
    cin >> n;
    rep(i,0,n)
        cin >> a[i].h >> a[i].p;
    sort(a, a + n, cmp);

    clr(mem, 0x3F);
    rep(i,0,n)
        mem[0][i] = 0;

    mem[1][0] = a[0].p;
    for (int pick = 1; pick <= n; ++pick)
    {
        for (int i = max(1, pick - 1); i < n; ++i)
        {
            mem[pick][i] = mem[pick][i - 1];
            if (mem[pick - 1][i - 1] <= a[i].h)
                mem[pick][i] = min(mem[pick][i], mem[pick - 1][i - 1] + a[i].p);
        }
    }

    int ans = 0;
    for (int pick = 0; pick <= n; ++pick)
    {
        if (mem[pick][n - 1] < INF)
            ans = pick;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 195968
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
#include <stack>
#include <iomanip>
#include <limits>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
typedef priority_queue<ll> PQ_HIGH;
typedef priority_queue<ll,VL,greater<ll>> PQ_LOW;//昇順

int main(){
  string N;cin>>N;
  int s=N.length();
  if(N[s-1]=='3'){cout<<"bon";}
  else if(N[s-1]=='0'||N[s-1]=='1'||N[s-1]=='6'||N[s-1]=='8'){
    cout<<"pon";
  }
  else{
    cout<<"hon";
  }
}

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

const int M=1000010;
int c[M];

int main()
{
    int n; cin>>n;
    map<int, int> a;
    for(int i=0; i<n; ++i) {
        int t; cin>>t;
        ++a[t];
    }
    
    vector<int> v;
    for(auto& [x, y]: a) v.push_back(x);

    for(int e: v) if (!c[e])
        for(int j=e+e; j<M; j+=e) c[j]=1;

    int res=0;
    for(auto& [x, y]: a)
        if (y==1 and !c[x]) ++res;

    cout<<res<<endl;
}


Measured memory_bytes: 17208
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
 
#define barsik ios::sync_with_stdio(false)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
 
typedef long long ll;
typedef std::vector<int> vi;
typedef std::pair <int, int> pii;
typedef std::unordered_set <int> u_si;
 
using namespace std;
void solve(){
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    for(int i = 0; i < n; i++){
        cout << s[i] << t[i];
    }
}

 
int main(){
    barsik;
    int q = 1;
//    freopen("file.txt", "w", stdout);
    //cin >> q;
 
    for(double i = 1; i <= q; i++){
        //cout << "Case " << i << ": ";
        solve();
    }
}


Measured memory_bytes: 256
#import pysnooper
#import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)
input=stdin.readline

n,m=map(int,input().split())
graph=[[0]*n for _ in range(n)]
v=[list(map(int,input().split())) for _ in range(m)]
l=[0]*n

def dfs(x):
    if l[x]:
        return
    l[x]=1
    for i in range(n):
        if graph[x][i]:
            dfs(i)

for i in v:
    graph[i[0]-1][i[1]-1]=1
    graph[i[1]-1][i[0]-1]=1

ans=0
for i in range(m):
    graph[v[i][1]-1][v[i][0]-1]=0
    graph[v[i][0]-1][v[i][1]-1]=0

    chack=False
    l=[0]*n
    dfs(0)

    for j in l:
        if not j:
            ans+=1
            break
    graph[v[i][1]-1][v[i][0]-1]=1
    graph[v[i][0]-1][v[i][1]-1]=1
print(ans)

Measured memory_bytes: 3064
n = int(input())

li1=list(map(int,input().split()))
li2=list(map(int,input().split()))
suli1=[int(li1[0])]
suli2=[int(li2[0])]
for i in range(1,n):
    suli1.append(int(suli1[i-1]+li1[i]))
    suli2.append(int(suli2[i-1]+li2[i]))
    
sum=0
for j in range(n):
  if(j==0):
    s=suli1[0]+suli2[n-1]
    sum=max(sum,s)
  else:
    s=suli1[j]+suli2[n-1]-suli2[j-1]
    sum=max(sum,s)
  
  
print(sum)

Measured memory_bytes: 3064
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INITA(a,i,j,v) for(ll k=i;k<=j;k++){a[k]=v;}

int main() {
    int h, w; cin >> h >> w;
    string a[1000]; INITA(a, 0, 999, "");
    REP(i, h) {
        cin >> a[i];
    }
    REP(i, h) {
        REP(j, w) {
            if (a[i][j] == '.') {
                int res = 0;
                FOR(dh, -1, 1) {
                    FOR(dw, -1, 1) {
                        if (0<=i+dh && i+dh<h && 0<=j+dw && j+dw<w && a[i+dh][j+dw] == '#') {
                            res++;
                        }
                    }
                }
                cout << res;
            } else {
                cout << '#';
            }
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, a) for (int i = 0; i < (int)(a); i++)
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
typedef long long ll;
template<typename T>istream& operator>>(istream&i,vector<T>&v){rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const vector<T>&v){stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,const vector<T>&v){if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v){return i>>v.first>>v.second;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v){return o<<v.first<<","<<v.second;}
template<typename T>bool mins(T& x,const T&y){if(x>y){x=y;return true;}else return false;}
template<typename T>bool maxs(T& x,const T&y){if(x<y){x=y;return true;}else return false;}
template<typename T>ll suma(const vector<T>&a){ll res(0);for(auto&&x:a)res+=x;return res;}

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template <typename Head> void dump(Head &&head) {
  cerr << head;
  dump();
}
template <typename Head, typename... Tail>
void dump(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  dump(forward<Tail>(tail)...);
}
#define debug(...)                                                               \
  do {                                                                         \
    cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = ";                        \
    dump(__VA_ARGS__);                                                         \
  } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template <typename T> struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template <typename T> using Edges = vector<edge<T>>;
template <typename T> using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template <typename T> using Matrix = vector<vector<T>>;

const ll LINF = 1LL << 60;
const int INF = 1001001001;

/////////////////////////////////////////////////////////////////////

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

  vector<ll> d(n+1);
  for (int i=1; i<=n; i++) {
    for (int j=1; i*j<=n; j++) {
      d[i*j]++;
    }
  }


  ll ans = 0;
  for (int c=1; c<=n; c++) {
    ans += d[n-c];
  }
  cout << ans << "\n";

  return 0;
}


Measured memory_bytes: 11176
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n, m, a, b, c;

vector<pair<int, LL>> edge[101010];
LL cost[2][101010];

void dfs(int st, int no, int cur){
	if(cost[st][no] == INF<LL>()){
    	cost[st][no] = cur;
    	for(auto to:edge[no]) dfs(st^1,to.first,to.second-cur);
	}
	if(cost[st][no] != cur){
    	cout << 0 << endl;
    	exit(0);
	}
}

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

	REP(i, m){
	    cin >> a >> b;
    	cin >> c;
    	a--; b--;
    	edge[a].emplace_back(make_pair(b,c));
    	edge[b].emplace_back(make_pair(a,c));
	}

	REP(i,2) REP(j,n) cost[i][j] = INF<LL>();
  	dfs(0,0,0);
	
  	if(cost[1][0] != INF<LL>()){
    	int tmp = abs(cost[0][0]-cost[1][0]);
    	REP(j,2) REP(k,n) cost[j][k] = INF<LL>();
    	dfs(0,0,tmp/2);
    	REP(i,n){
      		if(min(cost[0][i],cost[1][i]) > 0) continue;
      		cout << 0 << endl;
      		return 0;
    	}
    	cout << 1 << endl;
    	return 0;
	}
	else{
    	LL mn = 1, mx = INF<LL>();
    	REP(i,n){
      		int tmp = (cost[0][i] == INF<LL>());
      		if(tmp == 0) mn = max(mn,-cost[tmp][i]+1);
      		else mx = min(mx,cost[tmp][i]-1);
    	}
    	cout << max(0LL,mx-mn+1) << endl;
	}
}

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

int main(){
  int N;
  cin >> N;

  if(N>=64) cout << 64 << endl;
  else if (N>=32) cout << 32 << endl;
  else if (N>=16) cout << 16 << endl;
  else if (N>=8) cout << 8 << endl;
  else if (N>=4) cout << 4 << endl;
  else if (N>=2) cout << 2 << endl;
  else cout << 1 << endl;
}


Measured memory_bytes: 256
program prob4
    implicit none
    character(len=100005)::s
    integer::i, j, l, cnt
    read*, s
    l = len_trim(s)
    cnt = 0
    do i = 2, l
        if(s(i:i) .ne. s(i-1:i-1)) cnt = cnt + 1
    end do
    print*, cnt
    stop
end program

Measured memory_bytes: 3108
package main

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

func main() {
	N := nextInt()
	A := make([]int64, N)

	x0 := int64(0)

	for i := 0; i < N; i++ {
		A[i] = nextInt64()

		if i%2 == 0 {
			x0 += A[i]
		} else {
			x0 -= A[i]
		}
	}

	fmt.Print(x0)
	x := x0

	for i := 0; i < N-1; i++ {
		xi := A[i]*2 - x
		x = xi
		fmt.Printf(" %d", xi)
	}

	fmt.Println()
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)

	return i
}


Measured memory_bytes: 5760
#include<bits/stdc++.h>
#define ll long long
#define F(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define i64 int64_t
#define fi first
#define se second
using namespace std;
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);
	string s,t,u;int a,b;
	cin>>s>>t>>a>>b>>u;
	if(u==s)a--;
	else b--;
	cout<<a<<" "<<b;
}

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

using namespace std;
typedef long long ll;

int main(){
    int n;
    cin>>n;
    vector<int> c(n-1),s(n-1),f(n-1);
    for(int i=0;i<n-1;i++){
        cin>>c[i]>>s[i]>>f[i];
    }
    vector<int> ans(n);
    for(int i=0;i<n-1;i++){
        int res=0;
        for(int j=i;j<n-1;j++){            
            if(res<=s[j]){
                res=s[j]+c[j];
            }else if(0==res%f[j]){
                res+=c[j];
            }else{
                res+=f[j]-res%f[j]+c[j];
            }            
        }
        ans[i]=res;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 3612
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] x = new long[n];
        long[] y = new long[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextLong();
            y[i] = sc.nextLong();
        }
        if (n <= 1) {
            System.out.println(1);
            return;
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) {
                    continue;
                }
                int cnt = 1;
                boolean[] visited = new boolean[n];
                long p = x[i] - x[j];
                long q = y[i] - y[j];
                visited[i] = true;
                visited[j] = true;
                for (int k = 0; k < n; k++) {
                    for (int l = 0; l < n; l++) {
                        if (visited[l]) {
                            continue;
                        }
                        if (x[k] - p == x[l] && y[k] - q == y[l]) {
                            visited[l] = true;
                        }
                    }
                }
                for (int k = 0; k < n; k++) {
                    if (!visited[k]) {
                        cnt++;
                    }
                }
                ans = Math.min(ans, cnt);
            }
        }
        System.out.println(ans);
    }

}


Measured memory_bytes: 24500
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

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;}

const ll INF=1e18;

int main()
{
    ll n;
    cin >> n;
    vector<ll> p(n+1);
    vector<pll> prime;
    for(ll i=2;i<=n;i++){
        if(p[i]==0){
            prime.push_back(make_pair(i,0));
            for(ll j=i;j<=n;j+=i){
                p[j]=1;
            }
        }
    }
    ll sz=prime.size();
    rep(i,sz){
        ll val=prime[i].fi;
        while(n/val){
            prime[i].se+=n/val;
            val*=prime[i].fi;
        }
    }
    ll ans=0;
    for(auto x:prime){ //75
        if(x.se>=74) ans++;
    }
    for(auto x:prime){ //25×3
        for(auto y:prime){
            if(x.se>=24 && y.se>=2 && x.fi!=y.fi){
                ans++;
            }
        }
    }
    for(auto x:prime){ //15×5
        for(auto y:prime){
            if(x.se>=14 && y.se>=4 && x.fi!=y.fi){
                ans++;
            }
        }
    }
    for(auto x:prime){
        ll cnt=0;
        for(auto y:prime){
            for(auto z:prime){
                if(x.se>=2 && y.se>=4 && z.se>=4 && x.fi!=y.fi && y.fi!=z.fi && z.fi!=x.fi){
                    cnt++;
                }
            }
        }
        ans+=cnt/2;
    }
    cout << ans << endl;
    return 0;
} 

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	string S;	cin>>S;
	int stop=S.size()/2;
	int count=0;
	FOR(i,0,stop){
		if(S[i]!=S[S.size()-1-i])	count++;
	}

	cout<<count<<endl;

    return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define cs const
#define re register
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define y1 shinkle
#define fi first
#define se second
#define bg begin
cs int RLEN=1<<20|1;
inline char gc(){
    static char ibuf[RLEN],*ib,*ob;
    (ib==ob)&&(ob=(ib=ibuf)+fread(ibuf,1,RLEN,stdin));
    return (ib==ob)?EOF:*ib++;
}
#define gc getchar
inline int read(){
    char ch=gc();
    int res=0;bool f=1;
    while(!isdigit(ch))f^=ch=='-',ch=gc();
    while(isdigit(ch))res=(res*10)+(ch^48),ch=gc();
    return f?res:-res;
}
inline ll readll(){
    char ch=gc();
    ll res=0;bool f=1;
    while(!isdigit(ch))f^=ch=='-',ch=gc();
    while(isdigit(ch))res=(res*10)+(ch^48),ch=gc();
    return f?res:-res;
}
inline char readchar(){
	char ch=gc();
	while(isspace(ch))ch=gc();
	return ch;
}
inline int readstring(char *s){
	int top=0;char ch=gc();
	while(isspace(ch))ch=gc();
	while(!isspace(ch)&&ch!=EOF)s[++top]=ch,ch=gc();
	s[top+1]='\0';return top;
}
template<typename tp>inline void chemx(tp &a,tp b){a=max(a,b);}
template<typename tp>inline void chemn(tp &a,tp b){a=min(a,b);}
ll a,b,c,d;
map<ll,ll>mp;
ll dfs(ll n){
	if(n==0)return 0;
	if(mp.count(n))return mp[n];
	ll res=6e18;
	if(res/n>=d)chemn(res,n*d);
	if(n==1)return res;
	ll k=n/2*2;
	chemn(res,dfs(n/2)+a+d*(n-k));
	if(n>2)chemn(res,dfs(n/2+1)+a+d*(k+2-n));
	k=n/3*3;
	chemn(res,dfs(n/3)+b+d*(n-k));
	chemn(res,dfs(n/3+1)+b+d*(k+3-n));
	k=n/5*5;
	chemn(res,dfs(n/5)+c+d*(n-k));
	chemn(res,dfs(n/5+1)+c+d*(k+5-n));
	return mp[n]=res;
}
void solve(){
	ll x=readll();mp.clear();
	a=readll(),b=readll(),c=readll(),d=readll();
	cout<<dfs(x)<<'\n';
}
int main(){
	int T=read();
	while(T--)solve();
	return 0;
}

Measured memory_bytes: 4668
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long int a,b,c,d,kei,kei1,kei2,kei3;
    cin >> a >> b >> c >> d ;
    kei=a*c;
    kei1=a*d;
    kei2=b*c;
    kei3=b*d;
    
    kei=max(kei,kei1);
    kei1=max(kei2,kei3);
    cout <<  max({kei1,kei});
    return 0;
}

Measured memory_bytes: 3616
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
const int N=1e5+5;
int n,a[N],b[N],c[N],tot,sta[N<<1],lcm; ll k;
bool vis[N];
int rdn()
{
  int ret=0;bool fx=1;char ch=getchar();
  while(ch>'9'||ch<'0'){if(ch=='-')fx=0;ch=getchar();}
  while(ch>='0'&&ch<='9') ret=ret*10+ch-'0',ch=getchar();
  return fx?ret:-ret;
}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void dfs(int cr)
{
  sta[++tot]=cr;vis[cr]=1;
  if(!vis[b[cr]])dfs(b[cr]);
}
int main()
{
  n=rdn();
  for(int i=1;i<=n;i++)a[i]=rdn();
  for(int i=n;i;i--)a[i]-=a[i-1];
  for(int i=1;i<=n;i++)b[i]=i;
  int m;m=rdn(); scanf("%lld",&k);
  for(int i=1,d;i<=m;i++)
    {
      d=rdn(); swap(b[d],b[d+1]);
    }
  lcm=1;
  for(int i=1;i<=n;i++)
    if(!vis[i])
      {
	tot=0; dfs(i);
	for(int j=tot+1;j<=tot<<1;j++)
	  sta[j]=sta[j-tot];
	int d=k%tot;
	for(int j=1;j<=tot;j++)
	  c[sta[j]]=a[sta[j+d]];
      }
  ll lj=c[1];
  for(int i=1;i<=n;i++,lj+=c[i])
    printf("%lld\n",lj);
  return 0;
}

Measured memory_bytes: 3328
from collections import deque
K = int(input())
Q = deque([])

for i in range(1,10):
  Q.append(i)
for i in range(K-1):
  x = Q.popleft()
  y = x%10
  if(x%10 != 0):
    Q.append(10 * x + y - 1)
  Q.append(10*x + y)
  if(x%10 != 9):
    Q.append(10 * x + y + 1)
print(Q.popleft())

Measured memory_bytes: 11944
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

const MOD: u64 = 1000_000_000 + 7;

fn main() {
    let v: Vec<usize> = read_vec();
    let x = read_vec::<i64>();
    let y = read_vec::<i64>();

    let (n, m) = (v[0] - 1, v[1] - 1);
    let mut n_coef = vec![0u64; n];
    let mut m_coef = vec![0u64; m];

    for i in 0..n {
        n_coef[i] = 1 + i as u64 + (n - i - 1) as u64;
        n_coef[i] %= MOD;
        n_coef[i] += (i * (n - i - 1)) as u64;
        n_coef[i] %= MOD;
    }

    for i in 0..m {
        m_coef[i] = 1 + i as u64 + (m - i - 1) as u64;
        m_coef[i] %= MOD;
        m_coef[i] += (i * (m - i - 1)) as u64;
        m_coef[i] %= MOD;
    }

    let x = (1..n + 1)
        .map(|i| (x[i] - x[i - 1]) as u64)
        .collect::<Vec<_>>();
    let y = (1..m + 1)
        .map(|i| (y[i] - y[i - 1]) as u64)
        .collect::<Vec<_>>();

    let x_areas = (0..n).fold(0, |s, i| (s + (x[i] * n_coef[i]) % MOD) % MOD);
    let y_areas = (0..m).fold(0, |s, i| (s + (y[i] * m_coef[i]) % MOD) % MOD);
    let ans = (x_areas * y_areas) % MOD;
    println!("{:?}", ans);
}


Measured memory_bytes: 11512
N = int(input())
S = []
for i in range(N):
    S.append(input().split(" "))
    S[i].append(i)
    S[i][1] = int(S[i][1])
S =  sorted(S,key = lambda x : x[1],reverse = True)
S =  sorted(S,key = lambda x : x[0])
for i in range(N):
    print(S[i][2]+1)



Measured memory_bytes: 3060
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""abc080_b"""


import sys

from functools import reduce

def main():
    """Main function."""
    n = int(input())
    sum_digits = reduce(lambda a, b: a + b, map(int, str(n)))

    if n % sum_digits == 0:
        print("Yes")
    else:
        print("No")



if __name__ == '__main__':
    sys.exit(main())

Measured memory_bytes: 3828
#include <cstdio>

int main()
{
	int n;
	scanf("%d", &n);
	int mn = 2147483647, ans = 0;
	for (int i = 1; i <= n; i++)
	{
		int x;
		scanf("%d", &x);
		if (mn > x) mn = x, ans++;
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define in ({int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';n?-x:x;})
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l,int r){return l+rng()%(r-l+1);}
#define fasty ios_base::sync_with_stdio(false),cin.tie(nullptr);
#define task "random"
#define forinc(a,b,c) for(int a=b,_c=c;a<=_c;++a)
#define fordec(a,b,c) for(int a=b,_c=c;a>=_c;--a)
#define forv(a,b) for(auto&a:b)
#define fi first
#define se second
#define pb push_back
#define ii pair<int,int>
#define mt make_tuple
#define all(a) a.begin(),a.end()
#define reset(f, x) memset(f, x, sizeof(f))
#define bit(x,i) ((x>>(i-1))&1)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1<<(i-1)))
main(){
    //freopen(task".inp","r",stdin);
    //freopen(task".out","w",stdout);
    int x=in,y=in;
    if(x>3) x=4;
    if(y>3) y=4;
    vector<int> val={0,300000,200000,100000,0};
    cout<<val[x]+val[y]+(x==1 && y==1?400000:0);
}



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

int main(){
  int A,B,C,D;
  cin>>A>>B>>C>>D;
  for(int i=0;i<100;i++){
    C-=B;
    if(C<=0){
      cout<<"Yes"<<endl;
      break;
    }
    A-=D;
    if(A<=0){
      cout<<"No"<<endl;
      break;
    }
  }
}

Measured memory_bytes: 3528
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
ll n,l[100];
int main(){
  std::cin >> n;
  l[0] = 2, l[1] = 1;
  for(int i = 2; i<89; i++){
    l[i] = l[i-1] + l[i-2];
  }
  std::cout << l[n] << '\n';
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define eps 1e-8
#define INF 0x3f3f3f3f
#define pb push_back
#define endl '\n'
#define IO ios::sync_with_stdio(false)
using namespace std;
const ll maxn = 1e6 + 5;
string str;
int main(){
    cin >> str;
    int f = 1;
    str = "0" + str;
    int n = str.size() - 1;
    for(int i = 1; i <= n; i++)
        if(str[i] != str[n - i + 1])f = 0;
    for(int i = 1; i <= (n - 1) / 2; i++)
        if(str[i] != str[(n - 1) / 2 - i + 1])f = 0;
    for(int i = (n + 3) / 2; i <= n; i++)
        if(str[i] != str[n - i + 1])f = 0;
    if(f)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const long long INF = 1LL << 60;
using Graph = vector<vector<int>>;

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

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; }

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

int main() {
    string a, b;
    cin >> a >> b;
    int n = stoi(a + b);
    for (int i = 1; i <= 317; i++) {
        if (i*i == n) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3576
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

struct point {double x,y;};

int N;
point P[310];

double dist(point A, point B){
	double dx = A.x - B.x, dy = A.y - B.y;
	return sqrt(dx*dx + dy*dy);
}

int func(void){
	int i,j,k,ans=1;
	
	REP(i,N) REP(j,N) if(i != j && dist(P[i],P[j]) < 2.0){
		double dx = (P[j].x - P[i].x) / 2.0, dy = (P[j].y - P[i].y) / 2.0;
		double d = sqrt(dx*dx + dy*dy);
		double t = sqrt(1.0 - d*d) / d;
		point O = {P[i].x + dx - t * dy, P[i].y + dy + t * dx};
		
		int tmp = 0;
		REP(k,N) if(dist(O,P[k]) < 1.00001) tmp++;
		ans = max(ans,tmp);
	}
	
	return ans;
}

int main(void){
	int i;
	
	while(1){
		cin >> N;
		if(N == 0) break;
		REP(i,N) cin >> P[i].x >> P[i].y;
		int ans = func();
		cout << ans << endl;
	}
	
	return 0;
}

Measured memory_bytes: 964
#!/bin/sh
read n
if [ $n -eq 1 ]
then
	echo 1
	exit
fi
bk=$n
c=$(( n % 2 ))
[[ $c -eq 1 ]] && n=$(( n - 1 ))
x=$(( $(( 1 + n )) * $(( n / 2 )) ))
[[ $c -eq 1 ]] && x=$(( x + bk ))
echo $x


Measured memory_bytes: 376
#include <iostream>
#include <stdlib.h>
#include <string.h>


using namespace std;


int main()
{
  char a[10000], b[10000];

  cin >> a;
  cin >> b;
  if (strlen(a) > strlen(b)){
    cout << "GREATER" << endl;
  } else if (strlen(a) < strlen(b)){
    cout << "LESS" << endl;
  } else {
    int flag = 1;
    for (int i=0; i<strlen(a); i++){
      if (a[i] > b[i]){
	cout << "GREATER" << endl;
	flag = 0;
	break;
      } else if (a[i] < b[i]){
	cout << "LESS" << endl;
	flag = 0;
	break;
      }
    }
    if (flag) cout << "EQUAL" << endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <time.h>     
using namespace std;
typedef long long int ll;
char S_c[1000000];
int main(int argc, char const *argv[]) {

  scanf("%s", S_c);
  size_t N = sizeof(S_c) / sizeof(S_c[0]);
  string S(S_c, N);
  vector<int> black_left{0};
  for (int i = 1; i < N; i++) {
    if (S[i - 1] == 'B') {
      black_left.push_back(black_left[i-1]+1);
    }else{
      black_left.push_back(black_left[i-1]);
    }
  }
  ll ans=0;
  for (int i = 1; i < N; i++) {
    if (S[i] == 'W') {
      ans+=black_left[i];
    }
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 7664
#include <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<int(a);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
using itn = int;
using namespace std;
static const long double GRATIO=(long double)(1+sqrt(5))/2;
ll GCD(ll a, ll b){
    return b ? GCD(b, a%b) : a;
}
ll LCM(ll a, ll b){
    return a/GCD(a,b)*b;
}
int main(){
    int N,M;
    cin>>N>>M;
    vector<vector<int>> Ki(N);
    rep(i,M){
        int a,b;
        cin>>a>>b;
        a--;
        b--;
        Ki[a].push_back(b);
        Ki[b].push_back(a);
    }
    bool ok=true;
    rep(i,N){
        if(Ki[i].size()%2) ok=false;
    }
    if(ok) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll f=c%b;
    ll s=a%d;
    if(f!=0)f=c/b+1;
    else f=c/b;
    if(s!=0)s=a/d+1;
    else s=a/d;
    if(f<=s)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
}
//Alhamdulilla...


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

typedef long long ll;
typedef long double ld;

#define pb push_back
#define sort(s) sort(s.begin(),s.end())
#define reverse(s) reverse(s.begin(),s.end())
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)

const ll mod = 1e9+7;

//最大公約数
ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}

//最小公倍数
ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

//桁数
int dignum(ll n) {
    int res = 0;
    while(n > 0) {
        res++;
        n /= 10;
    }
    return res;
}

//文字列中の特定の文字カウント
ll stringcount(string s,char c){
    return count(s.cbegin(),s.cend(),c);
}

//階乗
ll ka(ll i){
    ll res=1;
    while(i>0){
        res=res*i;
        i--;
    }
    return res;
}
 
//ncr
ll ncr(ll x,ll y){
    ll a = x;
    ll b = 1;
    if(y>(x/2)){
        y=x-y;
    }
    for(ll i=1;i<y;i++){
        a*=x-i;
        b*=i+1;
    }
    return a/b;
}

//フィボナッチ数列
ll f(ll x){
    ll dp[x+1];
    dp[1]=1;
    dp[2]=1;
    for(ll i=3;i<=x;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[x];
}

//char->int
int ctoi(char c){
    return c-'0';
}



int main(){
    string s;
    cin >> s;
    int a = s.find("A");
    reverse(s);
    int z = s.find("Z");
    z = s.size()-z-1;
    cout << z-a+1 << endl;
}

Measured memory_bytes: 640
N=int(input())
A=list(map(int,input().strip().split(' ')))
A=[0]+A
dp=[0]*len(A)
dp[N]=A[N]
for i in range(N-1,0,-1):
    temp=0
    for j in range(2,len(A)):
        if i*j>=len(A):
            break
        temp+=dp[j*i]
    #temp+dp[i] = A[i] mod 2
    dp[i]=(A[i]-temp)%2
ans=sum(dp[1:])
want=[]
for i in range(len(dp)):
    if dp[i]>0:
        want+=[i]

print(ans)
if ans>0:
    print(*want)

#print(dp[1:])


Measured memory_bytes: 72420
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>

using namespace std;

int p(int n, int d) {
    int x = 1;
    while (x * d <= n) {
        x *= d;
    }
    return x;
}

int f(int n) {
    if (n < 6) return n;
    int x6 = p(n, 6);
    x6 = f(n - x6) + 1;
    int x9 = p(n, 9);
    x9 = f(n - x9) + 1;
    return x6 < x9 ? x6 : x9;
}

int main(int argc, char const* argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    cout << f(N) << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String inputStr = sc.nextLine();

		String[] inputStrArray = inputStr.split(" ");
		int[] inputIntArray = new int[inputStrArray.length];

		try {
			for (int index = 0; index < inputIntArray.length; index++) {
				inputIntArray[index] = Integer.parseInt(inputStrArray[index]);
			}

			String inequality = "";
			if (inputIntArray[0] < inputIntArray[1] && inputIntArray[1] < inputIntArray[2]) {
				inequality = "Yes";
			} else {
				inequality = "No";
			}
			System.out.println(inequality);
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}

	}

}



Measured memory_bytes: 26132
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

ll gcd(ll a, ll b) {return (!b ? a : gcd(b, a % b));}
bool cmp(int a,int b){return a>b;}

const ll mod = 1e9 + 7;
const int INF32 = 1<<30;
const ll INF64 = 1LL<<60;
const ld pi = 3.141592653589793;


void solve(){
     int n;cin >> n;
     if(n>=30) cout <<"Yes";
     else cout <<"No";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    solve();
    return 0;
}


Measured memory_bytes: 3648
#2問目
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float("inf")] * N
dp[0] = 0;
for i in range(1, N):
    for j in range(max(i-K, 0), i):
        dp[i] = min(dp[i], abs(h[j] - h[i]) + dp[j])
print(dp[N-1])

Measured memory_bytes: 85616
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int cnt = 1;
		for (int i = 0;i < 10000;i++) {
			if(A == 4 || A == 2 || A == 1) {
				break;
			}
			if(A % 2 == 0) {
				A = A / 2;
				cnt = cnt + 1;
			}else {
				A = (A * 3) + 1;
				cnt = cnt + 1;
			}
			
		}
		cnt = cnt + 3;
		System.out.println(cnt);
	}
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
#define len(v) ((int)((v).size()))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define chmax(x, v) x = max((x), (v))
#define chmin(x, v) x = min((x), (v))
using namespace std;
using ll = long long;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<ll> vec(n);
	for (int i = 0; i < n; ++i) {
		cin >> vec[i];
	}
	sort(rall(vec));
	ll res = 0;
	int exc = (n+1)/2;
	for (int i = 1; i < n; ++i) {
		if (i < exc) res += vec[i-1];
		else res += vec[min(exc-1, 1+i-exc)]; 
	}

	cout << res << "\n";
}


Measured memory_bytes: 4768
#include <stdio.h>

int main() {
	int n, d, x, a[100], i, j, cnt = 0;

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

	for (i = 0; i<n; i++) {
		for (j = 1; j <= d; j += a[i]) {
			cnt++;
		}
	}

	printf("%d\n", cnt + x);

	return 0;
}

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

int main(){
	int n ;
	set<int> a ;
	for(int i=0;i<4;i++){
		cin >> n ;
		a.insert(n) ;
	}
	if(a.count(1)&&a.count(9)&&a.count(7)&&a.count(4))
		cout << "YES" << endl ;
	else
		cout << "NO" << endl ;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//関数
const long INF=1000000000000000;

int main(void){
    long N;
    cin>>N;
    vector<long> A(N);
    for(int i=0;i<N;i++) cin>>A.at(i);
    
    multiset<long> s;
    auto ite=s.begin();
    for(int i=N-1;i>=0;i--){
        ite=s.upper_bound(A.at(i));
        if(ite==s.end()) s.insert(A.at(i));
        else{
            s.erase(ite);
            s.insert(A.at(i));
        }
    }
    
    cout<<s.size()<<endl;
}



Measured memory_bytes: 5760
#include <iostream>
#include <string>
#include <vector>
using namespace std;



int main()
{
	int n,num,sum,ans;
    sum=0;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++){
		cin >> a[i];
        sum += a[i];
		if (i == 1) num = max( a[0], a[1] );
		else if (i>1) num = max( num, a[i] );
	}
	ans = sum - (num/2);
	cout << ans << endl;
}

Measured memory_bytes: 256
program main
    use,intrinsic :: iso_fortran_env
    implicit none
    real(real64):: a,b,h,m
    real(real64)x1,y1,x2,y2
    real(real64),parameter:: pi=acos(-1d0)
    read*, a,b,h,m
    h=(h+m/60)/12*2*pi
    m=m/60d0*2*pi
    

    x1 = a*cos(h)
    y1 = a*sin(h)
    x2 = b*cos(m)
    y2 = b*sin(m)
    print*, sqrt((x1-x2)**2 + (y1-y2)**2)
end program main

Measured memory_bytes: 3240
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 5e3 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string s[2];
	cin >> s[0] >> s[1];
	int n = s[0].length();
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < 2 && i < s[j].length(); j++)
		{
			putchar(s[j][i]);
		}
	}
	puts("");
	return 0;
}

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

int main(){
  char c;
  cin >> c;
  
  if ( c == 'a' || c == 'i' || c== 'u' || c == 'e' || c == 'o' ) {
      cout << "vowel" << endl;
     }
  else {
     cout << "consonant" << endl;
  }
}


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

using namespace std;

int main(){
  int N, M;
  vector<int> A;
  int a;
  cin >> N >> M;
  for(int i=0; i<M; i++){
    cin >> a;
    A.push_back(a);
  }
  long long way[101000] = {0};
  way[0] = 1;
  int nextout = 0;
  for(int w=1; w<=N; w++){
    if(nextout < M &&  w==A[nextout]) {
      nextout++;
      continue;
    }
    if(w==1) way[w] = way[w-1];
    else way[w] = way[w-1] + way[w-2];
    way[w] %= 1000000007;
  }
  cout << way[N] << endl;

  return 0;
}


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

typedef long long ll;
typedef unsigned long long llu;
#define filein freopen("input.txt", "r", stdin)
#define fileout freopen("output.txt", "w", stdout)
#define inf 1000000009
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define pii pair<int, int>

int main()
{
    string s;
    bool tf1, tf2;
    ll k, l, op = 0, cnt = 0;

    cin>>s>>k;
    l = s.size();

    s = s+s+s;

    tf1 = tf2 = false;
    for(int i = 1; i < s.size(); i++) {
        if(s[i] == s[i-1]) {
            op++;
            if(i < l) cnt++;
            if(i == l-1) tf1 = true;
            if(i == 2*l-1) tf2 = true;
            i++;
        }
    }

    if(tf1) printf("%lld\n", k*cnt);
    else if(tf2) printf("%lld\n", (k/2)*(op-cnt) + (k%2)*cnt);
    else printf("%lld\n", ((op-cnt)/2)*(k-1)+cnt);
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
using namespace std;
int main() {
    int a,b,x;
    cin>> a >> b ;
    x = (a+b)/2;
    if((a+b)%2==0){
        cout << x << endl;
    }
    else{
    cout  << x + 1 << endl;
    }
    
}

Measured memory_bytes: 3520
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n, x, t = inpm()
ans = math.ceil(n / x) * t
print(ans)


Measured memory_bytes: 68876
D = []
H = []
d = input()
while d != '-':
    D.append(d+d)
    m = int(input())
    h = 0
    for i in range(m):
        h += int(input())
    H.append(h)
    d = input()
for i in range(len(D)):
    print(D[i][(H[i] % (len(D[i])//2)):((H[i] % (len(D[i])//2))+(len(D[i])//2))])


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

using namespace std;

int main(void){
  int N;cin>>N;
  int sum = 0;
  vector<int>W(N);
  for(int i = 0; i < N ; i++){
    cin>>W[i];
    sum += W[i];
  }
  int ans = INT_MAX;
  for(int t = 0; t < N ; t++){
    int sumUpToT = 0;
    for(int i = 0; i <= t; i++){
      sumUpToT += W[i];
    }
    ans = min(ans, abs(sumUpToT*2 - sum));
  }
  cout<<ans<<endl;
}
  

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;

#define ALL(a) (a).begin(),(a).end()
#define ZP(a, len) setfill('0') << setw(len) << right << a
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};

signed main() {
    char c;
    cin >> c;
    string ans = "consonant";
    if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
        ans = "vowel";
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256