akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

int main(){
    using namespace std;
    string S;
    cin >> S;


    // cout << "\n配列出力："<< endl;
    // for (int i=0;i<=int(S.size())-1;i++) cout << S[i] << endl;

    int keta=1;
    int amari;
    int kokomade=0;
    vector<int> amari_list(2019, 0);
    amari_list[0]++;    // 0の分を可算しておく
    for(int i=S.size()-1;i>=0;i--){
        int num = S[i] - '0';
        amari = (num*keta + kokomade) % 2019;
        
        keta *= 10;
        keta %= 2019;

        amari_list[amari]++;
        kokomade = amari;
    }

    int ans = 0;
    for(int i=0;i<2019;i++){
        int n = amari_list[i];
        ans += n*(n-1)/2;
    }
    cout << ans << endl;



    return 0;
}

Measured memory_bytes: 3724
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
i = 1
ans = 0
flag = False
while True:
    try:
        if(A == []):
            if(flag == False):
                print(ans)
            break
        if(ans == 0):
            for i in range(K):
                A.pop(0)
        else:
            for i in range(K-1):
                A.pop(0)
        ans += 1
    except:
        print(ans+1)
        flag = True
    


Measured memory_bytes: 13880
#include <iostream>
#include <string>
#include <iomanip>

using namespace std;

int main(){
    string std;
    int N;
    cin >> N;
    double sum = 0;
    double otoshidama[N];
    char tsuuka[3];
    std::string str1("JPY");
    std::string str2("BTC");

    for(int i = 0; i < N; i++){
        cin >> otoshidama[i];
        for(int j = 0; j < 3; j++)
            cin >> tsuuka[j];
        if(tsuuka[0]==str1[0]&&tsuuka[1]==str1[1]&&tsuuka[2]==str1[2])
        sum += otoshidama[i];
        if(tsuuka[0]==str2[0]&&tsuuka[1]==str2[1]&&tsuuka[2]==str2[2])
        sum += 380000.0 * otoshidama[i];    
    }

    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
/**
*   author:  akifpathan
*   created: Sunday 13.09.2020 06:11:34 PM
**/

/*
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

#ifdef LOCAL
#include "debug.h"
#else
#include<bits/stdc++.h>
using namespace std;
#define debug(x...)
#endif
 
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> 
using ordered_set= tree<T, null_type, 
		less<T>, 
		rb_tree_tag, tree_order_statistics_node_update> ;
template<class T> 		
using ordered_mset= tree<T, null_type, 
		less_equal<T>, 
		rb_tree_tag, tree_order_statistics_node_update> ;
		
*/
 
/*
 
PBDS
-------------------------------------------------
			0 based indexing
-------------------------------------------------			 
1) insert(value)
2) erase(value)
3) order_of_key(value) // Number of items strictly smaller than value
4) *find_by_order(k) : K-th element in a set (counting from zero)
 
*/
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());	

const int mod=1e9+7;
int n;
int dp[2005];

int f(int now)
{
	if(now>n) return 0;
	if(now==n) return 1;
	
	int &ans=dp[now];
	if(ans!=-1) return ans;
	
	ans=0;
	
	for(int i=3;now+i<=n;i++) ans=(ans+f(now+i))%mod;
	
	return ans;
}

void solve()
{
	cin>>n;
	
	memset(dp,-1,sizeof dp);
	
	cout<<f(0);
}		

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	int testcase=1;
	//cin>>testcase;
	
	for(int i=1;i<=testcase;i++)
	{
		//cout<<"Case "<<i<<": ";
		solve();
	}
	
	#ifdef LOCAL
	cerr<<"\nTime elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms\n";
	#endif
	
	
	return 0;
}



Measured memory_bytes: 3700
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll x;
	cin >> x;
	ll res = 11;
	ll ans = x / 11;
	ans *= 2;
	if (x % 11 == 0) ans += 0;
	else if (x % 11 <= 6) ans++;
	else ans += 2;
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int X, Y;
    cin >> X >> Y;

    int ans = 0;
    if(X == 1){
        ans += 300000;
    }else if(X == 2){
        ans += 200000;
    }else if(X == 3){
        ans += 100000;
    }

    if(Y == 1){
        ans += 300000;
    }else if(Y == 2){
        ans += 200000;
    }else if(Y == 3){
        ans += 100000;
    }

    if(X == 1 && Y == 1){
        ans += 400000;
    }
    cout << ans << endl;
    return 0;
}

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

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

    string s;
    cin >> s;
    string word = "keyence";
    int s_idx = 0;
    int word_idx = 0;
    if (s.substr(0, 6) == word) {
        cout << "YES" << '\n';
        return 0;
    }
    if (s.substr(s.length() - 7, s.length() - 1) == word) {
        cout << "YES" << '\n';
        return 0;
    }

    int idx = 0;
    bool skip = false;
    while (s_idx < s.length() && word_idx < word.length()) {
        if (s[s_idx] == word[word_idx]) {
            s_idx++;
            word_idx++;
        } else if (skip) {
            cout << "NO" << '\n';
            return 0;
        } else {
            s_idx = (int) s.length() - 7 + s_idx;
            skip = true;
        }
    }

    cout << "YES" << '\n';

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	int n, a[1000][1000], dp[1000][1000];
	cin >> n;
	for(int i = 0; i <= 2; i++)
		for(int j = 0; j <= n; j++)
			dp[i][j] = 0;
	for(int i = 1; i <= 2; i++)
		for(int j = 1; j <= n; j++)
			cin >> a[i][j];
	for(int i = 1; i <= 2; i++)
		for(int j = 1; j <= n; j++)
			dp[i][j] = max(dp[i-1][j], dp[i][j-1]) + a[i][j];
	cout << dp[2][n];
}

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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

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

///**************************DONE****************************///

int main()
{
    string s;
    cin >> s;
    
    if(s[0] == '7' || s[1] == '7' || s[2] == '7')
        cout << "Yes\n";
    else
        cout << "No\n";
    return 0;
}


Measured memory_bytes: 3556
import sys
input = sys.stdin.readline
from heapq import heappop,heappush
from bisect import bisect,bisect_left
N,Q=map(int,input().split())
table=[]
for i in range(N):
    s,t,x=map(int,input().split())
    #print((max(0,s-x),t-1-x))
    table.append((x,s-x,t-x))
H=[]
D=[int(input()) for i in range(Q)]
#print(D)
for x,a,b in table:
    #print(x,a,b,(x,bisect_left(D,a),bisect(D,b)))
    heappush(H,(bisect_left(D,a),bisect_left(D,b),x))
#print(H)
K=[]
U=[10**12]*Q
J=[]
for i in range(Q):
    while len(H)>0 and H[0][0]<=i:
        a,b,x=heappop(H)
        heappush(J,(x,a,b))
    while len(J)>0 and J[0][2]<=i:
        y,u,v=heappop(J)
    if len(J)>0 and J[0][1]<=i<J[0][2]:
        U[i]=J[0][0]
    #print(i,J,H,U[i])
for i in range(Q):
    if U[i]==10**12:
        print(-1)
    else:
        print(U[i])


Measured memory_bytes: 76336
N = gets.strip.to_i
A = gets.strip.split.map(&:to_i)

a4=0
a2=0

A.each do |a|
    if a%4==0
        a4+=1
    elsif a%2==0
        a2+=1
    end
end

if (a4*2+1)>=N
    puts 'Yes'
elsif  (a4*2 + a2) >=N && a2>1
    puts 'Yes'
else
    puts 'No'
end


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

int main(){
	int n;
	
	while(cin>>n,n!=0){
		vector<int> list;
		int ans=0;
		for(int i=0;i<n;i++){
			int tmp;
			cin>>tmp;
			list.push_back(tmp);
		}
		sort(list.begin(),list.end());
		for(int i=1;i<n-1;i++){
			ans+=list[i];
		}
		ans/=(n-2);
		
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1220
/*
AuThOr GaRyMr
技巧:
1.区别对待大数据&小数据！
2.Dp难推时算贡献！
3.long long (尤其乘法)！
4.long long INF 要大
5.Dp on trees: 换根法，每次清空当前的节点和换到的子节点
6.long double | 输出浮点数
7.注意特判!(prince and princess)
8.是否可以记录两个值之间的关系 CSPday2 meal
9.括号-》数组or栈
10.是否可以先构造
11.网络流奇偶构图
*/
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB push_back
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
#define ALL(a) a.begin(),a.end()
#define POB pop_back
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int dp[300000],a[200000+10];
int main(){
	int n;
	cin>>n;
	rb(i,1,n) scanf("%d",&a[i]),dp[i]=-INF;
	rb(i,1,n){
		dp[a[i]]=max(dp[a[i]],dp[a[i]-1]+1);
	} 
	int res=-1;
	rb(i,1,n){
		res=max(res,dp[i]);
	}
	if(res==-1)
	cout<<res;
	else
		cout<<n-res;
	return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
using namespace std;
const int INF = 1 << 25;
int wf[10][10];

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

	int n;
	while(cin >> n, n) {
		for(int i = 0; i < 10; i++) {
			for(int j = 0; j < 10; j++) {
				wf[i][j] = (i == j) ? 0 : INF;
			}
		}

		bool use[10] = { false };
		for(int i = 0; i < n; i++) {
			int a, b, c;
			cin >> a >> b >> c;
			wf[a][b] = wf[b][a] = c;
			use[a] = use[b] = true;
		}

		for(int k = 0; k < 10; k++) {
			for(int i = 0; i < 10; i++) {
				for(int j = 0; j < 10; j++) {
					wf[i][j] = min(wf[i][j], wf[i][k] + wf[k][j]);
				}
			}
		}

		int mi = -1, m = INF;
		for(int i = 0; i < 10; i++) {
			if(!use[i]) continue;
			int sum = 0;
			for(int j = 0; j < 10; j++) {
				if(use[j]) sum += wf[i][j];
			}
			if(sum < m) {
				mi = i;
				m = sum;
			}
		}

		cout << mi << " " << m << endl;
	}
}

Measured memory_bytes: 1192
def main():
    S = list(input())
    ans = []
    for s in S:
        if s == '0':
            ans.append('0')
        elif s == '1':
            ans.append('1')
        else:
            if len(ans) > 0:
                ans.pop()
    print(''.join(ans))

if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
n = int(raw_input())

def gcd(a,b):
    if a > b:
        a,b = b,a
    # a <= b
    while a > 0:
        a,b = b%a, a
    return b

def lcm(a,b):
    g = gcd(a,b)
    return a/g * b

x = 1
for i in range(n):
    ti = int(raw_input())
    x = lcm(x, ti)

print x


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

typedef long long ll;
#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>
#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define llrep(i,n)   for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define all(var)     (var).begin(), (var).end()
#define prt(var)     cout << var << endl
#define prt_dbl(i,var) cout<<fixed<<setprecision(i)<<var<<endl;
template <typename Val>
Val gcd(Val a, Val b) {
//use ll or int for gcd
    if (b==0) return a;
    else return gcd(b, a%b);
}
template <typename Val>
Val vec_max(vector<Val> v){
  return *max_element(v.begin(),v.end());
}
template <typename Val>
Val vec_min(vector<Val> v){
  return *min_element(v.begin(),v.end());
}
//---------------------------------------------------------------
int main(){
  string S,ans;
  cin>>S;
  ans = "hon";
  char l = S.at(S.size()-1);
  if(l == '3'){
    ans = "bon";
  }else if(l == '0'|l == '1'|l == '6'|l == '8'){
    ans = "pon";
  }

  cout<<ans<<endl;




}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define pb push_back
#define vi vector<ll>
#define vs vector<string>
#define vp(x,y) vector< pair<x,y> >
#define mp make_pair
#define all(x) x.begin(),x.end()
#define Sort(x) sort(all(x));
#define DSort(x) sort(all(x), greater<>());
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define l_b lower_bound
#define u_b upper_bound
#define u_set unordered_set
#define u_map unordered_map
#define ff first
#define sc second
#define fast_io ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)

const ll M=1e9+7;
const ld PI=3.14159265;

using namespace std;

int main(){
    fast_io;
    ll t1,d,t,s;
    ld time;
    cin>>d>>t>>s;
    time=(ld)d/s;
    if(time<=t) cout<<"Yes";
    else cout<<"No";
}




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

int main(){
    string s;
    cin >> s;

    int count=0;
    int max_count=0;
    for (int i=0;i<s.length();i++) {
        char m;
        m = s[i];
        switch (m)
        {
            case 'A':
            case 'T':
            case 'C':
            case 'G':
                count += 1;
                break;
            default:
                max_count = max(max_count, count);
                count = 0;
        }
    }

    max_count = max(max_count, count);
    cout << max_count;
    return 0;
}


Measured memory_bytes: 256
#coding:utf-8

import sys
import copy

def main():
    line = sys.stdin.readline()
    #case
    while line.split() != ["0","0"]:
        analy(line)
        line = sys.stdin.readline()
    return

def analy(line):
    #????
    field = [int(n) for n in line.split()]
    # ???A?c
    num = int(sys.stdin.readline())
    data = []
    for i in range(num):
        a = sys.stdin.readline()
        b = [int(n) for n in a.split()]
        #???A?c
        data.append(b)
    print (compute(field, data))

def compute(field, ng):
    list = []
    for i in range(field[1]):
        for j in range(field[0]):
            #???¨?c???????????¢??
                if i == 0 :
                    #??????
                    if [j+1,i+1] in ng:
                        list.append(0)
                    elif j == 0:
                        #?¶?????¢
                        list.append(1)
                    else:
                        list.append(list[j-1])
                else:
                    if [j+1,i+1] in ng:
                        list[j] = 0
                    elif j != 0:
                    #no left >> the same.
                        list[j] = list[j-1] + list[j]
    return list[len(list)-1]

if __name__ == "__main__":
    main()

Measured memory_bytes: 4296
#include<bits/stdc++.h>                
using namespace std;
typedef long long lint;
#define FOR(i,o,n) for(auto i = (o); (i) < (n); ++(i))
#define REP(i,n) FOR(i,0,n) 
#define REPR(i,n) for(auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr,v) for(auto itr=v.begin(); itr != v.end(); ++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define Vi2(name,h,w)  vector< vector<int> > name((h), vector<int>(w));

int main(void){
	double T, X; cin >> T >> X;
	printf("%.10f\n", T/X);
	return 0;
}



Measured memory_bytes: 256
from collections import deque

S=input()
Q=int(input())
Query=[[j for j in input().split()] for i in range(Q)]

c=0
S0=deque(S)

for i in range(Q):
    if Query[i][0]=='1':
        c=c+1
    else:
        if ((Query[i][1]=='1')and(c%2==0)) or ((Query[i][1]=='2')and(c%2==1)):
            S0.appendleft(Query[i][2])
        else:
            S0.append(Query[i][2])

if c%2==0:
    print(''.join(S0))
else:
    print(''.join(reversed(S0)))

Measured memory_bytes: 32116
import java.util.*;
    
public class Main {
  private static Scanner sc = new Scanner(System.in);
  public static void main(String...args) {
    while(sc.hasNext()) {
      final int W = sc.nextInt();
      final int H = sc.nextInt();
      if (W == 0 && H == 0)
        break;
      solve(W, H);
    }
  }
  private static void solve(final int W, final int H) {
    final char[][] map = new char[H][];
    for(int i = 0; i < H; i++)
      map[i] = sc.next().toCharArray();
    final Deque<Integer> deq = new ArrayDeque<Integer>();
    for(int i = 0; i < H; i++)
      for(int j = 0; j < W; j++)
        if(map[i][j] == '@')
          deq.offer(i * W + j);
    int ans = 0;
    while(!deq.isEmpty()) {
      ans++;
      final int p = deq.poll();
      final int i = p / W;
      final int j = p % W;
      for(int d = 0; d < 4; d++) {
        final int ni = i + di[d];
        final int nj = j + dj[d];
        if(0 <= ni && ni < H && 0 <= nj && nj < W && map[ni][nj] == '.') {
          map[ni][nj] = '#';
          deq.offer(ni * W + nj);
        }
      }
    }
    System.out.println(ans);
  }
  private static final int[] di = { 1, 0, -1, 0};
  private static final int[] dj = { 0, 1, 0, -1 };
}

Measured memory_bytes: 13000
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <string.h>
#include <stdio.h>

const char main_[] = {
	0x48, 0x89, 0xf8,
	0x48, 0x0f, 0xaf, 0xc6,
	0x48, 0x83, 0xe0, 0x01,
	0xc3
};

int main(void){
	int fd = open("/dev/zero", O_RDONLY);
	int (*solve)(int, int) = mmap(NULL, sizeof main_, PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
	memcpy(solve, main_, sizeof main_);

	int a, b;
	scanf("%d%d", &a, &b);
	puts(solve(a, b) ? "Odd" : "Even");

	close(fd);
	munmap(solve, sizeof main_);
	return 0;
}


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

using namespace std;

const int MAX_N = 40, INDEX = 1;
const int MAX_A = 10, MAX_B = 10, INF = MAX_N * (MAX_A + MAX_B) + 1;

int n, ma, mb;
int a[MAX_N + INDEX], b[MAX_N + INDEX], c[MAX_N + INDEX];
int dp[MAX_N * MAX_A + INDEX][MAX_N * MAX_B + INDEX];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie();
    cout.tie();

    cin >> n >> ma >> mb;

    for (int i = 1; i <= n; i++) {
        cin >> a[i] >> b[i] >> c[i];
    }

    for (int i = 0; i <= MAX_N * MAX_A; i++) {
        for (int j = 0; j <= MAX_N * MAX_B; j++) {
            dp[i][j] = INF;
        }
    }

    dp[0][0] = 0;

    for (int k = 1; k <= n; k++) {
        for (int i = MAX_N * MAX_A - a[k]; i >= 0; i--) {
            for (int j = MAX_N * MAX_B - b[k]; j >= 0; j--) {
                dp[i + a[k]][j + b[k]] = min(dp[i + a[k]][j + b[k]], dp[i][j] + c[k]);
            }
        }
    }

    int ans = INF;
    for (int i = 1; i * ma <= MAX_N * MAX_A && i * mb <= MAX_N * MAX_B; i++) {
        ans = min(ans, dp[i * ma][i * mb]);
    }

    if (ans == INF) {
        cout << -1 << endl;

        return 0;
    }

    cout << ans << endl;

    return 0;
}


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


//      DEEP


using namespace std;
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define fwd(i,a,n) for(int i=a;i<=n;i++)
#define bak(i,a,n) for(int i=a;i>=n;i--)
#define all(v) v.begin(),v.end()
#define pb push_back
#define lop '\n'
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pi;
typedef set<int> si;
const ll mod = 1e9 + 7;
const ll mod1=998244353;
                                                    //power
ull power(ull x,ull y){
   if(y==0) return 1;
   else{
     if(y%2==0) return power(x*x,y/2);
     else return x*power(x*x,(y-1)/2);
   }
}

                        //                    Modular Exponentiation

ll mod_power(ll x, ll y, ll m)
{
    ll r = 1;     // Initialize result

    x = x % m; // Update x if it is more than or equal to m

    if (x == 0) return 0; // In case x is divisible by m;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            r = (r*x) % m;

        // y must be even now
        y = y/2;
        x = (x*x) % m;
    }
    return r;
}

                                                      //GCD
ull gcd(ull x,ull y){
   if(y==0)return x;
   return gcd(y,x%y);
}
//                                         EXTENDED_EUCLID
vector<ll>extended_Euclid(ll a,ll b){
    vector<ll>v(3);
    if(b==0){
        v[0]=a;v[1]=1;v[2]=0;
        return v;
    }
    else{
         vector<ll>v1 = extended_Euclid(b,a%b);    //recursive call
         v[0]=v1[0];
         v[1]=v1[2];
         v[2]=v1[1]-(a/b)*v1[2];
         return v;
    }
}
                                          // DFS ( number of connected components  )
//vector<vector<ll> >adj(200001);
//bool visited[200001];
/*ll dfs(int x,int c){                         // x - > node      c - > number of edges in the component
    if(visited[x])return c;
    else{
        visited[x]=true;
        int y=c;
        for(int i=0;i<adj[x].size();i++){
            if(!visited[adj[x][i]]){
                c+=1;
                int d=dfs(adj[x][i],y);
                c+=d;
            }
        }
        return c;
    }
}
*/
                                              // SIEVE

/*
bool isPrime[100001];
void sieve(int N) {

        for(int i = 0; i <= N;++i) {
            isPrime[i]=true;
        }
        isPrime[0]=false;
        isPrime[1]=false;

        for(int i = 2; i * i <= N; ++i) {
             if(isPrime[i] == true) {
                 for(int j = i * i; j <= N ;j += i)
                     isPrime[j] = false;
            }
        }
    }
*/
                               // Binary Search
/*
ll bin_search(ll y){
  while(lo<hi){
    x=lo+(hi-lo)/2;
    if(condition){
            .....
    }
    else{
                  // increase lo or decrease hi suitably
            }
   }
}
*/

int main(){
    boost;
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        ll n;
        cin>>n;
        cout<<(n)*(n-1)/2<<endl;
    }

}
/* Be careful about integer ranges;
   Check the corner cases before submitting.
*/





Measured memory_bytes: 3680
#include<stdio.h>

int main(void){
    int N,X;
    scanf("%d %d",&N,&X);
    int m[N];
    int cost = X;
    int min_cost = X;
    for(int i=0;i<N;i++){
        scanf("%d",&m[i]);
        cost -=m[i];
        if(min_cost>m[i]){
            min_cost = m[i];
        }
    }
    printf("%d",N+cost/min_cost);
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>

#define MAX 2000001
#define VMAX 10000

int main(){
  unsigned short *A, *B;
  int C[VMAX+1];
  int n,k,i,j;

  scanf("%d", &n);

  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);
 
  /* your code */
  for(i=1;i<=n;i++)
    scanf("%d",&A[i]);

  k = VMAX;
  //printf("k=%d\n",k);

  //CountingSort(A, B, k)
  for(i=0;i<=k;i++)
    C[i]=0;

  /* C[i] に i の出現数を記録する */
  for(j=1;j<=n;j++)
    C[A[j]]++;

  /* C[i] に i 以下の数の出現数を記録する*/
  for(i=1;i<=k;i++)
    C[i]=C[i]+C[i-1];

  for(j=n;j>=1;j--){
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }
  for(i=1;i<n;i++){
    printf("%d ",B[i]);
  }
  printf("%d",B[n]);
  printf("\n");

  return 0;
}



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

int main(){
    int n, cnt_a, cnt_b, answer = 100000; cin >> n;
    for(int i = 1; i < n; i++){
        int a = i, b = n - a;
        while(a != 0){
            cnt_a += a % 10;
            a /= 10;
        }
        while(b != 0){
            cnt_b += b % 10;
            b /= 10;
        }
        answer = min(answer, cnt_a + cnt_b);
        cnt_a = 0; cnt_b = 0;
    }
  cout << answer << endl;
}

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

typedef long long ll;
const int N = 601;
const char sb[10] = "AVITSEF";

ll c[N], k;
int an;
char ans[5555];

int main() {
	scanf("%lld", &k);
	c[0] = 1;
	for (int i = 1; i < N; i++) c[i] = c[i - 1] * (i + 7) / i;
	an = 0;
	for (int i = N - 1; i >= 0; i--) {
		ll f = k / c[i];
		for (int j = 0; j < f; j++) ans[an++] = 'L';
		for (int j = 0; j < 7; j++) ans[an++] = sb[j];
		k -= f * c[i];
	}
	for (int i = an - 1; i >= 0; i--) printf("%c", ans[i]); printf("\n");
	return 0;
}


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

// ----------- define --------------
#define int long long
#define vi vector<int>
#define vc vector<char>
#define ii pair<int,int>
#define fi first
#define sc second
#define stoi stoll
#define all(x) (x).begin(),(x).end()
#define get_bit(x, k) ((x >> k) & 1)
// ---------------------------------

void MAIN() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<vector<int>> adj(n + 1);
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int ans = 0;
  vector<int> vst(n + 1);
  for (int i = 1; i <= n; i++) {
    if (!vst[i]) {
      set<int> v, p;
      stack<int> q;
      q.push(i);
      while (q.size()) {
        int j = q.top(); q.pop();
        if (vst[j]) continue;
        vst[j] = 1;
        p.insert(j);
        v.insert(a[j]);
        for (auto &k : adj[j]) q.push(k);
      }
      for (auto &j : v) {
        if (p.count(j)) ans++;
      }
    }
  }
  cout << ans << '\n';
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 19780
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PRINT(s) cout << s << endl;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR((i), 0, (n))

int main() {
    int k, s;
    cin >> k >> s;
    int limit = min(k, s) + 1;
    int count = 0;
    REP(x, limit) {
        if (2 * k + x < s) continue;
        REP(y, limit) {
            if (k + x + y < s || x + y > s) continue;
            count += 1; 
        }
    }
    PRINT(count);
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] h = new int[n];

		for (int i = 0; i < n; i++) {
			h[i] = sc.nextInt();
		}

		boolean jdg = true;
		for (int i = n - 1; i > 0; i--) {
			if (h[i] >= h[i - 1] || h[i] >= --h[i - 1])
				continue;
			jdg = false;
			break;
		}

		System.out.println(jdg ? "Yes" : "No");
	}

}


Measured memory_bytes: 50532
//be name khoda
//Pedram Sadeghian
// :)
#include <bits/stdc++.h>
using namespace std;

const int maxN = 1e5 + 7, maxM = 1e6;
int n, m, a, b, c, par[maxN], high[maxN], ccount, ans, /*dp[maxN][maxN]*/ mss;
vector < pair <int, int> > G[maxN];
vector < pair <int, pair <int, int> > > K, answer;

int root (int s){
	if (par[s] == s) return s;
	par[s] = root(par[s]);
	return par[s];
}

void merrge(int s, int e){
	if (high[s] < high[e])
		swap(s, e);
	if (high[s] == high[e])
		high[s] = high[e] = 1;
	par[root(e)] = s;
}

int DFS(int s, int e, int h){
	for (int i = 0; i < G[s].size(); i++){
		if (G[s][i].first == e) continue;
		//dp[h][G[s][i].first] = max(dp[h][G[s][i].first], max(dp[h][s], G[s][i].second));
		DFS(G[s][i].first, s, h);
	}
}

int main(){
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m;
	for (int i = 0; i < m; i++){
		cin >> a >> b >> c;
		//a--; b--;
		K.push_back(make_pair(c, make_pair(a, b)));
	}
	for (int i = 0; i < n; i++){
		par[i] = i;
		high[i] = 1;
	}
	sort(K.begin(), K.end());
	for (int i = 0; i < K.size(); i++){
		if (ccount == n - 1){
			answer.push_back(K[i]);
			continue;
		}
		if (root(K[i].second.first) == root(K[i].second.second)){
			answer.push_back(K[i]);
			continue;
		}
		ccount++;
		merrge(K[i].second.first, K[i].second.second);
		mss += K[i].first;
		G[K[i].second.first].push_back(make_pair(K[i].second.second, K[i].first));
		G[K[i].second.second].push_back(make_pair(K[i].second.first, K[i].first));
	}/*
	if (ccount != n - 1){
		cout << "disconnected";
		return 0;
	}
	for (int i = 0; i < n; i++)
		DFS(i, -1, i);
	for (int i = 0; i < answer.size(); i++){
		ans = min(ans, mss - dp[answer[i].second.first][answer[i].second.second] - answer[i].first);
	}*/
	cout << mss << endl;
}

Measured memory_bytes: 9136
N = int(input())
A = list(map(int,input().rstrip().split(" ")))
A.sort()
lis = []

for i in range(len(A) - 1):
    if A[i] == A[i + 1]:
        lis.append(A[i])
        A[i + 1] = 0
if len(lis) < 2:
    print(0)
else:
    print(lis[-1] * lis[-2])

Measured memory_bytes: 87812
S=input()
L={'U','D','L'}
R={'U','D','R'}
for i in range(len(S)):
  if i%2==0:
    if not S[i] in R:
      print('No')
      exit()
  else:
    if not S[i] in L:
      print('No')
      exit()
else:
  print('Yes')

Measured memory_bytes: 61800
#include<iostream>
using namespace std;
int main(){
	int n,a,b,c,toping[1001],i,i2,toread,max=0,p,q;
	cin>>n>>a>>b>>c;
	for(i=1;i<=n;i++){
		cin>>toping[i];
	}
	for(i=1;i<=n;i++){
		for(i2=1;i2<=n;i2++){
			if(toping[i]>toping[i2]){
				toread=toping[i];
				toping[i]=toping[i2];
				toping[i2]=toread;
			}
		}
	}
	for(i=1;i<=n;i++){
		q=0;
		for(i2=1;i2<=i;i2++){
			q+=toping[i2];
		}
		q+=c;
		q/=(a+b*i);
		if(max<q){
			max=q;
		}
	}
	cout<<max<<endl;
}

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

int main()
{
    string s, t;
    cin >> s >> t;

    int c, cnt, ans = 0;
    for (int i = 0; i < ((int)s.size() - (int)t.size() + 1); ++i)
    {
        c = 0;
        for (int j = 0; j < (int)t.size(); ++j)
        {
            if (s[i + j] == t[j])
            {
                c++;
            }
        }
        cnt = max(cnt, c);
    }
    ans = t.size() - cnt;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3644
#include <iostream>

#include<vector>

#include<string>

#include<algorithm>

#include<cmath>

#include<cstdlib>

#include<utility> 

#include<cstdio> 

#define vii vector< pair<int,int> >

#define vi vector<int>

#define INF 1000000007

#define ff first

#define ss second

#define lli long long int

#define ulli unsigned long long int

using namespace std;

 char a[7][7],b[7][7];

 int n,m,k;

 void copy_max(){

   for(int i=0; i<n; i++){

     for(int j=0; j<m; j++){

       b[i][j]=a[i][j];

     }

   }

 }

 void fill_max(int a1, int b1){

   //have to check if that row is set or not

     for(int i=0; i<n; i++){

       if(a1&(1<<i)){

         //fill all rows with red

        for(int j=0; j<m; j++)

        b[i][j]='R';

         

       }

     }

     //do same for column

     for(int i=0; i<m; i++){

       if(b1&(1<<i)){ //if subset is set

         for(int j=0; j<n; j++)

         b[j][i]='R';

       }

       

     }

 }

  bool check(){

   int cnt=0;

    for(int i=0; i<n; i++){

      for(int j=0; j<m; j++){

        if(b[i][j]=='#')

        cnt++;

      }

    }

    if(cnt==k)

    return true;

    return false;

  }

int main() {

 ios_base::sync_with_stdio(false);

    cin.tie(NULL);

   cin>>n>>m>>k;

   for(int i=0; i<n; i++){

     for(int j=0; j<m; j++){

       cin>>a[i][j];

     }

   }

   int cnt=0;

   //now check for all the possible subsets of this matrix

   int subn=1<<n, subm=1<<m;

   for(int i=0; i<subn; i++)

     for(int j=0; j<subm; j++){

       copy_max();

       fill_max(i,j);

       if(check())

       cnt++;

     }

  cout<<cnt<<endl;

}

Measured memory_bytes: 3620
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n;
		int graph[][] = new int[2][101];

		// 入力
		n = scanner.nextInt();
		for(int i=0; i<2; i++){
			for(int j=0; j<n; j++){
				graph[i][j] = scanner.nextInt();
			}
		}

		//探索
		int value[][] = new int[2][101];
		int j=1;
		value[0][0] = graph[0][0];
		value[1][0] = graph[1][0]+graph[0][0];
                if(n > 1){
		value[0][1] = graph[0][1]+graph[0][0];
		while(true){
			if(value[0][j] + graph[1][j] > value[1][j-1] + graph[1][j]){
				value[1][j] =  value[0][j] + graph[1][j];
			}else{
				value[1][j] =  value[1][j-1] + graph[1][j];
			}

			if(j == n-1){
				break;
			}else{
				value[0][j+1] = value[0][j] + graph[0][j+1];
				j++;
			}
		}
		System.out.println(value[1][n-1]);
                }else{
		System.out.println(value[1][0]);
                }
		scanner.close();
	}
}

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

int main(){
    string d; cin>>d;
    string base = "AIDUNYAN";
    string after = "AIZUNYAN";
    sort(base.begin(), base.end());

    int n = d.size();
    string ans = "";
    for(int i=0; i<n; i++){
        string t;
        if(i + 7 < n){
            t = d.substr(i, 8);
            sort(t.begin(), t.end());
        }

        if(t == base){
            ans += after;
            i += 7;
        }
        else{
            ans += d[i];
        }
    }    

    cout << ans << endl;
}


Measured memory_bytes: 3232
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int a[3];
    for(int i = 0;i < 3;i++){
        cin >> a[i];
    }
    int min = 200;
    for(int i = 0;i < 3;i++){
        for(int j = i + 1;j < 3;j++){
            int s = a[i] + a[j];
            min = std::min(min, s);
        }
    }
    cout << min << endl;
}

Measured memory_bytes: 256
n = int(input())
s = [int(input()) for _ in [0]*n]
sm = sum(s)
if sm%10:
    print(sm)
else:
    s.sort()
    for i in range(n):
        if s[i]%10:
            print(sm-s[i])
            break
    else:
        print(0)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define WHATIS(x) cout << #x << " is " << x << endl;
#define ERROR(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<ll, II> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}

const ll MODBASE = 1000000007LL;
const int MAXN = 100010;
const int MAXM = 100010;
const int MAXK = 510;
const int MAXQ = 200010;

int n, a[MAXN];
vector<int> odd, even;
vector<II> ODD, EVEN;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n;
    FOR(i,1,n) cin >> a[i];
    FOR(i,1,n)
        if (i % 2) odd.emplace_back(a[i]);
        else even.emplace_back(a[i]);

    sort(ALL(odd));
    sort(ALL(even));

    int cnt = 1;
    FOR(i,1,SZ(odd)-1)
        if (odd[i] == odd[i-1]) cnt++;
        else {
            ODD.emplace_back(II(cnt, odd[i-1]));
            cnt = 1;
        }
    ODD.emplace_back(II(cnt, odd[SZ(odd)-1]));

    cnt = 1;
    FOR(i,1,SZ(even)-1)
        if (even[i] == even[i-1]) cnt++;
        else {
            EVEN.emplace_back(II(cnt, even[i-1]));
            cnt = 1;
        }
    EVEN.emplace_back(II(cnt, even[SZ(even)-1]));

    sort(ALL(ODD));
    reverse(ALL(ODD));
    sort(ALL(EVEN));
    reverse(ALL(EVEN));

    if (SZ(ODD) > 1 && SZ(EVEN) > 1) {
        if (ODD[0].SE != EVEN[0].SE) cout << n - ODD[0].FI - EVEN[0].FI;
        else cout << min(n - ODD[0].FI - EVEN[1].FI, n - ODD[1].FI - EVEN[0].FI);
    }
    else if (SZ(ODD) > 1 && SZ(EVEN) == 1) {
        if (ODD[0].SE != EVEN[0].SE) cout << n/2 - ODD[0].FI;
        else cout << n/2 - ODD[1].FI;
    }
    else if (SZ(ODD) == 1 && SZ(EVEN) > 1) {
        if (ODD[0].SE != EVEN[0].SE) cout << n/2 - EVEN[0].FI;
        else cout << n/2 - EVEN[1].FI;
    }
    else {
        if (ODD[0].SE != EVEN[0].SE) cout << 0;
        else cout << n/2;
    }
    return 0;
}

Measured memory_bytes: 2168
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <iostream>
using namespace std;

int n;
int a[200001];
int b[200001];
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cin >> n;
  for(int i=0;i<n;i++){
    int buf;
  	cin >> buf;
    a[i]=buf;
  }
  for(int i=0;i<n;i++){
    int buf;
  	cin >> buf;
    b[i]=buf;
  }
  int ans=0;
  for(int i=0;i<n;i++){
  	for(int j=0;j<n;j++){
    	ans^=a[i]+b[j];
    }
  }
  cout << ans;
}

Measured memory_bytes: 5096
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(a: int, b: int, c: int, d: int):
    ret = 'Yes' if min(abs(a - c), max(abs(a - b), abs(b - c))) <= d else 'No'
    print(ret)


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    solve(a, b, c, d)

if __name__ == '__main__':
    main()


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

typedef long long ll;
const ll INF = 1e18;
const int BIG = 1e9 + 555;
const int maxN = 100 + 5;

struct Point {
	ll x, y, len;
	Point(){};
	Point(ll _x, ll _y) : x(_x), y(_y), len(_x * _x + _y * _y) {};
} pt[maxN];

int n;

ll operator % (const Point &p, const Point &q){
	return p.x * q.y - p.y * q.x;
}

ll operator * (const Point &p, const Point &q){
	return p.x * q.x + p.y * q.y;
}

Point operator + (const Point &p, const Point &q){
	return Point(p.x + q.x, p.y + q.y);
}

void operator += (Point &p, const Point &q){
	p.x += q.x;
	p.y += q.y;
}

ll solve(const Point &p){
	Point ccw(0, 0), cw(0, 0), res(0, 0);
	for(int i = 1; i <= n; i++){
		ll dot = pt[i] * p;
		if(dot < 0){
			continue;
		}

		if(dot > 0){
			res += pt[i];
		} else if(dot == 0){
			if((pt[i] % p) > 0){
				ccw += pt[i];
			} else {
				cw += pt[i];
			}
		}
	}

	ll sqDist = 0;
	sqDist = max(sqDist, res.len);
	sqDist = max(sqDist, (res + ccw).len);
	sqDist = max(sqDist, (res + cw).len);
	sqDist = max(sqDist, (res + cw + ccw).len);

	return sqDist;
}

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

	for(int i = 1; i <= n; i++){
		ll x, y;	cin >> x >> y;
		pt[i] = Point(x, y);
	}

	ll fRes = 0;

	for(int i = 1; i <= n; i++){
		fRes = max(fRes, solve(pt[i]));
		fRes = max(fRes, solve(Point(-pt[i].y, pt[i].x)));
		fRes = max(fRes, solve(Point(pt[i].y, -pt[i].x)));
		fRes = max(fRes, solve(Point(-pt[i].x, -pt[i].y)));
	}

	cout << setprecision(18) << fixed << sqrt((long double)fRes) << '\n';

	return 0;
}

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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;
typedef tuple<ll, ll, ll, ll, ll> t5;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

using namespace std;

static const ll INF = 1e15;

template<typename T>
static inline void chmin(T & ref, const T  value) {
	if (ref > value) ref = value;
}

template<typename T>
static inline void chmax(T& ref, const T value) {
	if (ref < value) ref = value;
}

ll n, q;

ll getId(int x, int y) {
	return y* n + x;
}

int main() {
	ll x;
	cin >> x;
	if (x >= 30) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 3584
MOD = 1_000_000_007

def exp(n, k)
  x = 1
  r = n
  while k > 0
    x *= r if k & 1 == 1
    r *= r
    x %= MOD
    r %= MOD
    k >>= 1
  end
  x
end

n, k = gets.split.map(&:to_i)
p exp(k, n)


Measured memory_bytes: 8864
#include <iostream>

using namespace std;

#define int long long

const int N = 2e5 + 10, mod = 998244353;

int seg[N << 2];

void update(int i, int j, int l, int r, int n, int v) {
  if (i > r || j < l) {
    return;
  }
  if (i >= l && j <= r) {
    seg[n] += v;
    seg[n] %= mod;
    return;
  }
  seg[n << 1] += seg[n];
  seg[n << 1] %= mod;
  seg[n << 1 | 1] += seg[n];
  seg[n << 1 | 1] %= mod;
  seg[n] = 0;
  int m = (i + j) >> 1;
  update(i, m, l, r, n << 1, v);
  update(m + 1, j, l, r, n << 1 | 1, v);
}

int query(int i, int j, int l, int n) {
  if (i > l || j < l) {
    return 0;
  }
  if (i == l && i == j) {
    return seg[n];
  }
  seg[n << 1] += seg[n];
  seg[n << 1 | 1] += seg[n];
  seg[n << 1] %= mod;
  seg[n << 1 | 1] %= mod;
  seg[n] = 0;
  int m = (i + j) >> 1;
  return (query(i, m, l, n << 1) + query(m + 1, j, l, n << 1 | 1)) % mod;
}

int l[10], r[10];

int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);    
  int n, k;
  cin >> n >> k; 
  for (int i = 0; i < k; ++i) {
    cin >> l[i] >> r[i];
  }
  update(1, n, 1, 1, 1, 1);
  for (int i = 1; i < n; ++i) {
    int v = query(1, n, i, 1);
    for (int j = 0; j < k; ++j) {
      update(1, n, min(n + 1, i + l[j]), min(n + 1, i + r[j]), 1, v);
    }
  }
  cout << query(1, n, n, 1);
  return 0;
}


Measured memory_bytes: 7704
fun main(args: Array<String>) {
    val (a, p) = readLine()!!.split(' ').map(String::toInt)
    val ans = solve(a = a, p = p)
    println(ans)
}

fun solve(a: Int, p: Int): Int {
    val pieces = p + a * 3
    return java.lang.Math.floor(pieces / 2.0).toInt()
}


Measured memory_bytes: 37872
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
			Console.WriteLine(Console.ReadLine().Split().Select(int.Parse).Any(i => i % 2 == 0) ? "No" : "Yes");
        }
    }
}


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

#define ull unsigned long long
#define endl '\n'
#define ll long long
const int N = 5e3 + 5;
ll mod = 1e9 + 7;
ll sum[N], fact[N], n;
bool chk(ll mid){
        map<ll,ll> mem;
        for (int i = mid; i <= n; i++){
                ll ha = (sum[i] - sum[i - mid] * fact[mid] + mod * mod) % mod;
                if (mem[ha] == 0) mem[ha] = i;
                else {
                        if (mem[ha] <= (i - mid)) {
                                return 1;
                        }
                }
        }
        return 0;
}
int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        if (fopen(".INP", "r")){
                freopen(".INP", "r", stdin);
                freopen(".OUT", "w", stdout);
        }
        cin >> n;
        string s;
        cin >> s;
        s = " " + s;
        fact[0] = 1;
        for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * 311 % mod;
        for (int i = 1; i <= n; i++){
                sum[i] = (sum[i - 1] * 311 + (s[i] - 'a') + 1) % mod;
        }
        ll l = 1, h = n / 2;
        while (l <= h){
                ll mid = (l + h) >> 1;
                if (chk(mid)) l = mid + 1;
                else h = mid - 1;
        }
        cout << h;
}


Measured memory_bytes: 640
N, K = map( int, input().split() )
limit = 10**9 + 7

cnt = 0
for i in range( K, N + 2 ):
    a = ( N * ( N + 1 ) // 2  - ( N - i  ) * ( N - i + 1 ) // 2 - i * ( i - 1 ) // 2 + 1 ) 
    cnt += a
    cnt %= limit 
print( cnt )

Measured memory_bytes: 9188
import sys
from itertools import accumulate

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *D = map(int, read().split())

    csum = accumulate(D)
    ans = sum(s * d for s, d in zip(csum, D[1:]))
    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 62160
K, A, B=map(int, input().split())
if A>=B:
    print(K+1)
    exit(0)

elif B-A==1:
    print(K+1)
    exit(0)

else:
    a=A+((K-A)//2+1)*(B-A) if (K-A)%2==1 else A+((K-A)//2)*(B-A)+1
    print(a)


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <math.h>
#include <set>
#include <bitset>
#include <stack>
#include <cmath>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;

typedef vector<ll> vecll;
typedef vector<ld> vecld;
typedef vector<bool> vecbl;
typedef vector<vector<ll> > matll;
typedef vector<vector<ld> > matld;
typedef vector<vector<bool> > matbl;
#define mp make_pair;

const ll prime = 1000000000 + 7;
const ld PI = 2 * acos(0.0);

/*
cout << fixed << setprecision(10);
*/

bool my_comp(pll a, pll b) {
	if (a.first != b.first) {
		return a.first < b.first;
	}

	return a.second < b.second;
}

// nのk乗(mod p = prime)
ll power(ll n, ll k) {
	ll p = prime;
	if (k == 1) {
		return n;
	}
	ll m = n * n;
	m %= p;
	if (k % 2 == 0) {
		return power(m, k / 2);
	}
	m = power(m, k / 2);
	m *= n;
	m %= p;
	return m;
}

// nCk(mod p = prime)
ll com(ll n, ll k) {
	// nCk
	ll p = prime;

	ll ans = 1;
	for (ll i = 1; i <= n; i++)
	{
		ans *= i;
		ans %= p;
	}

	for (ll i = 2; i <= k; i++)
	{
		ans *= power(i, p - 2);
		ans %= p;
	}

	for (ll i = 2; i <= n-k; i++)
	{
		ans *= power(i, p - 2);
		ans %= p;
	}

	return ans;
}


int main() {

	int n, m, a, first, j;
	cin >> n >> m;
	vector<int> result1(m), result2(m);
	a = (m + 1) / 2; // kisuu no kosuu
	for (int i = 0; i < a; i++)
	{
		result1[i] = i;
		result2[i] = a * 2 - 1 - i;
	}
	
	first = a * 2;
	for (int i = a; i < m; i++)
	{
		j = i - a;
		result1[i] = first + j;
		result2[i] = first + (m - a) * 2 - j;
	}

	for (int i = 0; i < m; i++)
	{
		printf("%d %d\n", result1[i] + 1, result2[i] + 1);
	}

	return 0;
}


Measured memory_bytes: 3516