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

#define ll long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;

ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
int main() {
    //COMint();
    int D=in();
    int N=in();
    ll ans;
    ans=pow(100,D)*(N+(N/100));
    print(ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[102],cnt[102]={};
    
    for(int i=0;i<=n-1;i++)
    	cin>>a[i];
    
    for(int i=0;i<=n-1;i++)
    		cnt[a[i]]=1;
    			
    int ans=0;
    for(int i=0;i<=100;i++)
    	if(cnt[i]==1)
    		ans++;
    
	cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define double long double
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=1e9+7;
int main(){
    string s,t;cin>>s>>t;
    ll a,b;cin>>a>>b;
    string u;cin>>u;
    if(s==u)a--;
    if(t==u)b--;
    cout<<a<<' '<<b<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
inline int getInt() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("IMPOSSIBLE"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;



int main() {
  int a,b;
  scanf("%d%d",&a,&b);
  if (a+b&1) dame;
  cout<<(a+b)/2<<endl;
  return 0;
}






















Measured memory_bytes: 256
// AOJ 2149: Luck Manipulator
// 2017.11.9 bal4u@uu

#include <stdio.h>
#include <string.h>

int y[102];

int main()
{
	int n, a, b, c, x, i, j, ans;
	
	while (scanf("%d%d%d%d%d", &n, &a, &b, &c, &x) && n > 0) {
		ans = 0;
		for (i = 0; i < n; i++) {
			scanf("%d", y+i);
			if (y[i] >= c) ans = -1;
		}
		if (!ans) {
			ans = -1, j = 0;
			i = 10001; while (i--) {
				if (y[j] == x) if (++j == n) { ans = 10000-i; break; }
				x = (a*x+b) % c;
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1744
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe (fromJust)

main :: IO ()
main = do
  k <- getInt
  s <- BS.getLine
  let ans
        | BS.length s > k = BS.take k s `BS.append` BS.pack "..."
        | otherwise = s
  BS.putStrLn ans

getInt :: IO Int
getInt = fst . fromJust . BS.readInt <$> BS.getLine


Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
const ll MOD = 1e9+7;

int main(){
//  ios::sync_with_stdio(false);
//  cin.tie(0);
  ll k,a,b;
  cin >> k >> a >> b;
  if (a >= k) cout << 1 << endl;
  else if (b >= a) cout << -1 << endl;
  else {
    cout << (k-(a-(a-b))+(a-b)-1)/(a-b)*2-1 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
// vj 259706 B
#include <cstdio>

int main() {
	int N, ans = 0;
	scanf("%d", &N);
	for (int i = 3; i <= N; i += 2) {
		int cnt = 0;
		for (int j = 1; j * j <= i; j++)
			if (i % j == 0) {
				++cnt;
				if (i * i != j) ++cnt;
			}
		if (cnt == 8) ++ans;;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 256
def gcd(a, b):
    rest = a % b
    while(rest):
        a = b
        b = rest
        rest = a % b
    return b

n = int(input())
vals = [int(x) for x in input().split(" ")]
vals.sort()
vals.reverse()

rewrite = False

minindex = 0

minval = vals[0]
for b in vals[1:]:
    temp = b
    a = minval
    tempmin = minval
    
    minval = gcd(a, b)
    if minval < tempmin:
        minindex = temp

if len(vals) > 2 and vals[1] == minindex:
    # 調整
    v1 = gcd(vals[0], vals[2])
    v2 = gcd(vals[1], vals[2])
    if v1 < v2:
        minindex = vals[0]

if minindex == vals[0]:
    minval = vals[1]
else:
    minval = vals[0]

jump = False

for b in vals[1:]:
    if not jump and b == minindex:
        jump = True
        continue
    a = minval
    minval = gcd(a, b)

print(minval)


Measured memory_bytes: 14436
#include<stdio.h>
int main(){
  int d,t,s;
  float time;
  ///読み込み
  scanf("%d %d %d",&d,&t,&s);
  //printf("%d %d %d",d,t,s);
  time=(float)d/(float)s;
  if(time <= t){
    printf("Yes");
  }
  else{
    printf("No");
  }
  return 0;
}

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

#define loop(i) for(int lp=0;lp<(i);lp++)

#define pb push_back

using namespace std;

int main() {
	int n, S;
	vector<int> r;

	while(cin >> n >> S, n||S) {
		r.clear();
		
		int tmp;
		loop(n) {
			cin >> tmp;
			r.pb(tmp);
		}

		sort(r.begin(), r.end());

		int ans = 0;
		for(int i = 0; i < n-1; i ++) {
			int v = S-r[i];
			int pos = upper_bound(r.begin()+(i+1), r.end(), v) - r.begin();
//			cout << " " << pos << " " << n-pos+1 << endl;
			ans += n-pos;
		}

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

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

using namespace std;

int main()
{
    string str;
    cin >> str;
    for(int i=1;i<str.size();i++)
    {
        if(str[i]==str[i-1])
        {
            printf("Bad");
            return 0;
        }
    }
    printf("Good");
    return 0;
}


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

int main()
{
    int d, t, s;
    cin >> d >> t >> s;
    if (s * t >= d) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3608
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

using namespace std;

typedef int64_t ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tupiii;
typedef tuple<ll, ll, ll> tuplll;

const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;
const int MOD = 1000000007;

template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
inline void swap(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
inline void swap(int& a, int& b) { a ^= b; b ^= a; a ^= b; }

ll n, a, b;
vi hp;

void init()
{
	cin >> n >> a >> b;
	a -= b;
	hp.resize(n);

	REP(i, n)
	{
		cin >> hp[i];
	}
}

bool test(ll t)
{
	ll cnt = 0;

	REP(i, n)
	{
		ll tmp = hp[i] - t * b;

		if (tmp > 0)
			cnt += (tmp + a - 1) / a;

		if (cnt > t)
			return false;
	}

	return true;
}

int main()
{
	init();

	ll ng = 0;
	ll ok = 10e9;


	while (ok - ng > 1)
	{
		ll mid = (ok + ng) / 2;

		if (test(mid))
			ok = mid;
		else
			ng = mid;
	}


	cout << ok << endl;
}


Measured memory_bytes: 640
let bfs vs n =
  let d = Array.make n (-1) in
  let q = Queue.create () in
  d.(0) <- 0;
  Queue.add 0 q;
  while not (Queue.is_empty q) do
    let i = Queue.take q in
    List.iter (fun v ->
      if d.(v-1) <> (-1) then ()
      else begin
        d.(v-1) <- d.(i) + 1;
        Queue.add (v-1) q;
      end)
      vs.(i);
  done;
  d

let split_on_char sep s =
  let open String in
  let r = ref [] in
  let j = ref (length s) in
  for i = length s - 1 downto 0 do
    if get s i = sep then begin
      r := sub s (i + 1) (!j - i - 1) :: !r;
      j := i
    end
  done;
  sub s 0 !j :: !r

let () =
  let n = read_int () in
  let vs = Array.make n [] in
  for _ = 0 to n - 1 do
    match read_line () |> split_on_char ' ' |> List.map int_of_string with
    | u :: _ :: l -> vs.(u-1) <- l
    | _ -> assert false
  done;
  bfs vs n |> Array.iteri (fun i e -> Printf.printf "%d %d\n" (i + 1) e)

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

#define fi first
#define se second

const int N = 100100;
const int Q = 200200;
const long long mod = 1e9 + 7;

using namespace std;


int main()
{
        //freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
        //freopen("teleports.in", "r", stdin);
        //freopen("teleports.out", "w", stdout);
        ios_base::sync_with_stdio(0);

        int n, k;
        cin >> n >> k;
        cout << n - k + 1 << "\n";
}


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

#define mod 1'000'000'007
typedef long long ll;

template<typename T>
void deb(initializer_list<T> l)
{
	for (auto &e : l)
		cout << e << ' ';
	cout << endl;
}

void solve()
{
	int x, y;
	cin >> x >> y;
	for (int i = 0; i <= x; ++i)
	{
		int rem = x - i;
		if (2 * i + 4 * rem == y)
		{
			cout << "Yes\n";
			return;
		}
	}
	cout << "No\n";
}

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

	int t = 1;
	// cin >> t;
	while (t--)
		solve();

	return 0;
}


Measured memory_bytes: 3612
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        x: usize,
    }
    
    match x {
        400...599 => println!("8"),
        600...799 => println!("7"),
        800...999 => println!("6"),
        1000...1199 => println!("5"),
        1200...1399 => println!("4"),
        1400...1599 => println!("3"),
        1600...1799 => println!("2"),
        1800...1999 => println!("1"),
        _ => return,
    }


}

Measured memory_bytes: 2172
#!python3

# input
N = int(input())
A = list(map(int, input().split()))


def main():
    d = {i: 0 for i in range(-1, 10 ** 5 + 2)}
    for a in A:
        d[a] += 1

    ans = 0
    for i in range(max(A) + 1):
        s = d[i - 1] + d[i] + d[i + 1]
        ans = max(ans, s)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 19704
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

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

    int n;
    cin >> n;
    VI a(n);
    REP(i,n) {
        cin >> a[i];
    }
    int ans=n;
    sort(ALL(a));
    for ( int i=0; i<n; i++ ) {
        int x=a[i];
        vector<int> p;
        for ( int j=1; j*j<=x; j++ ) {
            if ( x%j==0 ) {
                p.push_back(j);
                if ( x/j!=j ) p.push_back(x/j);
            }
        }
        for ( int j:p ) {
            // cout << j << '\n';
            {
                auto it=lower_bound(a.begin(),a.begin()+i,j)-a.begin();
                if ( it<i&&a[it]==j ) {
                    ans--;
                    break;
                }
            }
            {
                auto it=lower_bound(a.begin()+i+1,a.end(),j)-a.begin();
                if ( it<n&&a[it]==j ) {
                    ans--;
                    break;
                }
            }
        }
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3988
#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using LLpair = pair<LL, LL>;

//#define DEBUG

int main() {
  LL n, k;
  cin >> n >> k;

  vector<LL> a1(n);
  for (LL i = 0; i < n; ++i) {
    cin >> a1[i];
    a1[i] -= 1;
  }

  vector<vector<LL>> a; // move 1, 2, 4, 8, ...
  a.push_back(a1);
  LL j;
  for (j = (LL)1; j <= k; j *= (LL)2) {
    if (j == (LL)1) {
      // Do nothing. just for counter check.
      continue;
    }
    vector<LL> aj(n);
    
    const auto &a_prev = a.back();
    for (LL i = 0; i < n; ++i) {
      aj[i] = a_prev[a_prev[i]];
    }
    
    a.push_back(aj);
  }
  j /= 2; // j may be reused.
  
  LL pos = 0;
  for (auto kk = (LL)0; ; kk++) {
    if (k == 0) break;
    if (k % (LL)2 == 1) {
      const auto &aa = a[kk];
      pos = aa[pos];
    }
    k /= (LL)2;

    #ifdef DEBUG
    cout << "pos: " << pos << endl;
    cout << "k: " << k << endl;
    cout << "kk: " << kk << endl;
    cout << "--\n";
    #endif
  }

  cout << pos + 1 << endl;

  #ifdef DEBUG
  cout << "--\n";
  cout << "j = " << j << "\n";
  for (LL i = 0; i < n; ++i) {
    cout << a1.at(i) << "\n";
  }
  cout << "--\n";
  auto a2 = a.at(2);
  for (LL i = 0; i < n; ++i) {
    cout << a2.at(i) << "\n";
  }
  cout << "--\n";
  auto aj = a.back();
  for (LL i = 0; i < n; ++i) {
    cout << aj.at(i) << "\n";
  }
  #endif
}



Measured memory_bytes: 100232
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

#define WHITE '.'
#define BLACK '#'

int main(void)
{
	int A, B;
	cin >> A >> B;

	A--;
	B--;
	vector<string> v(100, string(50, BLACK)+string(50, WHITE));
	// white
	for(int y=0; A!=0&&y<100; y+=2){
		for(int x=1; A!=0&&x<49; x+=2){
			v[y][x] = WHITE;
			A--;
		}
	}
	// black
	for(int y=0; B!=0&&y<100; y+=2){
		for(int x=51; B!=0&&x<100; x+=2){
			v[y][x] = BLACK;
			B--;
		}
	}

	cout << 100 << " " << 100 << endl;
	for(int i=0; i<v.size(); i++)
		cout << v[i] << endl;

	return 0;
}


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

int main() {
	int x[5];
	int ans=-1;
	for (int i = 0; i < 5; i++) {
		cin >> x[i];
	}
	for (int i = 0; i < 5; i++) {
		if (x[i] == 0) {
			ans = i+1;
			break;
		}
	}
	cout << ans << endl;
}

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

#define ll long long
#define p_q priority_queue
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)

int main(){

    int n,m;
    cin>>n>>m;
    
    if(n==m){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }

}



Measured memory_bytes: 256
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter, deque, defaultdict

    n, k, l = map(int, readline().split())

    edge1 = defaultdict(list)

    for _ in range(k):
        p, q = map(int, readline().split())
        edge1[p - 1].append(q - 1)
        edge1[q - 1].append(p - 1)

    a = [-1] * n
    que = deque()

    for i in range(n):
        if a[i] == -1:
            que.append(i)
            a[i] = i
            while que:
                cur = que.popleft()
                for nx in edge1[cur]:
                    if a[nx] == -1:
                        a[nx] = i
                        que.append(nx)

    edge2 = defaultdict(list)

    for _ in range(l):
        r, s = map(int, readline().split())
        edge2[r - 1].append(s - 1)
        edge2[s - 1].append(r - 1)

    b = [-1] * n
    que = deque()

    for i in range(n):
        if b[i] == -1:
            que.append(i)
            b[i] = i
            while que:
                cur = que.popleft()
                for nx in edge2[cur]:
                    if b[nx] == -1:
                        b[nx] = i
                        que.append(nx)

    c = Counter()
    for i in range(n):
        c[(a[i], b[i])] += 1

    res = [0] * n
    for i in range(n):
        res[i] = c[(a[i], b[i])]

    print(*res)


if __name__ == '__main__':
    main()


Measured memory_bytes: 184908
#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;
    cin >> n >> k;
    string s;
    cin >> s;
    s[k-1] = tolower(s[k-1]);
    cout << s << endl;
    return 0;
}


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

typedef long long ll;
typedef long double ld;

#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN

#define fi first
#define se second
#define pb push_back
#define f_s(a) sort(a.begin(), a.end())
#define b_s(a) sort(a.rbegin(), a.rend())
#define p(a) cout<<a<<"\n"


// ll mod = 1000000007;
// #define l(i, )
// #define rl(i, a, b) for(int i = a; i < b; i++)

/////////////////////GCD//////////////////////
ll gcd(ll a, ll b)
{
	if(b==0) return a;
	return gcd(b, a%b);
}


ll extended_gcd(ll a, ll b, ll& x, ll& y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1, y1;
	ll d = extended_gcd(b, a%b, x1, y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;
}

////////////////////SIEVE OF ERATOSTHENES//////////////////////
vector<int> sieveoferatosthenes(int n)
{
	vector<bool> prime(n+1, true);
	for(int i = 2; i <= sqrt(n); i++)
	{
		if(prime[i])
		{
			for(int j = i*i; j<=n; j+=i)
			{
				prime[j]=false;
			}
		}
	}
	vector<int> all_primes;
	for(int i = 2; i <=n; i++)
	{
		if(prime[i]) all_primes.pb(i);
	}
	return all_primes;
}

////////////////////BINARY EXPONENTIATION///////////////////////
ll bin_exp(ll a, ll b, ll mod)
{
	ll ans = 1;
	while(b)
	{
		if(b%2)
		{
			b--;
			ans = (ans%mod*a%mod)%mod;
		}
		b/=2;
		a = (a%mod*a%mod)%mod;
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n, k;
	cin>>n>>k;
	vector<ll> a(n), pre(n);
	for(int i = 0; i < n; i++)
	{
		cin>>a[i];
	}
	double maxim = 0.0, curr = 0.0;
	for(int i = 0; i < k; i++)
	{
		curr+=(a[i]+1)/2.0;
	}
	maxim = max(curr, maxim);
	for(int i = k; i < n; i++)
	{
		curr = curr + (a[i]+1)/2.0 - (a[i-k]+1)/2.0;
		maxim = max(curr, maxim);
	}
	cout<<fixed<<setprecision(10)<<maxim<<endl;

}

Measured memory_bytes: 3456
# -*- coding: utf-8 -*-
"""
A - Favorite Sound
https://atcoder.jp/contests/abc120/tasks/abc120_a

"""
import sys

def main(args):
    A, B, C = map(int, input().split())
    print(min(C, B//A))


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 2940
function Main(input){
    const arr = input.split('\n');
    const [N, K] = arr[0].split(' ').map(Number);
    const pi = arr[1].split(' ').map(Number);
    let maxNum = 0;
    let Knum = 0;
    for(let i=0; i<K; i++){
        Knum += pi[i];
    }
    maxNum = Knum;
    for(let i=K; i<pi.length; i++){
        Knum += pi[i]-pi[i-K];
        if(maxNum < Knum)  maxNum = Knum;
    }
    const answer = (maxNum+K)/2;
    console.log(answer);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


Measured memory_bytes: 43016
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
    ll n,i,j,k;
    cin>>n;
    set<ll>st,st1;
    ll mx=-1,mn=1e15;
    ll x,y;
    for(int i=1;i<=n;i++)
    {
        cin>>x>>y;
        st.insert(x+y);
        st1.insert(x-y);
    }
    auto it=st.rbegin();
    mx=*it;
    auto it1=st.begin();
    mn=*it1;
    auto it2=st1.rbegin();
    ll mx1=*it2;
    auto it3=st1.begin();
    ll mn1=*it3;
    cout<< max( abs(mx - mn) , abs(mx1 - mn1));
    return 0;
}

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e9;
const int dh[] = {1, -1, 0, 0};
const int dw[] = {0, 0, 1, -1};

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W, K;
	cin >> H >> W >> K;
	vector<string> a(H);
	for (int i = 0; i < H; i++) {
		cin >> a[i];
	}
	int ch = -1, cw;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (a[i][j] == 'S') {
				ch = i;
				cw = j;
				a[i][j] = '.';
				break;
			}
		}
		if (ch != -1) break;
	}

	vector< vector<int> > memo(H, vector<int>(W, INF));
	queue<P> q;
	memo[ch][cw] = 0;
	q.push(P(ch, cw));
	while (!q.empty()) {
		int h, w;
		tie(h, w) = q.front();
		q.pop();
		for (int i = 0; i < 4; i++) {
			int nh = h + dh[i], nw = w + dw[i];
			if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;
			if (a[nh][nw] == '#') continue;
			if (memo[nh][nw] != INF) continue;
			memo[nh][nw] = memo[h][w] + 1;
			if (memo[nh][nw] > K) continue;
			q.push(P(nh, nw));
		}
	}

	int ans = INF;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (memo[i][j] > K) continue;
			int tmp = INF;
			tmp = min(tmp, i);
			tmp = min(tmp, j);
			tmp = min(tmp, H - 1 - i);
			tmp = min(tmp, W - 1 - j);
			ans = min(ans, (tmp + K - 1) / K + 1);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3456
#include<iostream>
#include<math.h>
#include<algorithm>


using namespace std;
#define Int int64_t
#define dump(x) cout << (x) << endl
#define fi first
#define se second
Int mod = 1e9 + 7;
Int INF = 1e18;
double EPS = 0.00000001;
//Int mod = 1e6+3;


int main() {
	int p[100];
	int n;
	int a[3];
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> p[i];
	}
	int flag = 0;
	for (int i = 1; i < n - 1; i++) {
		if (max(p[i + 1], (max(p[i], p[i - 1]))) > p[i] && min(p[i + 1], (min(p[i], p[i - 1]))) < p[i]) {
			flag++;
		}
	}
	cout << flag << endl;
}


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

void Sieve(int N, std::vector<bool>& prime)
{
	prime.assign(N, true);
	prime[0] = prime[1] = false;
	for (int loop = 2; loop * loop < N; ++loop) {
		if (prime[loop]) {
			for (int loop2 = loop * 2; loop2 < N; loop2 += loop) {
				prime[loop2] = false;
			}
		}
	}
}

int main()
{
	std::vector<bool>prime;
	const int N = 100000;
	Sieve(N, prime);

	std::vector<int> x(N);
	for (int loop = 1; loop < N; loop += 2) {
		if (prime.at(loop) && prime.at((loop + 1) / 2)) {
			x[loop] = 1;
		}
	}

	for (int loop = 1; loop < N; ++loop) {
		x[loop] += x[loop - 1];
	}

	int Q;
	std::cin >> Q;
	for (int loop = 0; loop < Q; ++loop) {
		int l, r;
		std::cin >> l >> r;
		std::cout << x[r] - x[l - 1] << std::endl;
	}

	return 0;
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) ((int)(x).size())
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

int calc(int N)
{
    if(N==-1) return 0;
    N++;
    int cnt[40]={0};
    for(int i=39;i>=0;i--){
        if(~N>>i&1) continue;
        for(int j=39;j>i;j--) if(N>>j&1) cnt[j]+=1LL<<i;
        for(int j=i-1;j>=0;j--) cnt[j]+=1LL<<(i-1);
    }
    int res=0;
    for(int i=0;i<=39;i++){
        if(cnt[i]%2==1) res|=1LL<<i;
    }
    return res;
}

signed main()
{   
    int A,B; cin>>A>>B;
    int ans=calc(B)^calc(A-1);
    cout<<ans<<endl;
}  

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

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

	int ans = 0;

	for (int i = 0; i < str.length(); i++) {
		ans += (int)(str[i] - '0');
		if (ans >= 9) {
			ans %= 9;
		}
	}

	if (ans == 0)cout << "Yes";
	else {
		cout << "No";
	}
	
}

Measured memory_bytes: 3720
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 400010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> a(n),p,m;
    cins(all(a));
    rep(i,n){
        p.push_back(a[i]+i+1);
        m.push_back(a[i]-i-1);
    }
    ll ans = 0;
    SORT(p);
    SORT(m);
    for (ll i:p){
        ans += upper_bound(all(m),-i)-lower_bound(all(m),-i);
    }
    PRINT(ans);
}


Measured memory_bytes: 8256
s = input()
if s == 'SUN':
	print(7)
	
elif s == 'MON':
	print(6)
	
elif s == 'TUE':
	print(5)
	
elif s =='WED':
	print(4)
	
elif s =='THU':
	print(3)
	
elif s == 'FRI':
	print(2)
	
else:
	print(1)

Measured memory_bytes: 38256
#include <stdio.h>
#include <string.h>
#include <algorithm>

using ll = long long;

int main()
{
	int N;
	static ll A[200000];
	static int count[1000001];
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%lld", &A[i]);
		count[A[i]]++;
	}
	std::sort(A, A + N);

	static bool used[1000000 + 1];
	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (used[A[i]]) {
			continue;
		}
		if (count[A[i]] == 1) {
			ans++;
		}
		for (ll k = 1; A[i] * k <= 1000000; k++) {
			used[A[i] * k] = true;
		}
	}
	printf("%d\n", ans);

	return 0;
}


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

int main(void){
    
    int a,b,c; cin >> a >> b >> c;
    
    if(a==b){
        cout << c;
    }
    else if(a==c)
    {
        cout << b;
    }else{
        cout << a;
    }
    
    return 0;
    
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define MAX 200000
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define rept(i,k,n) for(ll i = (k); i < (ll)(n); i++)
typedef long long ll;

int main(){
    ll a;
    cin>>a;
    ll ans=a-1;
    rept(i,1,sqrt(a)+1){
        if(a%i==0){
            ans=min(ans,i+a/i-2);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int t = sc.nextInt();
        int bisckets = (int)(t + 0.5) / a * b;
        
        System.out.println(bisckets);
	}	
}

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



int main() {
    string s,t;
    cin>>s>>t;
    for(int i=0;i<3;i++){
        if(s.at(i)!=t.at(2-i)){
            cout<<"NO"<<endl;
            return 0;
        }
    }
    
    cout<<"YES"<<endl;
}


Measured memory_bytes: 256
N,K=map(int, input().split())
*A,=map(int, input().split())

X=0
for i in range(40,-1,-1):
    b = 1<<i
    if X|b>K:continue
    c=0
    for a in A:
        if a&b: c+=1
    if c <= N//2: X|=b

ans=0
for a in A:
    ans += a^X
print(ans)


Measured memory_bytes: 73616
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)
	l := make([]int, n)
	for i, _ := range l {
		fmt.Scan(&l[i])
	}
	sort.Ints(l)

	var sum int
	for i := 1; i <= k; i++ {
		sum += l[n-i]
	}

	fmt.Println(sum)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define INF 1000000000
using namespace std;

int main() {

int N,sum=0; cin>>N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A[i]; }
  sort(A.begin(),A.end());
  for(int i=0; i<N-1;i++){
    sum+=A[i];}
  cout<<sum+(A[N-1]/2)<<endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
const int N = 1000 + 5;
int a[N];
int main()
{
  int a,b;
  while(cin >> a >> b)
  {
      int maxx = a + b;
      maxx = max(maxx,a-b);
      maxx = max(maxx,a*b);
      printf("%d\n",maxx);
  }
}


Measured memory_bytes: 256
//In The Name Of God
#include <bits/stdc++.h>
#define int long long
#define F first
#define S second
#define mp make_pair
#define L(x) (2*(x))
#define R(x) ((2*(x))+1)
#define pii pair<int, int>
#define pb push_back
using namespace std;
const int N = 2e5 + 5, Mod = 1e9 + 7, P = 727, Lg = 22, TOF = 1900;

int Max[4 * N], A[N], H[N];

void Add(int s, int e, int ind, int l, int r, int x){
      if(s >= l && e <= r){
            Max[ind] = x;
            return ;
      }
      int mid = (s + e)/2;
      if(l < mid) Add(s, mid, L(ind), l, r, x);
      else Add(mid, e, R(ind), l, r, x);
      Max[ind] = max(Max[L(ind)], Max[R(ind)]);
}
int Query(int s, int e, int ind, int l, int r){
      if(s >= l && e <= r)
            return Max[ind];
      int mid = (s + e)/2, ret = 0;
      if(l < mid) ret = max(ret, Query(s, mid, L(ind), l, r));
      if(r > mid) ret = max(ret, Query(mid, e, R(ind), l, r));
      return ret;
}
int32_t main(){
      ios_base::sync_with_stdio(0); cin.tie(0);
      int n; cin >> n;
      for(int i = 1; i <= n; i++)
            cin >> H[i];
      for(int i = 1; i <= n; i++)
            cin >> A[i];
      for(int i = 1; i <= n; i++){
            int ret = Query(1, N, 1, 1, H[i]);
            ret += A[i];
            Add(1, N, 1, H[i], H[i] + 1, ret);
      }
      cout << Query(1, N, 1, 1, N);
      return 0;
}



Measured memory_bytes: 8448
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(auto i = (N) - 1; i >= 0; i -= 1)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define vrep(v,it) for(auto it = v.begin(); it != v.end(); it++)
#define vrepr(v,it) for(auto it = v.rbegin(); it != v.rend(); it++)
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define rand mtrand
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cout << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,...) do { cout << #v << " = "; array_out(v , ##__VA_ARGS__);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = 0x1FFFFFFFFFFFFFFFLL;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}

random_device seed_gen; mt19937_64 mtrand(seed_gen());
constexpr int MOD = 1000000007;
//////////////////////////////////////////

int main(){
  inl(a,b,c);
  out(a%2&&b%2&&c%2 ? min({a*b,b*c,c*a}) : 0);
}

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

using namespace std;

#define ll long long

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

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

	cout << ans << endl;

	return 0;
}


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

int main()
{
    int n,k;
    cin>>n>>k;
    int frr[n+5]={0};
    int prr[n+5]={0};
    int p=0,q=0;
    while(k--)
    {
        int a;
        string s;
        cin>>a>>s;
        if(s=="AC")
        {
            if(frr[a]==0)
            {
                p++;
                q+=prr[a];
                frr[a]=1;
            }
        }
        else
        {
            prr[a]++;
        }
    }
    cout<<p<<" "<<q<<endl;
}


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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

bool check(string st)
{
    Rep(i, st.size()) {
        if (st[0] != st[i]) return false;
    }
    return true;
}

int solve(string st, char p)
{
    string nxt = st;
    int ret = 0;
    while (!check(nxt)) {
        string tmp;
        rep(i, nxt.size()-1) {
            if (nxt[i] == p || nxt[i+1] == p) {
                tmp.pb(p);
            } else {
                tmp.pb(nxt[i]);
            }
        }
        nxt = tmp;
        ret++;
    }
    return ret;
}

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

    string st;
    cin >> st;
    
    int ans = INF;
    for (char i = 'a'; i <= 'z'; i++) {
        ans = min(ans, solve(st, i));
    }

    std::cout << ans << std::endl;

    return 0;
}


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

#define int long long
#define pb emplace_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define F first
#define S second
#define fast ios:: sync_with_stdio(false),cin.tie(0);

int32_t main(){
	fast;
	int w,h,n;
	cin >> w >> h >> n;
	
	int xl = 0 , xr = w , yl = h , yr = 0;
	while(n--)
	{
		int x,y,t;
		cin >> x >> y >> t;
		if(t == 1)  xl = max(xl,x);
		if(t == 2)  xr = min(xr,x);
		if(t == 3)  yr = max(yr,y);
		if(t == 4)  yl = min(yl,y);
	}

	int ans=  max(0LL,xr-xl)*max(0LL,yl-yr);
	cout << ans;
}







Measured memory_bytes: 256
#include<cstdio>
const int a[50]=
{1,2,12,84,770,8340,106400,1546888,25343766,461133960,232367169,627905865,632459808,928262728,919805769,382796331,887217496,639768068,869694124,205875097,205589953,487772376,239955313,998339621,31622834,902930073,146839084,449786840,982224660,865803735,21834818,721531716,26008837,471774471,69010090,700009308,776938882,645550477,526939604,142728157,654489641,128201240,185493259,789721045,977049419,589149550,700648836,25087729,874433491,352791804};
int main(){
	int n;
	scanf("%d",&n);
	printf("%d\n",a[n-1]);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int iinf = 1 << 28;
const long long llinf = 1ll << 60;
const double PI = 3.14159265;

void work() {
    string s; cin>>s;
    for (int i = 0; i < s.size(); ++i) cout << "x";
    cout <<endl;
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    work();

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <iterator>
#define loop(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;

using namespace std;
using LL = long long;
using ULL = unsigned long long;

int main() {
    int a, b; cin >> a >> b;
    if (a >= 1 and a <= 9 and b >= 1 and b <= 9) {
        cout << a * b << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}


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

int main()
{
    int a, b, c, x, y, loop;
    long long int tmp, ans = 0;
    std::cin >> x >> y >> a >> b >> c;
    loop = x + y;

    std::vector<long long int> p(a), q(b), r(c);

    for (int i = 0; i < a; i++)
        std::cin >> p[i];
    for (int i = 0; i < b; i++)
        std::cin >> q[i];
    for (int i = 0; i < c; i++)
        std::cin >> r[i];
    std::sort(p.begin(), p.end(), std::greater<long long int>());
    std::sort(q.begin(), q.end(), std::greater<long long int>());
    std::sort(r.begin(), r.end(), std::greater<long long int>());
    while (p.size() != x)
        p.pop_back();

    while (q.size() != y)
        q.pop_back();

    for (int i = 0; i < x; i++)
    {
        r.push_back(p.at(i));
    }
    for (int i = 0; i < y; i++)
    {
        r.push_back(q.at(i));
    }
    std::sort(r.begin(), r.end(), std::greater<long long int>());

    for (int i = 0; i < x + y; i++)
    {
        ans += r.at(i);
    }

    std::cout << ans << std::endl;
}

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

int main(void) {
  //input
  int N;
  cin >> N;
  //calc & output
  for(int i = 1; i <= 9; i++) {
    for(int j = i; j <= 9; j++) {
      if ( i * j == N ) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
def ss(n):
    return (n * (n+1))//2
def main():
    S = input()
    r = 0
    larger = (S[0] == '<')
    first = (S[0] == '<')
    t = 0
    l = []
    for i in S:
        if i == '<':
            if larger:
                t += 1
            else:
                larger = True
                l.append(t)
                t = 1
        else:
            if not larger:
                t += 1
            else:
                larger = False
                l.append(t)
                t = 1
    else:
        l.append(t)
    if len(l) == 1:
        r = ss(l[0])
    elif len(l) == 2 and first == False:
        r = ss(l[0]) + ss(l[1])
    elif first:
        p = l[0]
        for i, v in enumerate(l):
            r += ss(v)
            if i % 2 == 1:
                r -= min(v, p)
            p = v
    else:
        r = ss(l[0])
        p = l[1]
        for i, v in enumerate(l[1:]):
            r += ss(v)
            if i % 2 == 1:
                r -= min(v, p)
            p = v
    return r
print(main())


Measured memory_bytes: 8224
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("Failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();

    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let mut a: i32 = read();
    let b: i32 = read();
    let mut c: i32 = read();
    let d: i32 = read();

    loop {
        c -= b;
        if c < 1 {
            println!("Yes");
            break;
        }
        a -= d;
        if a < 1 {
            println!("No");
            break;
        }
    }
}

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

int main() {
	int a[4], b[4];
	while(cin >> a[0] >> a[1] >> a[2] >> a[3] >> b[0] >> b[1] >> b[2] >> b[3]){
	int hit = 0, blow = 0;
	for (int i = 0; i < 4; ++i) {
		for (int j = 0; j < 4; ++j) {
			if (i == j && a[i] == b[j]) {
				hit++;
			} else if (i!=j && a[i] == b[j]) {
				blow++;
			}
		}
	}
	cout << hit << " " << blow << endl;
	}
}

Measured memory_bytes: 3096
N,K = list(map(int,input().split()))

L1 = 0
L2 = 0
for i in range(1,N+1):
    if i%K==0:
        L1+=1
    elif K%2==0:
        if i%(K//2)==0:
            L2+=1
print(L1**3 + L2**3)


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

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var K = int.Parse(Console.ReadLine());

            var ans = 1;
            for (int _ = 0; _ < N; _++)
            {
                ans = Math.Min(ans * 2, ans + K);
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11092
//libraries
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

//namespace
using namespace std;
using namespace __gnu_pbds;

//typedef
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long,long> pll;

//define
#define inp(X) cin>>X;
#define inp_long(X) long long X; cin>>X;
#define inp_arr(A,N) long long A[N]; for(long long int i=0;i<N;i++) {cin>>A[i];}
#define sz(A) A.size()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define endl '\n'
#define vect(A) vector<long long> A;
#define inp_vect(A,N); vect(A);for(long long i=0;i<N;i++){long long q; cin>>q; A.push_back(q);}
#define forin(i,a,b) for(long long i=a;i<=b;i++)
#define forde(i,a,b) for(long long i=a;i>=b;i--)
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const long long inf=(long long)1e18;
const long long MOD=(long long)(1e9+7);

ll power(ll x,ll y)
{
    if (y == 0)
        return 1;
    ll p = power(x, y/2) % MOD;
    p = (p * p) % MOD;

    return (y%2 == 0)? p : (x * p) % MOD;
}
ll modInverse(ll a)
{
   return power(a,MOD-2);
}
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 

int main()
{
	fio;
	ll n;
	cin>>n;
	ll a[n];
	forin(i,0,n-1)
	{
		cin>>a[i];
	}
	ll sum=0;
	forin(i,0,n-2)
	{
		forin(j,i+1,n-1)
		{
			sum+=a[j]*a[i];
		}
	}
	cout<<sum<<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
int main(){
    constexpr long long MOD = 1'000'000'007; //'
    long long n;
    std::cin>>n;

    long long ans=1LL;
    for(int i=1; i<=n; i++){
        ans *= i;
        ans %= MOD;
    }

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

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ll long long
#define db double
#define el "\n"
#define ld long double
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n;i>=0;i--)
#define rep_a(i,a,n) for(int i=a;i<n;i++)
#define all(ds) ds.begin(), ds.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
typedef vector< long long > vi;
typedef pair<long long, long long> ii;
typedef priority_queue <ll> pq;
#define o_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define graph vector<vi>

const ll mod = 1000000007;
const ll INF = (ll)1e18;
const ll MAXN = 1000006;

ll po(ll x, ll n ){ 
    ll ans=1;
     while(n>0){
         if(n&1) ans=(ans*x)%mod;
         x=(x*x)%mod;
         n/=2;
     }
     return ans;
}



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

    int T=1;
    //cin >> T;
    while(T--){
        ll n;
        cin>>n;
        ll a[n];
        rep(i,n) cin>>a[i];
        sort(a, a+n);
        ll ans=0, l, r;
        for(int i=1; i<n-1; i++){
            l=i-1, r=n-1;
            for(;l>=0;l--){
                while(r>i && a[l]+a[i]<=a[r]) r--;
                ans+=r-i;
            }
        }
        cout<<ans<<el;
      }

    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}

Measured memory_bytes: 3760