akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

typedef struct node_tag
{
    int key;
    struct node_tag *prev, *next;
}node;
    char command_1[] = "insert";
    char command_2[] = "delete";
    char command_3[] = "deleteFirst";
    char command_4[] = "deleteLast";

node *nil;

int decision(char *moji)
{
   if(strcmp(command_4, moji) == 0){
       return 4;
   }else if(strcmp(command_3, moji) == 0){
       return 3;
   }else if(strcmp(command_2, moji) == 0){
       return 2;
   }else{
       return 1;
   }
}

void init()
{
    nil = (node *)malloc(sizeof(node));
    nil->next = nil;
    nil->prev = nil;
}

void insert(int key)
{
    node *x = (node *)malloc(sizeof(node));
    x->key = key;
    //???????????´??????????´??????????
    x->next = nil->next;
    nil->next->prev = x;
    nil->next = x;
    x->prev = nil;
}

node* listsearch(int key)
{
    node *cur = nil->next;
    while( cur != nil && cur->key != key ){
        cur = cur->next;
    }
    return cur;
}

void deletenode(node *t)
{
    if( t == nil ) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}

void deletefirst()
{
    deletenode(nil->next);
}

void deletelast()
{
    deletenode(nil->prev);
}

void deletekey(int key)
{
    deletenode(listsearch(key));
}

int main()
{
    int n, i, key;
    char tmp[15];
    init();

    scanf("%d", &n);
    for( i = 0; i < n; i++ ){
        scanf("%s %d", tmp, &key);
        switch(decision(tmp)){
        case 1:
            insert(key);
            break;
        case 2:
            deletekey(key);
            break;
        case 3:
            deletefirst();
            break;
        case 4:
            deletelast();
            break;
        }
    }
    node *hoge = nil->next;
    i = 0;
    while( hoge != nil ){
        if(i++ > 0) printf(" ");
        printf("%d", hoge->key);
        hoge = hoge->next;
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 32940
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let a = v[0];
	let b = v[1];
	println!("{}", (a+b)%24);
}

Measured memory_bytes: 4352
def examF():
    # 合ってんのこれ?????
    def calc_L(a,b):
        return (a**2 + b**2)**(1/2)
    N = I()
    X = [[]for _ in range(N)]
    for i in range(N):
        x,y = LI()
        d = math.degrees(math.atan2(y,x))
        if d<0:
            d += 360
        X[i] = [d,x,y]
    X.sort()
    #print(X)
    ans = 0
    for i in range(N):
        cur_X = 0; cur_Y = 0
        for d2,x2,y2 in (X[i:] + X[:i]):
            if calc_L(cur_X+x2,cur_Y+y2)<calc_L(cur_X,cur_Y):
                continue
            cur_X += x2
            cur_Y += y2

        now = calc_L(cur_X,cur_Y)
        if now>ans:
            ans = now

    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examF()

"""

"""

Measured memory_bytes: 41200
class Integer
  def combination(k)
    return 1 if k.zero?

    (self - k + 1..self).inject(:*) / k.factorial
  end

  def factorial
    return 1 if self.zero?

    (1..self).inject(:*)
  end
end

N = gets.to_i
S = N.times.map { gets.chomp }

counter = Hash.new(0)
c = 0

S.each do |s|
  next unless %w(M A R C H).include?(s[0])
  counter[s[0]] += 1
  c += 1
end

ans = c.combination(3)

counter.each do |_k, v|
  next if v <= 1

  two = v.combination(2)
  ans -= two * (c - v)

  next if v <= 2

  three= v.combination(3)
  ans -= three
end

puts ans


Measured memory_bytes: 10236
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int n;
typedef long long ll;
ll ans,a[60];
int main(){
//	freopen("e.in","r",stdin);
	scanf("%d",&n);
	for(int i=1;i<=n;++i){
		cin>>a[i];
	}
	ll* p;
	while(*(p=max_element(a+1,a+n+1)) >= (ll)n){
		for(int i=1;i<=n;++i){
			if(a+i!=p){
				a[i]+=(*p)/(ll)n;
			}
		}
		ans+=(*p)/(ll)n;
		(*p)%=(ll)n;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
VI mar;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  in n;
  cin>>n;
  mar.resize(n+1);
  forn(i,n)
    cin>>mar[i+1];
  in sm=0;
  for(in i=1;i<=n;++i)
    sm+=(mar[mar[i]]==i);
  sm/=2;
  cout<<sm<<endl;
  return 0;
}


Measured memory_bytes: 1152
n,m = map(int,input().split())
py = [list(map(int,input().split()))+[_] for _ in range(m)]
py.sort()
flag = py[0][0]
flag_2 = 1
for i in range(m):
  if flag != py[i][0]:
    flag = py[i][0]
    flag_2 = 1
  py[i][0] = (6-len(str(py[i][0])))*"0"+str(py[i][0])
  py[i][1] = (6-len(str(flag_2)))*"0"+str(flag_2)
  flag_2 += 1
py.sort(key = lambda py:py[2])
for j in range(m):
  print("".join(py[j][:2]))

Measured memory_bytes: 95832
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define mp make_pair
#define int long long
using namespace std;

typedef pair<int, int> P;



int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };


ll m = 1000000007;

const int MOD = 1000000007;

ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}



long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}

vector<P>x;
signed main() {
	int N, K; cin >> N >> K;
	REP(i, N) {
		int a, b; cin >> a >> b;
		x.pb(mp(a, b));
	}
	VSORT(x);
	ll cnt = 0;
	int i = 0;
	while (cnt < K) {
		cnt += x[i].second;
		i++;
	}
	ll ans = x[i-1].first;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    int n;
    cin >> n;
    vector<int> L(n);
    rep(i,n) cin >> L[i];
    sort(L.begin(), L.end());
    ll ans = 0;
    rep(j,n)rep(i,j) {
        int ij = L[i]+L[j];
        int r = lower_bound(L.begin(), L.end(), ij) - L.begin();
        int l = j+1;
        ans += max(0, r-l);
    }
    cout << ans << endl;
    return 0;
}

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


int main(){
    double N,D;
    int count;
    count = 0;

    cin >> N  >> D;
    vector<vector<int>> hole(N,vector<int>(2));

    rep(i,N){
        cin >> hole.at(i).at(0);
        cin >> hole.at(i).at(1);  
    }

    rep(i,N){
        double A = hole.at(i).at(0);
        double B = hole.at(i).at(1);  
        if( (A*A) + (B*B) <= D*D ){
            count += 1;
        }
    }
    cout << count;

}

Measured memory_bytes: 14408
#include<cstdio>
#include<algorithm>
#include<vector>
#define rep(i,a) for( int i = 0; i != (a); ++i )

int n;
int h[101];

int main()
{
	while( scanf( "%d", &n ), n )
	{
		rep( i, n+1 )
			scanf( "%d", h+i );

		int ans;
		rep( i, n+1 )
		{
			std::vector<int> a;
			rep( j, n+1 )
				if( i != j )
					a.push_back( h[j] );

			int d;
			bool fl = true;
			rep( j, n-1 )
			{
				if( j )
					fl &= d == a[j+1]-a[j];

				d = a[j+1]-a[j];
			}

			if( fl )
			{
				ans = i;
				break;
			}
		}

		printf( "%d\n", h[ans] );
	}

	return 0;
}

Measured memory_bytes: 1056
import java.util.*;

// ARC 84-A
// https://beta.atcoder.jp/contests/arc084/tasks/arc084_a

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

		int N = in.nextInt();
		int[] A = new int[N];
		int[] B = new int[N];
		int[] C = new int[N];
		
		TreeSet<Integer> aSet = new TreeSet<Integer>();
		TreeSet<Integer> bSet = new TreeSet<Integer>();
		TreeSet<Integer> cSet = new TreeSet<Integer>();
		
		for (int i = 0; i < N; i++) {
			A[i] = in.nextInt();
			aSet.add(A[i]);
		}
		for (int i = 0; i < N; i++) {
			B[i] = in.nextInt();
			bSet.add(B[i]);
		}
		for (int i = 0; i < N; i++) {
			C[i] = in.nextInt();
			cSet.add(C[i]);
		}
		
		Arrays.sort(A);
		Arrays.sort(B);
		Arrays.sort(C);
		
		long[] temp = new long[N];
		for (int i = 0; i < N; i++) {
			Integer c = cSet.higher(B[i]);
			
			if (c != null) {
				int index = binarySearch2(C, c);
				temp[i] = (N - index);
			} else {
				temp[i] = 0;
			}
		}
		
		for (int i = N - 2; i >= 0; i--) {
			temp[i] += temp[i + 1];
		}
		
		long answer = 0;
		for (int i = 0; i < N; i++) {
			Integer b = bSet.higher(A[i]);
			
			if (b != null) {
				int index = binarySearch2(B, b);
				answer += temp[index];
			}
		}
		System.out.println(answer);
	}
	
	public static int binarySearch1(int[] arr, int n) {
		int low = 0;
		int high = arr.length - 1;
		
		while (low <= high) {
			int mid = (low + high) / 2;
			
			if (arr[mid] == n && (mid == arr.length - 1 || arr[mid + 1] != arr[mid])) {
				return mid;
			} else if (arr[mid] > n) {
				high = mid - 1;
			} else {
				low = mid + 1;
			}
		}
		return -1;
	}
	
	public static int binarySearch2(int[] arr, int n) {
		int low = 0;
		int high = arr.length - 1;
		
		while (low <= high) {
			int mid = (low + high) / 2;
			
			if (arr[mid] == n && (mid == 0 || (mid > 0 && arr[mid - 1] != arr[mid]))) {
				return mid;
			} else if (arr[mid] < n) {
				low = mid + 1;
			} else {
				high = mid - 1;
			}
		}
		return -1;
	}
}

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

typedef long long ll;
#define int ll
#define pb push_back
const int INF = 1e18, MOD = 1e9+7;

signed main(){

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int n,k;
	cin>>n>>k;
	int arr[n+1];
	for(int i=1;i<=n;i++)
		cin>>arr[i];

	vector<int> dp(k+1,1), next(k+1,0);
	for(int i=1;i<=n;i++){
		next[0]= 1;
		for(int j=1;j<=k;j++){
			int left = max(0ll, j-arr[i]);
			next[j] = (left == 0) ? dp[j]: dp[j] - dp[left-1];
			next[j] = (next[j] + next[j-1])%MOD;
		}
	
		for(int j=0;j<=k;j++)
			dp[j] = next[j];
	}


	if (k!= 0) cout<<(dp[k]-dp[k-1] + MOD)%MOD;
	else cout<<1;

	return 0;
}

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

const int inf = 1e9;
const ll linf = 1e18;

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

    string n; cin >> n;
    if (n[0] == '9' || n[1] == '9') cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
mod = 10**9 + 7
x = [1] * (n + 1)
for _ in range(m):
    a = int(input())
    x[a] = 0
for i in range(2, n + 1):
    if x[i] == 0:
        continue
    x[i] = (x[i - 1] + x[i - 2]) % mod
print(x[n])


Measured memory_bytes: 6900
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
using namespace std;
int main(){
	string S;
	cin >> S;
	int K;
	cin >> K;
	int check = 1;
	string::iterator itr = S.begin();
	vector<string> v;
	for(int i = 1;i<=K;i++){
		if(i > (int)S.size())break;
		for(int j = 0;j < (int)S.size() - i + 1;j++){
			v.push_back(S.substr(j,i));
		}
	}
	sort(v.begin(),v.end());
	int count = 1;
	string ans = v[0];
	int i = 1;
	while(count < K){
		if(v[i-1] != v[i]){
			count++;
			ans = v[i];
		}
		i++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 1660
#include <iostream>
#include <vector>

using namespace std;


int main(){
	int N, M, k;
	int ans = 0;
	vector<vector<int>> s;
	vector<int> p;

	cin >> N >> M;
	s.resize(M);
	p.resize(M);
	for (int i = 0; i < M; i++) {
		cin >> k;
		s[i].resize(k);
		for (int j = 0; j < k; j++) {
			cin >> s[i][j];
		}
	}
	for (int i = 0; i < M; i++) cin >> p[i];
	
	for (int bit = 0; bit < (1 << N); bit++) {
		vector<bool> on(N);
		for (int i = 0; i < N; i++){
			if (bit & (1 << i)) on[i] = true;
		}
		bool ok = true;
		for (int i = 0; i < M; i++) {
			int count = 0;
			for (int j = 0; j < s[i].size(); j++) {
				if (on[s[i][j] - 1]) count++;
			}
			if (p[i] != count % 2) ok = false;
		}
		if (ok) ans++;
	}
 
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

int X, Y, Z;

int main(void){
    
    scanf("%d %d %d", &X, &Y, &Z);
    
    int ans = 0;
    for(int i = Y + Z + Z; i <= X; i += Y + Z) ++ans;
    printf("%d\n", ans);
    
    return 0;
}



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

int main(){
  int N;
  float sf ;
  int si ;

  cin >> N ;

  sf = log(N)/log(10) ;
  si = sf ;

  if(N == 100000){
    cout << 9 + 900 + 90000;
    return 0 ;
  }

  if(si == 0){
    cout << N ;
  }
  if(si == 1){
    cout << 9 ;
  }
  if(si == 2){
    cout << 9 + N -99;
  }
  if(si == 3){
    cout << 9 + 900 ;
  }
  if(si == 4){
    cout << 9 + 900 + N - 9999 ;
  }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep_lr(i,l,r) for(int i=(l);i<(r);i++)
#define all(x) (x).begin(),(x).end()
#define V vector
typedef V<int> vi;
typedef V<vi> vvi;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
constexpr int INF = INT_MAX >> 1;
constexpr ll LINF = 5000000000000000LL;
constexpr int MOD = 1000000007;

int n;
string s;
int mem[5050][5050];

int dp(int i, int j) {
	if (i == n || j == n || i >= j)return 0;
	if (mem[i][j])return mem[i][j] - 1;

	int ret = 0;
	if (s[i] == s[j])ret = dp(i + 1, j + 1) + 1;
	ret = min(ret, j - i);
	mem[i][j] = ret + 1;
	return ret;
}

int main() {
	
	cin >> n >> s;
	int ans = 0;
	rep(i, n + 1)rep(j, n + 1)ans = max(ans, dp(i, j));
	cout << ans << endl;

}

Measured memory_bytes: 70684
import sys

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


def divisors(n):
    lower = []
    upper = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            lower.append(i)
            if i != n // i:
                upper.append(n // i)

    lower.extend(reversed(upper))
    return lower


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

    total = sum(A)
    div = divisors(total)

    for d in reversed(div):
        vec = [a % d for a in A]
        vec.sort()

        M = len(vec)
        csum_sub = [0] * (M + 1)
        csum_add = [0] * (M + 1)
        for i in range(M):
            csum_sub[i + 1] = csum_sub[i] + vec[i]
            csum_add[i + 1] = csum_add[i] + d - vec[i]

        for i in range(M + 1):
            if csum_sub[i] <= K and csum_sub[i] == csum_add[M] - csum_add[i]:
                print(d)
                return

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9528
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) (a).begin(),(a).end()
typedef long long ll;
#define rep1(i,n) for(int i=1;i<=int(n);++i)
#define lb(s,x) (lower_bound(all(s),x)-s.begin())
#define ub(s,x) (upper_bound(all(s),x)-s.begin())
#define uniq(a) a.erase(unique(all(a)),a.end())
#define bit(k) (1LL<<(k))
const int INF = 1e9;

#define debug(x) cerr<<(#x)<<": "<<(x)<<endl
template<class T,class U>
ostream& operator<<(ostream& o, const pair<T,U> &p){
    o<<"("<<p.first<<", "<<p.second<<")";
    return o;
}
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }

int n,k,c;
vector<int> make_dp(string s){
    vector<int> dp(n+2);
    rep1(i,n+1){
        if (s[i] == 'o') {
            if (i-c-1 < 0) dp[i] = 1;
            else dp[i] = dp[i-c-1] + 1;
        } else {
            dp[i] = dp[i-1];
        }
    }
    return dp;
}

int main(void){
    cin >> n >> k >> c;
    string s;
    cin >> s;
    if (n == k) {
        rep1(i,n){
            cout << i << endl;
        }
        return 0;
    }
    s = "x" + s + "x";
    auto stepL = make_dp(s);

    string rs = s;
    reverse(all(rs));
    auto stepR = make_dp(rs);
    reverse(all(stepR));

    // print(stepL);
    // print(stepR);
    set<int> res;
    rep1(i,n) {
        if (s[i] == 'o') {
            res.insert(i);
        }
    }
    if (c == 0) {
        if ((int)res.size() == k) {
            for (int d : res) {
                cout << d << endl;
            }
        }
        return 0;
    }
    rep1(i,n+c+1){
        int l = max(0,i-c-1);
        int r = min(n+1,i);
        // printf("stepL[%d]: %d, stepR[%d]: %d\n",
        //     max(0,i-c-1),
        //     stepL[max(0,i-c-1)],
        //     min(n+1,i),
        //     stepR[min(n+1,i)]);
        if (stepL[l] + stepR[r] >= k) {
            while (res.upper_bound(l) != res.end()) {
                if (*res.upper_bound(l) < r) {
                    res.erase(res.upper_bound(l));
                } else {
                    break;
                }
            }
        }
    }
    for (int d : res) {
        cout << d << endl;
    }
    return 0;
}


Measured memory_bytes: 11584
import itertools
N = int(input())

P = list(map(int, input().split()))
Q = list(map(int, input().split()))

lis = [i for i in range(1, N+1)]

all_permutations = [item for item in itertools.permutations(lis, N)]

all_numeric_permutations = []
for item in all_permutations:
  num = 0
  i = 10 ** (N - 1)
  for letter in item:
    num += i * letter
    i /= 10
  all_numeric_permutations.append(num)
  
num_P = 0
i = 10 ** (N - 1)
for item in P:
  num_P += i * item
  i /= 10
  
num_Q = 0
i = 10 ** (N - 1)  
for item in Q:
  num_Q += i * item
  i /= 10

a = all_numeric_permutations.index(num_P) + 1
b = all_numeric_permutations.index(num_Q) + 1

print(abs(a - b))


Measured memory_bytes: 9332
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    int e = 0, o = 0;
    rep(i,n){
        if (a[i] % 2 == 0) e++;
        else o++;
    }
    if (e == n) cout << "second" << endl;
    else cout << "first" << endl;
    return 0;
}

Measured memory_bytes: 4048
// C++ program to compute LCM of array elements modulo M 
#include <bits/stdc++.h> 
#define F first 
#define S second 
#define MAX 10000003 
using namespace std; 

typedef long long int ll; 
const ll mod = 1000000007; 

ll prime[MAX]; 
unordered_map<ll, ll> max_map; 

// Function to return a^n 
ll power(ll a, ll n) 
{ 
	if (n == 0) 
		return 1; 
	ll p = power(a, n / 2) % mod; 
	p = (p * p) % mod; 
	if (n & 1) 
		p = (p * a) % mod; 
	return p; 
} 

// Function to find the smallest prime factors 
// of numbers upto MAX 
void sieve() 
{ 
	prime[0] = prime[1] = 1; 
	for (ll i = 2; i < MAX; i++) { 
		if (prime[i] == 0) { 
			for (ll j = i * 2; j < MAX; j += i) { 
				if (prime[j] == 0) { 
					prime[j] = i; 
				} 
			} 
			prime[i] = i; 
		} 
	} 
} 

// Function to return the LCM modulo M 
ll lcmModuloM(const ll* arr, ll n) 
{ 

	for (ll i = 0; i < n; i++) { 
		ll num = arr[i]; 
		unordered_map<ll, ll> temp; 

		// Temp stores mapping of prime factor to 
		// its power for the current element 
		while (num > 1) { 

			// Factor is the smallest prime factor of num 
			ll factor = prime[num]; 

			// Increase count of factor in temp 
			temp[factor]++; 

			// Reduce num by its prime factor 
			num /= factor; 
		} 

		for (auto it : temp) { 

			// Store the highest power of every prime 
			// found till now in a new map max_map 
			max_map[it.first] = max(max_map[it.first], it.second); 
		} 
	} 

	ll ans = 1; 

	for (auto it : max_map) { 

		// LCM is product of primes to their highest powers modulo M 
		ans = (ans * power(it.F, it.S)) % mod; 
	} 

	return ans; 
} 
ll modInverse(ll a, ll m) 
{ 
    ll m0 = m; 
    ll y = 0, x = 1; 
  
    if (m == 1) 
      return 0; 
  
    while (a > 1) 
    { 
        // q is quotient 
        ll q = a / m; 
        ll t = m; 
  
        // m is remainder now, process same as 
        // Euclid's algo 
        m = a % m, a = t; 
        t = y; 
  
        // Update y and x 
        y = x - q * y; 
        x = t; 
    } 
  
    // Make x positive 
    if (x < 0) 
       x += m0; 
  
    return x; 
} 
// Driver code 
int main() 
{ 
	sieve(); 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n;
    cin>>n;
    ll arr[n];
    for(ll x=0; x<n; x++){
        cin>>arr[x];
    }
    ll ans=lcmModuloM(arr,n);
    ll sum=0;
    for(ll x=0; x<n; x++){
        sum+=(ans*modInverse(arr[x],mod));
        sum=sum%mod;
    }
    cout<<sum%mod;
    return 0;
}




Measured memory_bytes: 78848
/*
    When you are not practicing someone else is,
    and the day u meet them u will Lose.

    So, all you need is Practice, Practice and Practice.
*/
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,a,b)       for(i=a;i<=b;i++)
#define FOR(i,a,b)      for(i=a;i>=b;i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define vpii            vector<pii>
#define vvi             vector<vi>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define sz(v)           (int)v.size()
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
const int inf =         1e18;
const int mod =         1e9+7;
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
void _p() {cout << "]\n";}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p) {int ans=1;x%=mod;while(p>0){if(p&1)ans=(ans*x)%mod;p=p>>1;x=(x*x)%mod;}return ans;}
int inv(int x){return po(x,mod-2)%mod;}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif
/**********************************************************************************/



const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r,f,q;








void sol()
{   
    cin>>n>>x>>y;
    
    
    
    
    cout<< ((n<=x*y)?"Yes":"No") <<endl;
}





int32_t main()
{   
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //pre();
    //sp(10);
    // w(t)
    sol();
    return 0;
}


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

using namespace std;
int main(){
	int num[4];
	cin>>num[0]>>num[1]>>num[2];
	int ans=500;
	for(int i=0;i<3;i++){
		int cmp=0;
		for(int j=0;j<3;j++){
			if(i!=j){
				cmp=abs(num[i]-num[j]);
				for(int k=0;k<3;k++){
					if(i!=k && j!=k){
						cmp+=abs(num[j]-num[k]);
						ans=min(ans,cmp);
					}
				}
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set

using namespace std;

const ll MOD = 1000000007;
const ll INF = (1LL << 62);

int main() {
  ll N;
  scanf("%lld", &N);

  ll ans = 0;
  for (ll i = 1; i <= N; i++) {
    if (i % 3 == 0 || i % 5 == 0) {
      continue;
    }
    ans += i;
  }

  cout << ans << endl;
}


Measured memory_bytes: 3764
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace C_ABC157
{
    class MainClass
    {

        static int[] s;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            var s123 = new int[3] { -1, -1, -1 };
            for (int i = 0; i < s[1]; i++)
            {
                int[] sc = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
                if (s123[sc[0] - 1] == -1)
                {
                    s123[sc[0] - 1] = sc[1];
                }
                else
                {
                    if (s123[sc[0] - 1] != sc[1])
                    {
                        WriteLine(-1);
                        return;
                    }
                }
            }
            if (s[0] == 1)
            {

                WriteLine(Max(s123[0], 0));
                return;
            }
            else if (s[0] == 2)
            {
                if (s123[0] == 0)
                {
                    WriteLine(-1);
                    return;
                }
                else
                {
                    Write(Max(s123[0], 1));
                    WriteLine(Max(s123[1], 0));
                }
            }
            else
            {
                if (s123[0] == 0)
                {
                    WriteLine(-1);
                    return;
                }
                else
                {
                    Write(Max(s123[0], 1));
                    Write(Max(s123[1], 0));
                    WriteLine(Max(s123[2], 0));
                }

            }
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



int main() {
	
	int n; cin >> n;
	string s; cin >> s;
	int ans = 0;

	int l = 0;
	int r = n - 1;

	while(l < r){
		bool flag = 1;
		if(s[l] != 'W'){
			flag = 0;
			l++;
		}
		if(s[r] != 'R'){
			flag = 0;
			r--;
		}
		if(flag == 1){
			ans++;
			l++;
			r--;
		}

	}

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


Measured memory_bytes: 3684
#include <iostream>
using namespace std;
int main (){
    int test[50][3], flag  = 0, test_sum;
    while (1){
        cin >> test[flag][0] >> test[flag][1] >> test[flag][2];
        if (test[flag][0] == -1 && test[flag][1] == -1 && test[flag][2] == -1) break;
        test_sum = test[flag][0] + test[flag][1];
        if (test[flag][0] == -1 || test[flag][1] == -1) cout << "F" << endl;
        else if (test_sum >= 80) cout << "A" << endl;
        else if ( test_sum >= 65) cout << "B" << endl;
        else if ( test_sum >= 50|| ((test_sum >= 30 && test_sum < 50) && test[flag][2] >= 50)) cout << "C" << endl;
        else if ( test_sum >= 30 ) cout << "D" << endl;
        else if ( test_sum < 30) cout << "F" << endl;
        flag += 1;
        
    }
    
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n;
	cin>>n;
	long double ans = (n*1.0)/3;
	cout<<fixed<<setprecision(15)<<(ans*ans*ans);
}

Measured memory_bytes: 256
fn get_line() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().to_string()
}

fn main() {
    let k = get_line().parse::<i64>().unwrap();
    let (a, b) = {
        let ab = get_line()
            .split_whitespace()
            .map(|e| e.parse().unwrap())
            .collect::<Vec<i64>>();
        (ab[0], ab[1])
    };

    let i = a / k;
    
    if a % k == 0 {
        println!("OK");
    } else if b % k == 0 {
        println!("OK");
    } else {
        if a <= k * (i + 1) && k * (i + 1) <= b {
            println!("OK");
        } else {
            println!("NG");
        }
    }
}


Measured memory_bytes: 2092
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>

using namespace std;

int main() {
  int H,W;
  char C[100][100];
  cin >> H >> W;
  for (int i=0; i<H; i++) {
    for (int j=0; j<W; j++) {
      cin >> C[i][j];
    }
  }
  for (int i=0; i<H; i++) {
    for (int j=0; j<W; j++) {
      cout <<  C[i][j];
    }
    cout << endl;
    for (int j=0; j<W; j++) {
      cout <<  C[i][j];
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 3508
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

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

    int n=s.size();
    string t="";
    rep(i,n){
        if(i%2==0) t+='g';
        else t+='p';
    }

    int ans=0;
    rep(i,n){
        if(s[i]=='g' && t[i]=='p') ans++;
        else if(s[i]=='p' && t[i]=='g') ans--; 
    }

    cout<<ans<<endl;
}


Measured memory_bytes: 640
// ===================================
//   author: M_sea
//   website: http://m-sea-blog.com/
// ===================================
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#define re register
using namespace std;
typedef long long ll;

inline int read() {
    int X=0,w=1; char c=getchar();
    while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
    while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
    return X*w;
}

const int N=100000+10;

int n,mx;
int a[N],s[N],ss[N];

int c[N<<1];
inline int lowbit(int x) { return x&-x; }
inline void add(int x,int y) {
    for (;x<=mx;x+=lowbit(x)) c[x]+=y;
}
inline int query(int x) {
    int res=0;
    for (;x;x-=lowbit(x)) res+=c[x];
    return res;
}
inline int check(int mid) {
    memset(c,0,sizeof(c)),mx=0;
    for (re int i=1;i<=n;++i) {
        if (s[i]<mid) ss[i]=-1;
        else ss[i]=1;
    }
    ll res=0;
    for (re int i=1;i<=n;++i) ss[i]+=ss[i-1],res+=(ss[i]>=0);
    for (re int i=1;i<=n;++i) ss[i]+=n+1,mx=max(mx,ss[i]);
    for (re int i=1;i<=n;++i) res+=query(ss[i]),add(ss[i],1);
    ll cnt=1ll*n*(n-1)/2+n;
    /*if(mid==9)
      cout<<res<<endl;*/
    return cnt-res<cnt/2+1;
}
int main() {
    cin>>n;
    for(int i=1;i<=n;i++)
    {
       cin>>s[i];
       a[i]=s[i];
    }
    sort(a+1,a+1+n);
    int l=1,r=n;
    int ans=0;
    while(l<=r)
    {
       int mid=(l+r)>>1;
       if(check(a[mid]))
       {
         l=mid+1;
         ans=a[mid];
       } 
       else
       {
          r=mid-1;
       }
    }
    cout<<ans<<endl;
    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
//const ull mod = 1e9 + 7;
const ll mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

// debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

// conversion number to bit
string num2bit(ll num, ll len){
  string bit = "";
  REP(i, len){
    bit += char('0'+(num>>i & 1));
  }
  return bit;
}

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

    ll A, B, C;
    cin >> A >> B >> C;

    cout << (A+B>=C?"Yes":"No") << endl;
    return 0;
}

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

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

int main(void){
  int n,m,p[1000];

  while(1){

    int sum = 0;

    cin >> n >> m;
    if( n == 0 && m == 0 ) break;
    
    for( int i = 0 ; i < n ; i++ ){ cin >> p[i]; sum += p[i]; }

    sort( p , p + n );

    for( int i = n - m ; i >= 0  ; i -= m ) sum -= p[i];
    
    cout << sum << endl;

  }

  return 0;
}

Measured memory_bytes: 1176
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['No', 'Yes']
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def modinv(a):
    return pow(a, MOD-2, MOD)


def main():
    N = I()
    x = LI()
    distance = [(x[i] - x[i-1]) % MOD for i in range(1, N)]

    F = 1
    for i in range(1, N):
        F *= i
        F %= MOD

    c = [0] * (N - 1)
    for i in range(N-1):
        if i == 0:
            c[i] = (F * 1) % MOD
        else:
            c[i] = (F * modinv(i+1)) % MOD + c[i-1]

    moves = [(d * e) % MOD for d, e in zip(distance, c)]
    print(sum(moves) % MOD)


if __name__ == '__main__':
    main()


Measured memory_bytes: 62828
#![allow(unused_imports)]
use itertools::Itertools;
use proconio::{input, marker::*};
use std::cmp::*;
use std::collections::*;
use superslice::*;

fn main() {
    input! {
        n: usize,
        x: Chars,
    }

    let mut popcount_x = 0;
    for i in 0..n {
        if x[i] == '1' {
            popcount_x += 1;
        }
    }

    let mut mod_plus = 0;
    let mut mod_minus = 0;

    for i in 0..n {
        let d = if x[i] == '1' { 1 } else { 0 };
        mod_plus = (mod_plus * 2 + d) % (popcount_x + 1);
        if popcount_x > 1 {
            mod_minus = (mod_minus * 2 + d) % (popcount_x - 1);
        }
    }

    let mut xs: Vec<u64> = vec![0; n];
    for i in 0..n {
        if x[i] == '0' {
            let res = (mod_plus + mod_pow(2, n - i - 1, popcount_x + 1)) % (popcount_x + 1);
            xs[i] = res as u64;
        } else if popcount_x > 1 {
            let diff = mod_pow(2, n - i - 1, popcount_x - 1) % (popcount_x - 1);
            let res = if mod_minus < diff {
                mod_minus + popcount_x - 1 - diff
            } else {
                mod_minus - diff
            };
            xs[i] = res as u64;
        } else {
            xs[i] = n as u64; // xi == 0になる目印
        }
    }

    let mut ops: Vec<i64> = vec![0; n + 1];
    ops[n] = -1;

    for i in 0..n {
        let mut i2 = i as u32;
        let mut op_count = 0;

        while i2 > 0 {
            if ops[i2 as usize] > 0 {
                op_count += ops[i2 as usize];
                i2 = 0;
            } else {
                i2 = i2 % i2.count_ones();
                op_count += 1;
            }
        }

        ops[i as usize] = op_count;
    }

    for i in 0..n {
        println!("{}", ops[xs[i] as usize] + 1);
    }
}

// aのn乗を求める。繰り返し二乗法によりO(logN)で計算できる
fn mod_pow(a: usize, n: usize, mod_n: usize) -> usize {
    if n == 0 {
        return 1;
    }

    let mut res = mod_pow(a, n / 2, mod_n);
    res = res * res % mod_n;

    if n % 2 == 1 {
        res = res * a % mod_n;
    }

    res
}


Measured memory_bytes: 6256
//pragma
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#define YOU using
#define DONT namespace
#define SAY std

YOU DONT SAY;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define REPP(i,a,b,d) for(int i=a;i<=b;i+=d)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,d) for(int i=a;i>=b;i-=d)
#define REV(i,a,b) REVV(i,a,b,1)

#define FOR(i,a) for(int i=0; i<a; i++)
#define FORD(i,a) for(int i=(int)a-1; i>=0; i--)

#define pb push_back
#define F first
#define S second

const int OO = 1e9;
const ll INF = 1e18;

const int irand(int lo,int hi){
	return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

const ll lrand(ll lo,ll hi){
	return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

#define getc getchar
template<typename T>
T getnum(){
	int sign = 1;
	T ret = 0;
	char c;

	do{
		c = getc();
	}while(c == ' ' || c == '\n');
	if(c == '-')sign = -1;
	else ret = c-'0';
	while(1){
		c = getc();
		if(c < '0' || c > '9')break;
		ret = 10*ret + c-'0';
	}
	return sign * ret;
}

inline void ini(int& x){
	x = getnum<int>();
}

inline void scani(int& x){
	scanf("%d",&x);
}

//end of macro

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #define endl '\n'
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(10);

    int n;
    cin>>n;
    bool yes = false;
    while(n){
    	if(n%10 == 7)yes = true;
    	n /= 10;
    }

    cout << (yes ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 3600
using System;
class Program
{
static int n = int.Parse(Console.ReadLine());//int.Parseは文字列を整数に変換。
static int[] parents = new int[n];//親

	static void Main()
	{
  long answer = 0;
  int[][] costs = new int[2*(n-1)][];//２頂点と距離
  int[][] vertexes = new int[n][];//ここに受け取る
    for(int i = 0; i < n; i++)
    {
    int[] nums = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);//１行ごとに受け取る
    vertexes[i] = new int[]{i,nums[0],nums[1]};//頂点の座標をジャグ配列へ
    }
    Array.Sort(vertexes, (a, b) => a[1] - b[1]);//x座標の昇順に並べる
    for(int i = 0; i < n-1; i++)
    {
    costs[i] = new int[]{vertexes[i][0],vertexes[i+1][0],
      vertexes[i+1][1] - vertexes[i][1]};
    }

    Array.Sort(vertexes, (a, b) => a[2] - b[2]);//y座標の昇順に並べる
    for(int i = 0; i < n-1; i++)
    {
    costs[(n-1)+i] = new int[]{vertexes[i][0],vertexes[i+1][0],
      vertexes[i+1][2] - vertexes[i][2]};
    }

    Array.Sort(costs, (a, b) => a[2] - b[2]);//コストの昇順に並べる

    for(int i = 0; i < n; i++)//個体の結合
    {
    parents[i] = i;
    }

    for(int i = 0; i < costs.Length; i++)
    {
      
        if(whatParent(costs[i][0]) != whatParent(costs[i][1]))
        { 
        
          parents[whatParent(costs[i][0])] = whatParent(costs[i][1]);//親の統一
          answer += costs[i][2];
        }
          
    }

	Console.WriteLine(answer);//WriteLineをWriteとすると、改行なしで出力。
	}

  static int whatParent(int child)
  {
    if(parents[child] == child) return child;
    else return parents[child] = whatParent(parents[child]);
  }
  
}


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

int main() {
  int N, M;
  int h[1500] = {0};
  int w[1500] = {0};

  while(1) {
    cin >> N >> M;
    if(N == 0 && M == 0) break;

    for(int i = 0; i < N; i++) cin >> h[i];
    for(int i = 0; i < M; i++) cin >> w[i];

    int sum;
    int height[800000] = {0};
    int width[800000] = {0};
    for(int i = 0; i < N; i++) {
      sum = 0;
      for(int j = i; j < N; j++) {
        sum += h[j];
        height[sum] += 1;
      }
    }
    for(int i = 0; i < M; i++) {
      sum = 0;
      for(int j = i; j < M; j++) {
        sum += w[j];
        width[sum] += 1;
      }
    }

    int count = 0;
    for(int i = 1; i <= 800000; i++) {
      count += height[i] * width[i];
    }
    cout << count << endl;
  }
  return 0;
}



Measured memory_bytes: 9276
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::f64::consts::*;

#[allow(unused)]
const INF: usize = std::usize::MAX / 4;
#[allow(unused)]
const M: usize = 1000000007;

macro_rules! debug {
    ($($a:expr),* $(,)*) => {
    #[cfg(debug_assertions)]
        eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*);
    };
}

fn main() {
    input! {
        n: usize,
        vw: [(Usize1, Usize1); n - 1],
    }
    let mut out_edges = vec![vec![]; n];
    let mut in_degree = vec![0; n];
    for &(mut vi, mut wi) in &vw {
        if vi > wi {
            std::mem::swap(&mut vi, &mut wi);
        }
        out_edges[vi].push(wi);
        in_degree[wi] += 1;
    }
    for i in 1..n {
        in_degree[i] += in_degree[i - 1];
    }

    let mut s = in_degree.iter().sum::<usize>();
    let mut result = 0usize;
    for vi in 0..n {
        debug!((n - vi) * (n - vi + 1) / 2, s);
        result += (n - vi) * (n - vi + 1) / 2 - s;
        for &wi in &out_edges[vi] {
            s -= n - wi;
        }
    }
    println!("{}", result);
}


Measured memory_bytes: 20188
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); ++i)
#define rep1(i,n) for (int i=1; i<=(n); ++i)
typedef long long ll;
bool debug=false;
string yes = "Yes";
string no = "No";
const ll mod = 998244353;
const double e = 0.000000001;
int main(){
  ll a,b,c; cin >> a >> b >> c;
  cout << min(abs(a-b)+abs(b-c), min(abs(b-c)+abs(c-a),abs(c-a)+abs(a-b)));
  return 0;
}


Measured memory_bytes: 3608
# -*- coding: utf-8 -*-
import sys
from collections import deque
S=sys.stdin.readline().strip()
Q=int(sys.stdin.readline().strip())

cnt=0   #反転した回数
deq1=deque()
deq2=deque()

for _ in range(Q):
    t=sys.stdin.readline().split()
    if t[0]=="1": #反転
        cnt+=1      #反転回数をカウント
    elif t[0]=="2": #文字列挿入
        qtype,front_or_back,c=t[0],int(t[1]),t[2]
        if cnt%2==0:    #反転回数が偶数の場合
            if front_or_back==1:    #前に足す
                deq1.appendleft(c)
            elif front_or_back==2:  #後ろに足す
                deq2.append(c)
        else:   #反転回数が奇数の場合
            if front_or_back==1:    #前に足す
                deq2.append(c)      #反転しているので、deq2が前に来ている
            elif front_or_back==2:  #後ろに足す
                deq1.appendleft(c)  #反転しているので、deq1が前に来ている

s_deq1=""
for x in deq1:
    s_deq1+=x

s_deq2=""
for x in deq2:
    s_deq2+=x

if cnt%2==0:    #反転回数が偶数の場合
    print s_deq1+S+s_deq2
else:    #反転回数が奇数の場合
    print s_deq2[::-1]+S[::-1]+s_deq1[::-1]

Measured memory_bytes: 140956
def inputs():
    s = input()
    li = s.split(" ")
    return(int(li[0]), int(li[1]), int(li[2]))

def digitSum(num):
    sum = 0
    while(num > 0):
        sum += (num % 10)
        num //= 10
    return(sum)

def rangeSum(N, A, B):
    allsum = 0
    for i in range(1, N+1):
        tmpsum = digitSum(i)
        if(A <= int(tmpsum) <= B):
            allsum += i
    return(allsum)

def main():
    N, A, B = inputs()
    sum = rangeSum(N, A, B)
    print(sum)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
import sys
from collections import defaultdict

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
AB = [lr() for _ in range(N-1)]
graph = [[] for _ in range(N+1)] # 1-indexed
for i in range(N-1):
    a, b = AB[i]
    AB[i] = tuple(sorted([a, b]))
    graph[a].append(b)
    graph[b].append(a)

AB_to_C = defaultdict(int)
root = 1
parent = [0] * (N+1)
stack = [root]
while stack:
    cur = stack.pop()
    used = 0
    if parent[cur] != 0:
        used = AB_to_C[tuple(sorted([cur, parent[cur]]))]
    color = 1
    for next in graph[cur]:
        if next == parent[cur]:
            continue
        parent[next] = cur
        while True:
            if color == used:
                color += 1
            else:
                AB_to_C[tuple(sorted([cur, next]))] = color
                color += 1
                break
        stack.append(next)

answer = [0] * (N-1)
for i in range(N-1):
    answer[i] = AB_to_C[AB[i]]

print(max(answer))
print(*answer, sep='\n')


Measured memory_bytes: 51400