akhauriyash/Code-Regression huggingface dataset:
// This template is based on Mr. tonymontaro's template (https://atcoder.jp/users/tonymontaro).
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static PrintWriter out;
    static CF_Reader in;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        in = new CF_Reader();
        StringBuilder result = new StringBuilder();

        // Start: int型の整数n mを取得する
        // // N M 形式
        // int n = in.intNext();
        // int m = in.intNext();
        // End: int型の整数n mを取得する

        int K = in.intNext();
        String S= in.next();

        if (S.length() <= K) {
          result.append(S);
        } else {

        // Start: int型の整数Nと配列Aを取得する
        // // N
        // // A1 A2 A3... AN 形式
        // int n = in.intNext();
        // int[] A = in.nextIntArray(n);
        // End: int型の整数Nと配列Aを取得する

        // Start: Char型の文字をInt型に変換する
        // Integer.parseInt(String.valueOf(charText))
        // End: Char型の文字をInt型に変換する

        // Start: 文字列を1文字ずつ出力する
        // String text = in.next();
        String text = S;
        String res = "";
        char[] work = new char[text.length()];
        for(int i = 0; i < K; i++){
          res += text.charAt(i);
          // work[i] = text.charAt(i); // Char型の文字
          // out.println(work[i]);
        }
        res += "...";
        result.append(res);
        // End: 文字列を1文字ずつ出力する
        }

        out.println(result);

        out.close();
    }

    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

        public int[] nextIntArray(final int n) throws IOException {
            final int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = intNext();
            return a;
        }

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = longNext();
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
}

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

int main() {
    int n; cin >> n;
    vector<int> a(n);

    int tmp;
    rep(i, a.size()) {
        cin >> tmp;
        a.at(tmp-1) = i+1;
    }
    cout << a.at(0);
    for (int i = 1; i < a.size(); i++)
        cout  << " " << a.at(i);
    cout << endl;
    return 0;
}

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


void solve(long long N){
    cout<<((N>1)?N*(N-1)/2:0)<<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::cout<<std::fixed<<std::setprecision(10);//誤差小数10桁まで
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 256
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do(): 
    n=INT()
    print((n+1)//2)
if __name__ == '__main__':
    do()

Measured memory_bytes: 3316
package main

import "fmt"

func main() {

	deck := make(map[string][]int)
	shcd := [4]string{"S", "H", "C", "D"}

	for i:=0; i<4; i++ {
		deck[shcd[i]] = make([]int,13)
	}

	var n, num int
	var mark string
	fmt.Scan(&n)

	for m:=0; m<n; m++ {
		fmt.Scan(&mark, &num)
		deck[mark][num-1] = 1
	}
	for i:=0; i<4; i++ {
		for j:=0; j<13; j++{
			if deck[shcd[i]][j]==0 {
				fmt.Println(shcd[i],j+1)
			}
		}
	}

}


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

typedef long long ll;

#define        optimize           ios::sync_with_stdio(0); cin.tie(0);
#define PI    acos(-1.0)
#define pb push_back
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define RESET(a, b) memset(a, b, sizeof(a))
#define pii pair <int, int>
#define pll pair <ll, ll>
#define gcd(a, b) __gcd(a, b)

#define        MX        100005

int dp[MX];
int ara[MX];

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

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

    dp[1] = 0;
    for(int i = 2; i <= n; i++){
        dp[i] = dp[i-1] + abs(ara[i]-ara[i-1]);
        if(i > 2) dp[i] = min(dp[i], dp[i-2] + abs(ara[i]-ara[i-2]));
    }

    cout<<dp[n]<<endl;
}


Measured memory_bytes: 4436
#include <bits/stdc++.h>
#define FOR(i, k, n) for(int i = (k); i < (n); i++)
#define FORe(i, k, n) for(int i = (k); i <= (n); i++)
#define FORr(i, k, n) for(int i = (k); i > (n); i--)
#define FORre(i, k, n) for(int i = (k); i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
using ll = long long;

const int INF = 1001001001;
const int mod = 1000000007;

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

  int n = s.size();
  int m = t.size();

  vector<vector<int>> dp(n+1, vector<int>(m+1, 0));
  
  REP(i, n){
    REP(j, m){
      if(s[i] == t[j]) chmax(dp[i+1][j+1], dp[i][j]+1);
      chmax(dp[i+1][j+1], dp[i+1][j]);
      chmax(dp[i+1][j+1], dp[i][j+1]);
    }
  }

  string ans = "";
  while(n > 0 && m > 0){
    if(dp[n][m] == dp[n-1][m]){
      n--;
    }else if(dp[n][m] == dp[n][m-1]){
      m--;
    }else{
      ans = s[n-1] + ans;
      n--;
      m--;
    }
  }

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

Measured memory_bytes: 35584
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

int a[2][101];

signed main() {
  INIT;
	VAR(int, n);
	REP(i, 2) {
		REP(j, n) {
			cin >> a[i][j];
		}
	}

	vector< int > sm1(n + 1, 0);
	REP(i, n) {
		sm1[i] = a[0][i];
		if (i > 0) sm1[i] += sm1[i - 1];
	}

	vector< int > sm2(n + 1, 0);
	RREP(i, n) {
		sm2[i] = a[1][i];
		if (i > 0) sm2[i] += sm2[i + 1];
	}
	sm2[0] += sm2[1];

	int ans = 0;
	REP(i, n) {
		debug(sm1[i]);
		debug(sm2[i]);
		ans = max(ans, sm1[i] + sm2[i]);
	}
	OUT(ans)BR;
	
  
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n=0;
int id(int a ,int b,int c){
    return a*(n+1)*(n+1)+b*(n+1)+c;
}
double pr(double a[],int p ,int q, int r){
    double n1 =n;
    double p1 =p;
    double q1 =q;
    double r1 =r;
    if(a[id(p,q,r)]!=-1)return a[id(p,q,r)];
    if((p==0)&&(q==0)&&(r==1)) return n1;
    double y =p1+q1+r1;
    double x = 0;
    if(p>0) x+=(p1/y)*(n1/y + pr(a,p-1,q+1,r));
    if(q>0) x+=(q1/y)*(n1/y + pr(a,p,q-1,r+1));
    if(r>0) x+=(r1/y)*(n1/y + pr(a,p,q,r-1));
    //cout<<n<<" "<<y<<" "<<p<<" "<<q<<" "<<r<<" "<<x<<endl;
    a[id(p,q,r)] = x;
    return x;
}
int main()
{
    cin>>n;
    int c1=0,c2=0,c3=0;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        if(x==3)c1++;
        if(x==2)c2++;
        if(x==1)c3++;
    }
    double a[(n+1)*(n+1)*(n+1)];
    for(int i=0;i<=n;i++){
        for(int j=0;j<n+1;j++){
            for(int k=0;k<=n;k++)
                a[id(i,j,k)]=-1;
        }
    }
    printf("%.10f\n",pr(a,c1,c2,c3));
    return 0;
}

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

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 1000000
//3
typedef long long ll;
typedef pair<int,int> pii;
priority_queue< int > pq;
priority_queue< int , vector<int> , greater<int> > rpq;
set<int>s;
set <int > :: iterator itr; 
vector<int> vec[1001];
ll r,n,m,inp,tc;
int w;
const ll INF = 1e18L + 7;

ll solve(ll cost[], ll weight[], int total){
	vector<ll> dp(100100,INF);	
	dp[0] = 0;
//	cout<<"asd"<<endl; 
	for(int i=1 ; i<=n; i++){
		for(int j = total-cost[i] ; j>=0 ; j--){
			dp[j+cost[i]] = min(dp[j+cost[i]] ,dp[j]+weight[i] );
		}
	}
//	cout<<"asd"<<endl; 
	ll res=0;
	for(int i=0 ; i<= total ; i++){
		if(dp[i] <= w) res = max(res, (ll)i);
	}
	return res;
}
ll cost[100+7],weight[100+7];
int main()
{
	cin>>n>>w;
	for(int i=1 ;i<=n ;i++){
		cin>>weight[i]>>cost[i];
	}
	int total=0;
	for(int i= 1 ;i <= n ; i++){
		total+=cost[i];
	}
	cout<<solve(cost,weight,total)<<endl;
	return 0;
}

//65 900 17 13

Measured memory_bytes: 1024
#include <iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include <numeric>
#include<cmath>
#include<string>
using namespace std;
#define ll long long
int n;
int A,B,C;
vector<int> l;

int dfs(int cur,int a,int b,int c){
    if (cur == n){
        return (min(a,min(b,c))>0) ?abs(a-A)+abs(b-B)+abs(c-C)-30 :1000000000;
    }
    int ret1,ret2,ret3,ret4;
    ret1 = dfs(cur+1,a,b,c);
    ret2 = dfs(cur+1,a+l[cur],b,c)+10;
    ret3 = dfs(cur+1,a,b+l[cur],c)+10;
    ret4 = dfs(cur+1,a,b,c+l[cur])+10;
    return min(ret1,min(ret2,min(ret3,ret4)));
}

int main(void){

    cin >> n >> A >> B >> C;

    for(int i=0;i<n;i++){
        int tmp;
        cin >> tmp;
        l.push_back(tmp);
    }

    cout << dfs(0,0,0,0) << endl;

}

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

int main(){
  string S; cin >>S;
  int n = S.size();
  vector<int> v1, v2;
  v1.push_back(-1);
  v2.push_back(0);
  for(int i=1; i<n; i++){
    if(S[i]=='L' && S[i-1]=='R') v1.push_back(i); // "RL"のL部分の抽出
    if(S[i]=='R' && S[i-1]=='L') v2.push_back(i); // "LR"のR部分の抽出
  }
  v2.push_back(n);

  int ans[n];
  int k=1;
  for(int i=0;i<n;i++){
    if(i>=v2[k]) k++;
    if(i==v1[k]-1) {
      if((v2[k]-v2[k-1])%2 == 0) ans[i] = (v2[k]-v2[k-1])/2;
      else if((v1[k]-v2[k])%2 == 0) ans[i] = ((v2[k]-v2[k-1])+1)/2;
      else ans[i] = ((v2[k]-v2[k-1])-1)/2;
    } else if(i==v1[k]) ans[i] = (v2[k]-v2[k-1])-ans[i-1];
    else ans[i] = 0;
  }

  for(int i=0; i<n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 1532
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;
int N;
ll a[100000];
int main(){
	cin>>N;
	rep(i,N) cin>>a[i];
	ll ans=1e18;
	rep(t,2){
		ll s = 0;
		ll tmp = 0;
		rep(i,N){
			s+=a[i];
			ll ns = s;
			if((i&1)^t){
				if(s<=0) ns = 1;
			}else{
				if(s>=0) ns = -1;
			}
			tmp += abs(ns-s);
			s = ns;
		}
		chmin(ans,tmp);
	}
	cout<<ans<<endl;
}


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

int main() {
  
  int n,m;
  cin>>n>>m;
   vector<int> v(m);
  for (int i = 0; i < m; i++) {
  cin >> v.at(i);
}
  int k;
  k=0;
  for(int i=0;i<m;i++){
    k+=v.at(i);
  }
if(n<k){
  cout<<-1<<endl;
}
  else{
    cout<<n-k<<endl;
  }
}

Measured memory_bytes: 3672
#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>;

int main() {
  int n, k, c;
  cin >> n >> k >> c;
  string s;
  cin >> s;

  vector<int> l(0), r(0);
  rep(i,n) {
    if (s[i] == 'o') {
      if (l.size() < k) {
        l.push_back(i);
        i += c;
      } else {
        break;
      }
    }
  }

  rep(i,n) {
    if (s[n-i-1] == 'o') {
      if (r.size() < k) {
        r.push_back(n-i-1);
        i += c;
      } else {
        break;
      }
    }
  }

  rep(x,k) {
    if (l[x] == r[r.size()-x-1]) {
      cout << (l[x] + 1) << endl;
    }
    // cout << l[x] << " " << r[x] << endl;
  }
}


Measured memory_bytes: 3448
n = int(input())
a = list(map(int, input().split()))


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


def isprime(x):
    for i in range(2, int(x**0.5) + 1):
        if x % i == 0:
            return False
    return True


def div_primes(x):
    ret = {}
    for i in range(2, int(x**0.5) + 1):
        tmp = 0
        while x % i == 0:
            tmp += 1
            x //= i
        if tmp > 0:
            ret[i] = tmp
    if x > 1:
        ret[x] = 1
    return ret


f = a[0]
for i in range(1, n):
    f = gcd(a[i], f)

if f >= 2:
    print("not coprime")
    exit()

# 10^6以下の素数
hurui = [True for _ in range(10**6 + 1)]
hurui[0] = hurui[1] = False
primes = {}
for i in range(2, len(hurui)):
    if hurui[i]:
        primes[i] = 0
        for j in range(i * 2, len(hurui), i):
            hurui[j] = False

flag = True
for av in a:
    if av in primes:
        if primes[av] == 0:
            primes[av] = 1
        else:
            flag = False
            break
    else:
        divs = div_primes(av)
        for k in divs.keys():
            if primes[k] == 0:
                primes[k] = 1
            else:
                flag = False
                break
    if flag == False:
        break

if flag:
    print("pairwise coprime")
else:
    print("setwise coprime")

# 6
# 4 7 9 11 5 13

Measured memory_bytes: 133480
#include<cstdio>
#include<cstring>
#include<stack>
#include<algorithm>
#define MAXN 200000
using namespace std;
char str[MAXN+5];
stack<char> stk;
int main()
{
	scanf("%s",str);
	int len=strlen(str);
	int ans=len;
	for(int i=0;i<len;i++)
	{
		if(str[i]=='T')
		{
			if(stk.empty()==false)
			{
				char tp=stk.top();
				if(tp=='S')
					stk.pop(),ans-=2;
			}
		}
		else
			stk.push(str[i]);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 512
//includes
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#include<numeric>
#include<assert.h>
#include<cstring>
#include<unordered_map>
#include<bitset>

//macros and consts
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define FORE(i,a) for(auto &i : a)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define accm accumulate
#define Fi first
#define Se second
#define INF 1e9
#define llINF (1LL<<60)
#define mINF -1e9
#define mllINF -(1LL<<60)
#define endl "\n"
#define CONT continue
#define BRK break
#define modulo(n, m) (((n)%(m)+(m))%m)

//shorter types
using namespace std;
using ll = long long;
using vi = std::vector<int>;
using vc = std::vector<char>;
using vll = std::vector<long long>;
using vs = std::vector<string>;
using Mi = map<int,int>;
using Mll = map<ll,ll>;
using UMi = unordered_map<int,int>;
using UMll = unordered_map<ll,ll>;
using Pi = pair<int,int>;
using Pll = pair<ll,ll>;
using vPi = vector<Pi>;
using vPll = vector<Pll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using pqgi = priority_queue<int,vector<int>,greater<int>>;
using pqsi = priority_queue<int,vector<int>,less<int>>;
using pqgll = priority_queue<int,vector<int>,greater<int>>;
using pssll = priority_queue<int,vector<int>,less<int>>;
template<class T>
using vec = vector<T>;

//here begins your code
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  int N;

  cin >> N;
  int min = INF;
  int ans = 0;
  for(int i = 0; i < N; i++){
  	int p;
  	cin >> p;
  	if(p <= min){
  		ans++;
  		min = p;
  	}
  }
  cout << ans << endl;


  //check types
  //do not eb if you resize
  //resize before you access by idx
  return 0;
} 

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  long int n,d;
  long int x,y;
  int ans=0;
  scanf("%ld%ld",&n,&d);
  for(int i=0;i<n;i++){
    scanf("%ld%ld",&x,&y);
    if((x*x)>(d*d) || (y*y)>(d*d)){
      continue;
    }else if((x*x+y*y)<=(d*d)){
      ans++;
    }
  }
  printf("%d\n",ans);
 
  return 0;
}

Measured memory_bytes: 1728
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin >> s;
	for(int i=0; i<s.size(); i++){
		if(s[i] == 'C'){
			for(int j=i+1; j<s.size(); j++){
				if(s[j] == 'F'){
					cout << "Yes";
					return 0;
				}
			}
		}
	}
	cout << "No";
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-9;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}

int main(){
	int a;scanf("%d",&a);
	if(a%2==0)printf("%d\n",a);
	else printf("%d\n",a*2);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
typedef
tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> order_set;
const ll mod=1e9+7;
const int N=2e6+10;
const int M=20;

ll power(ll x, unsigned ll y, ll p)
{
     ll res = 1; 
     x = x % p;
     while (y > 0)
     {
         if (y & 1)
             res = (res*x) % p;
         y = y>>1;
         x = (x*x) % p;  
     }
    return res;
}


int main() 
{
    FAST;
    srand(time(NULL));
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int d;
    cin >> d;
    if(d==25)
        cout << "Christmas";
    else if(d==24)
        cout << "Christmas Eve";
    else if(d==23)
        cout << "Christmas Eve Eve";
    else
        cout << "Christmas Eve Eve Eve";
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll MOD = 1e9+7;

int main(){
    ll A, B, H, M;
    cin >> A >> B >> H >> M;

    long double x = (H + M/60.0) / 12.0;
    long double y = M / 60.0;

    long double diff = fabs(x - y);
    //cout << diff << endl;

    long double c = cos(2*M_PI * diff);
    //cout << c << endl;

    long double ans = A*A + B*B - 2*A*B*c;
    ans = sqrt(ans);

    printf("%.16Lf\n", ans);
    return 0;
}


Measured memory_bytes: 4060
import java.util.Scanner;

class Main{

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int A = Integer.parseInt(scanner.next());
        int B = Integer.parseInt(scanner.next());

        int unhide = A - B * 2;

        if(unhide < 0) {
            unhide = 0;
        }
        
        System.out.println(unhide);

        scanner.close();
    }
}

Measured memory_bytes: 22868
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h>
#include <cmath>

using namespace std;

bool isPalindrome(int x) {
    string s = to_string(x);
    string v;
    for (int i = s.length()-1; i>=0; i--) {
        v += s[i];
    }
    for (int i=0; i<s.length(); i++) {
        if (s[i] != v[i]) return false;
    }
    return true;
}

int main()
{
    int a, b;
    cin >> a >> b;
    int cnt = 0;
    for (int i=a; i<=b; i++) {
        if (isPalindrome(i)) cnt++;
    }
    cout << cnt << '\n';
    
    return 0;
}

Measured memory_bytes: 3676
#include <stdio.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x) {
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x) {
    int f = 0;
    cerr << '{';
    for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
    __print(t);
    if (sizeof...(v)) cerr << ", ";
    _print(v...);
}
#ifdef LOCAL
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif

#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)

typedef long long ll;

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N, M;
    cin >> N >> M;

    ll ans = 0;
    if (N >= 2) {
        ans += (N * (N - 1)) / 2;
    }
    if (M >= 2) {
        ans += (M * (M - 1)) / 2;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
    #include <iostream>
    #include <algorithm>
    #include <set>
    #include <map>
    #include <queue>
    #define N 100010
     
    using namespace std;
     
    typedef pair<int,int> par;
     
    int n;
    int fa[N];
    map<par,int> M,A;
    multiset<int> S[N];
    queue<par> Q;
     
    inline par makep(int x,int y){
    	if(x>y) return par(y,x);
    	return par(x,y);
    }
     
    int find(int x){
    	return x==fa[x]?x:fa[x]=find(fa[x]);
    }
     
    int main(){
    	scanf("%d",&n);
    	for(int i=1;i<=n;i++) fa[i]=i;
    	for(int i=1;i<=2*n-2;i++){
    		int x,y; par z;
    		scanf("%d%d",&x,&y);
    		z=makep(x,y);
    		S[x].insert(y); S[y].insert(x);
    		if((++M[z])>1&&!A.count(z))
    			A[z]=1,Q.push(z);
    	}
    	for(int k=1;k<n;k++){
    		int x,y;
    		while(1){
    			if(Q.empty()) return puts("NO"),0;
    			x=find(Q.front().first),y=find(Q.front().second); Q.pop();
    			if(x!=y) break;
    		}
    		if(S[x].size()>S[y].size()) swap(x,y); fa[x]=y;
    		for(set<int>::iterator i=S[x].begin();i!=S[x].end();i++){
    			int v=find(*i);
    			if(v==y) continue;
    			S[y].insert(v); S[v].insert(y);
    			if((++M[makep(y,v)])>1&&!A.count(makep(y,v)))
    				Q.push(makep(y,v)),A[makep(y,v)]=1;
    			S[v].erase(S[v].find(x));
    		}
    		S[y].erase(x);
    		S[x].clear();
    	}
    	puts("YES");
    	return 0;
    }

Measured memory_bytes: 41088
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i=(a); i<(int)(b); i++)
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
using namespace std;
 
const int maxN = 1 << 19;

char in[maxN];
int T[maxN];
int n;

inline void remax(int& a, int b)	{   a = max(a, b);  }

void f(int i)
{
	int i0 = i;
	while (i > 0 and in[i-1] == '>')
		remax(T[i-1], T[i]+1), i--;
	i = i0;
	while (in[i] == '<')
		remax(T[i+1], T[i]+1), i++;
}

void solve()
{
	scanf ("%s", in);
	n = strlen(in) + 1;
	FOR(i, 0, n)
	{
		if (i == 0 and in[i] == '<')
			f(i);
		if (i != 0 and in[i-1] == '>' and in[i] == '<')
			f(i);
		if (i == n-1 and in[i-1] == '>')
			f(i);
	}
	
	long long sum = 0;
	FOR(i, 0, n)
		sum += T[i];
	printf("%lld\n", sum);
}
 
int main()
{
	int t;
	t = 1;//scanf ("%d", &t);
	while (t--)
		solve();
	return 0;
}


Measured memory_bytes: 2688
import sys
import numpy as np


def main(stdin):
    N, K, Q = stdin[:3]
    ans = np.full(N + 1, K - Q, dtype=np.int64)
    for i in stdin[3:]:
        ans[i] += 1
    ans = np.where(ans > 0, 'Yes', 'No')
    return ans[1:]


if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'i8[:](i8[:],)')(main)
    # b1: bool, i4: int32, i8: int64, double: f8, [:], [:, :]
    cc.compile()
else:
    #from my_module import main
    stdin = np.array([int(_) for _ in open(0).read().split()])
    print(*main(stdin), sep='\n')


Measured memory_bytes: 40732
#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
vector<long> fact_inv, inv, Com;
void init_nCk(int n,int k){
  fact_inv.resize(k+5);
  inv.resize(k+5);
  fact_inv[0]=fact_inv[1]=1;
  inv[1]=1;
  for(int i=2;i< k+5;i++){
    inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
    fact_inv[i]=fact_inv[i-1]*inv[i]%MOD;
  }
  Com.resize(k+5);
  Com[0]=1;
  for(int i=1;i<k+5;i++){
    Com[i]=Com[i-1]*((n-i+1)*inv[i]%MOD)%MOD;
  }
}
int K,i,a;
long x=1,ans=0;
int nCk(int k){
    assert(!(k<0));
    return Com[k];
}
int main(){
  string S;
  cin>>K>>S;
  a=K+S.size();
  init_nCk(a,K);
  for(i=0;i<=K;i++){
    ans+=x*nCk(i);
    ans%=MOD;
    x*=25;
    x%=MOD;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 27740
import Control.Monad
main=do
 [n,m]<-map read.words<$>getLine
 i<-replicateM m$(\[s,c]->(\a->a!!((read s)-1)==(c!!0))).words<$>getLine
 let j=filter(\a->all(id)$map(\f->f a)i)[b|b<-map show[0..1000],length b==n]
 putStrLn$if null j then"-1"else j!!0

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

#define F first
#define S second
#define pii pair<int, int>
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 2e5 + 10;

int a[N];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin >> n;
	for (int i=0; i<n; i++) cin >> a[i];
	
	ll ans = 0;

	for (int i=n-1; i>=0; i--)
	{
		if(a[i] > i) return cout << "-1\n", 0;
		if(i + 1 < n && a[i + 1] - a[i] > 1) return cout << "-1\n", 0;
		if(i + 1 < n && a[i + 1] == a[i] + 1) continue ;
		ans += a[i];
	}
	cout << ans << endl;

}


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

class Program
{
    static void Main()
    {
        Console.WriteLine(Solve());
        return;
    }

    public static string Solve()
    {
        int[] input = ReadInts();
        int A = input[0];
        int P = input[1];

        long ans = (A*3+P)/2;
        return ans.ToString();
    }

    private static string Read() { return Console.ReadLine(); }
    private static int ReadInt() { return int.Parse(Read()); }
    private static long ReadLong() { return long.Parse(Read()); }
    private static double ReadDouble() { return double.Parse(Read()); }
    private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
    private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
    private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
}


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

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

template<typename T = long long> T toInteger(const string&);

template<> int toInteger<int>(const string& s) {
  return stoi(s);
}

template<> long toInteger<long>(const string& s) {
  return stol(s);
}

template<> long long toInteger<long long>(const string& s) {
  return stoll(s);
}

template<typename T = long long> T toInteger(const string& s, int n) {
  T res = 0;
  for (char c : s) {
    if (isdigit(c)) res = res * n + c - '0';
    else if (isalpha(c)) res = res * n + tolower(c) - 'a' + 10;
  }
  return s[0] == '-' ? -res : res;
}

template<typename T> struct Digit {
  T operator() (string& s, int& p) {
    if (!isdigit(s[p])) throw "empty term";
    if (s[p] == '0' && p + 1 < (int)s.size() && !isdigit(s[p + 1])) throw "leading zeros";
    string res;
    for (; isdigit(s[p]); ++p) res += s[p];
    return toInteger<T>(res);
  }
};

template<typename T> struct LeadingZeros {
  T operator() (string& s, int& p) {
    if (!isdigit(s[p])) throw "empty term";
    string res;
    for (; isdigit(s[p]); ++p) res += s[p];
    return toInteger<T>(res);
  }
};

template<typename T = long long, typename Lexer = Digit<T>> class Parser {
private:
  string s;
  int p;
  unordered_map<char, function<T(T)>> unary_operator;
  vector<unordered_map<char, function<T(T, T)>>> binary_operator;
  unordered_map<char, char> brackets;

  T term() {
    if (brackets.count(s[p])) {
      const char end = brackets[s[p]];
      ++p;
      T res = expr(0);
      if (s[p] != end) throw "mismatch brackets";
      ++p;
      return res;
    }
    if (unary_operator.count(s[p])) {
      auto f = unary_operator[s[p]];
      ++p;
      return f(term());
    }
    Lexer lexer;
    return lexer(s, p);
  }

  T expr(size_t level) {
    if (level == binary_operator.size()) return term();
    T res = expr(level + 1);
    for (char c; c = s[p++], binary_operator[level].count(c);) res = binary_operator[level][c](res, expr(level + 1));
    --p;
    return res;
  }

public:
  void addUnaryOperator(function<T(T)> func, char c) {
    unary_operator[c] = func;
  }

  void addBinaryOperator(function<T(T, T)> func, char c, size_t level) {
    if (binary_operator.size() <= level) binary_operator.resize(level + 1);
    binary_operator[level][c] = func;
  }

  void addBrackets(char begin, char end) {
    brackets[begin] = end;
  }

  long long parse(const string& s) {
    this->s = s;
    p = 0;
    return expr(0);
  }
};

template<typename T = long long> T parse(const string& s) {
  Parser<T> parser;
  parser.addUnaryOperator([](T t){return +t;}, '+');
  parser.addUnaryOperator(negate<T>(), '-');
  parser.addBinaryOperator(plus<T>(), '+', 0);
  parser.addBinaryOperator(minus<T>(), '-', 0);
  parser.addBinaryOperator(multiplies<T>(), '*', 1);
  parser.addBinaryOperator(divides<T>(), '/', 1);
  parser.addBrackets('(', ')');
  return parser.parse(s);
}

int main() {
  string a, op, b;
  cin >> a >> op >> b;
  cout << parse(a + op + b) << endl;
}


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

using u32 = uint32_t;
using u64 = uint64_t;
using i32 = int32_t;
using i64 = int64_t;

int main()
{
	std::ios_base::sync_with_stdio(0);
	
	u32 n;

	std::cin >> n;

	u32 k;

	std::cin >> k;

	u32 res = 0;

	for(u32 i=0; i<n; i++)
	{
		u32 x;
		std::cin >> x;

		if(x>=k) res++;
	}

	std::cout << res << "\n";
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define int long long int
int bs(int s,int e,int v)
{
	if(s<=e)
	{
		int m=(s+e)/2;
		if(m*(m+1)>=2*v)
		{
			int x=m;
			int y=bs(s,m-1,v);
			if(y==-1)
			   return x;
			else
			   return y;
		}
		else
		    return bs(m+1,e,v);
	}
	return -1;
}
int32_t main()
{
	int x;
	cin>>x;
	int val=bs(1,1000000000,x);
	cout<<val<<endl;
}


Measured memory_bytes: 256
'use strict'

const INF = 900719925474099;
function mapint(temp){
  return temp.split(' ').map((v)=>parseInt(v));
}

function Main(input){
  let temp = input.trim().split('\n');
  let n = temp[0];
  let a = new Array(n);
  let f = 0;
  let s = 0;

  for(let i=1;i<=n;i++){
    a[i-1] = parseInt(temp[i]);
    if(f<=a[i-1]){
      s = f;
      f = a[i-1];
    }else if(s<a[i-1]){
      s = a[i-1];
    }
  }

  let ans = new Array(n);
  for(let i=0;i<n;i++){
    if(f == a[i]){
      ans[i] = s;
    }else{
      ans[i] = f;
    }
  }
  console.log(ans.join('\n'));
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



Measured memory_bytes: 48600
#include <iostream>
#include<cmath>
#include<vector>
#include<map>
#include<sstream>
#include<deque>
#include<iomanip>
#include<algorithm>
#include<set>
#include<queue>
#include<bitset>
#include<stack>
#include<unordered_set>
#include<cstring>
#include<list>
using namespace std;
//	int x=atoi(s.c_str()); s_to_in;
int dx[] = { -1,0,0,1 };
int dy[] = { 0,1,-1 ,0 };
#define endl '\n'
long long mo = 1e9;
const long double P = 3.141592653589793238L;
void trust_yourself()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
long long gcd(long long x, long long y)
{
	if (x == 0)
		return y;
	return gcd(y%x, x);
}
long long fast_power(long long x, long long y, long long mo)
{
	long long p = 1;
	while (y)
	{
		if (y & 1)
			p = (p*x) % mo;
		y = (y >> 1); //y/=2
		x = (x*x) % mo;
	}

	return p;
}
long long convert_to_num(string x) {
	long long  num = 0;
	for (int i = 0; i < x.size(); i++) {
		num *= 2;
		num += x[i] - '0';
	}
	return num;
}

long long com(long long n, long long r) {
	long long p = 1, p1 = 1;
	for (long long i = r + 1; i <= n; i++) {
		p = p * i;
		p /= p1;
		p1++;
	}
	return p;
}


int main()
{
	trust_yourself();
	//freopen("hussien.in", "r", stdin);
	long long a, b, c;
	cin >> a >> b >> c;
	if (c < b)
	{
		cout << (a*c) / b;
	}
	else {
		c = b - 1;
		cout << (a*c) / b;
	}
	
	return 0;

}


Measured memory_bytes: 3652
#include<stdio.h>

void input(int);
void shokika(int);
void shori(int, int);

typedef struct{
  int num;
  int min;
  int next[100];
} Data;

int cnt, min;
Data data[101];

int main(){

  int i, n;

  scanf("%d",&n);

  for(i = 1; i <= n; i++)shokika(i);
  for(i = 1; i <= n; i++)input(i);
  shori(1, 0);
  for(i = 1; i <= n; i++)
  {
    if(data[i].min != 9999)printf("%d %d\n",i,data[i].min);
    else printf("%d -1\n",i);
  }
  return 0;
}

void shori(int now, int keiro)
{
  int i;

  if(data[now].min > keiro)
  {
    data[now].min = keiro;
    for(i = 0; data[now].next[i] != -1; i++)
    {
      //printf("data[%d].min = %d\n%d → %d\n",now,keiro,now,data[now].next[i]);
      shori(data[now].next[i], keiro + 1);
      //printf("%d ← %d\n",now,data[now].next[i]);
    }
  }
}

void input(int n)
{
  int i, x;

  cnt = 0;

  scanf("%d%d",&data[n].num,&x);

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

void shokika(int n)
{
  int i;
  for(i = 0; i < 100; i++)data[n].next[i] = -1;
  data[n].min = 9999;
}



Measured memory_bytes: 2112
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

#define N  100005

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		ll a,b,c,d;
		cin>>a>>b;
		cin>>c>>d;
		cout<<a*b-(c*b+d*(a-c));
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

#define LL long long
int n, a, b;

int main() {
    #ifdef LOCAL
    freopen("test.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
    #endif // LOCAL
    ios::sync_with_stdio(false);

    while(scanf("%d%d%d", &n, &a, &b) != EOF) {
        a %= 2;
        b %= 2;
        if(a == b) {
            printf("Alice\n");
        } else {
            printf("Borys\n");
        }
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define f(a,b) for(int i = a; i < b; i++)
#define mod 1000000007
#define inf (1LL<<60)
#define all(x) (x).begin(), (x).end()
#define prDouble(x) cout << fixed << setprecision(10) << x
#define triplet pair<ll,pair<ll,ll>>
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
const int MAXN = 500005;
using namespace std;
int arr[MAXN],dp[MAXN];
int main() {
   /*ifstream cin("input.txt");
   ofstream cout("output.txt");*/
   map<ll,ll>map1;
   int n,sum;
   cin>>n;
   for(int i=1;i<=100;i++){
   		for(int j=1;j<=100;j++){
   			for(int k=1;k<=100;k++){
   				sum=((i+j)*(i+j))+((i+k)*(i+k))+((j+k)*(j+k));
   				if(sum<=2*n){
   					map1[sum/2]++;
   				}

   			}
   		}
   }
   for(int i=1;i<=n;i++){
   		cout<<map1[i]<<endl;
   }
   return 0;
}

Measured memory_bytes: 4180
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i <= (n); i++)
#define repi(i,a,b) for (int i = (a); i < (b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;

int main() {
  int N;
  cin >> N;
  
  if (N%10 == 9 || N/10 == 9) 
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        var n = long.Parse(Console.ReadLine());
        var ans = long.MaxValue;
        for (long i = 1; i * i <= n; i++)
        {
            if (n % i == 0)
            {
                ans = Math.Min(ans,
                    Math.Max(f(i), f(n / i)));
            }
        }
        Console.WriteLine(ans);
    }

    static long f(long x)
    {
        var ans = 0;
        while (x != 0)
        {
            ans++;
            x /= 10;
        }
        return ans;
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

void _main() {
    int N, K;
    cin >> N >> K;
    const int MOD = 1000000007;
    int ans = 0;
    FOR (i, K, N + 2) {
        int lb = (i - 2) * (i - 1) / 2;
        int ub = lb + i * (N - i + 1);
        (ans += ub - lb + 1) %= MOD;
    }
    cout << ans << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 3660
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <limits.h>
using namespace std;
typedef vector<int> vi;
int n;
typedef long long ll;
typedef vector<ll> vll;
ll ans=0,x;
int main(int argc,char const* argv[])
{
  cin >> n >> x;
  vll a(100005);
  for(int i=0;i<n;i++)
    {
      cin >> a[i];
    }
  for(int i=0;i<n-1;i++)
    {
      if(a[i]>x)
	{
	  ans+=a[i]-x;
	  a[i]=x;
	  ans+=a[i+1];
	  a[i+1]=0;
	}
      else if(a[i]+a[i+1]>x && a[i]<=x)
	{
	  ans+=(a[i+1]+a[i]-x);
	  a[i+1]-=(a[i+1]+a[i]-x);
	}
    }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <math.h>

int main () {
  int n = 0, num[10000], i, x = 2, cnt = 0, h = 0;
  for(i = 0 ; i < 10000 ; i++) num[i] = 0;

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

  for(i = 0 ; i < n ; i++) {
    
    while(sqrt((double)num[i]) >= x) {
      if(num[i] % x == 0) {
	h = 1;
	break;
      }
      x++;
    }
    if(h == 0) cnt++;
    h = 0;
    x = 2;
  }

  printf("%d\n",cnt);
  return 0;
}



Measured memory_bytes: 2068
import itertools
import math
N = int(input())
S = [list(map(int, input().split())) for i in range(N)]
perm = list(itertools.permutations([i for i in range(1, N + 1)]))
#perm = [list(perm[i]) for i in range(perm)]
sum_d = 0
for i in range(len(perm)):
  #perm[i] = list(perm[i])
  for j in range(1, N):
    #print(i, end="")
    #print(math.sqrt((S[perm[i][j] - 1][0] - S[perm[i][j - 1] - 1][0]) ** 2 + (S[perm[i][j] - 1][1] - S[perm[i][j - 1] - 1][1]) ** 2))
    sum_d += math.sqrt((S[perm[i][j] - 1][0] - S[perm[i][j - 1] - 1][0]) ** 2 + (S[perm[i][j] - 1][1] - S[perm[i][j - 1] - 1][1]) ** 2)

print(sum_d / len(perm))
   

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

int main() {
  
  int N; cin >> N; double sum = 0.0;
  
  for (int i = 0; i < N; i++) {
    double A; cin >> A;
    A = 1 / A; sum += A;
  }
  
  cout << fixed << setprecision(10);
  
  cout << 1 / sum << endl;
  
}

Measured memory_bytes: 256
<?php
# 数値の入力
$data1=trim(fgets(STDIN));
$a = explode(" ",trim(fgets(STDIN)));

$anser = $a[0]+$a[$data1-2];
for($i=0; $i<$data1-2; $i++){
    if($a[$i]>$a[$i+1]){
        $anser += $a[$i+1];
    }else{
        $anser += $a[$i];
    }
}
echo $anser;
?>


Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 100005;

map<int, int> mp;

int main()
{
    int N, x;
    scanf("%d", &N);
    for(int i = 0; i < N; i++){
        scanf("%d", &x);
        mp[x]++;
    }
    int ans = 0;
    for(map<int, int>::iterator it = mp.begin(); it != mp.end(); it++){
        x = it->first;
        int res = mp[x];
        if(mp.find(x - 1) != mp.end()){
            res += mp[x - 1];
        }
        if(mp.find(x + 1) != mp.end()){
            res += mp[x + 1];
        }
        ans = max(ans, res);
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 3200
import java.util.*;

public class Main {
	public static void main(String[] argv) {
		Scanner in = new Scanner(System.in);
		int size = in.nextInt();
		int[] heap = new int[size + 1];

		for (int i = 1; i <= size; i++)
			heap[i] = in.nextInt();
		in.close();
		
		for (int i = 1; i <= size; i++) {
			System.out.print("node " + i + ": key = " + heap[i] + ", ");
			if (i / 2 > 0)
				System.out.print("parent key = " + heap[i/2] + ", ");
			if ((i * 2) <= size)
				System.out.print("left key = " + heap[i*2] + ", ");
			if ((2*i + 1) <= size)
				System.out.print("right key = " + heap[(2*i) + 1] + ", ");
			System.out.println();
			
		}
	}
}



Measured memory_bytes: 27116
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<cstdio>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define inf 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}

void solve(){
	int n,x,t;
	cin>>n>>x>>t;
	int ans=(n+x-1)/x*t;
	cout<<ans<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
typedef string::const_iterator state;
string s;

int expression(state&);
int number(state &b){
    int ret=*b-'0';
    b++;
    return ret;
}

int factor(state &b){
    if(*b=='('){
        b++;
        int ret=expression(b);
        b++;
        return ret;
    }
    return number(b);
}

int rev(state &b){
    if(*b=='-'){
        b++;
        int ret=rev(b);
        if(ret==0)return 2;
        if(ret==2)return 0;
        return 1;
    }
    return factor(b);
}

int expression(state &b){
    int ret=rev(b);
    while(true){
        if(*b=='+'){
            b++;
            ret=max(ret,rev(b));
        }
        else if(*b=='*'){
            b++;
            ret=min(ret,rev(b));
        }
        else break;
    }
    return ret;
}

int main(){

    string t;
    while(cin>>t,t!="."){
        s=t+"=";

        int ans=0;
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                for(int k=0;k<3;k++){
                    for(int l=0;l<t.size();l++){
                        if(t[l]=='P')s[l]=i+'0';
                        if(t[l]=='Q')s[l]=j+'0';
                        if(t[l]=='R')s[l]=k+'0';

                    }
                    state b=s.begin();
                    if(expression(b)==2)ans++;

                }
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 1196