akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];

    if (n < 3) {
        cout << 1 << endl;
        return 0;
    }

    int count = 1;
    bool increase = a[0] < a[1];
    bool neutral = a[0] == a[1];
    for (int i = 2; i < n; i++) {
        if (neutral) {
            if (a[i] == a[i-1]) continue;
            neutral = false;
            increase = a[i] > a[i-1];
        } else if (increase) {
            if (a[i] < a[i-1]) {
                neutral = true;
                count++;
            }
        } else {
            if (a[i] > a[i-1]) {
                neutral = true;
                count++;
            }
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;
const int INF = 1e9;
const ll INFll = 1e18;
#define put(n) cout<<(n)<<endl
#define Cout(n) cout<<(n)
#define rep(i,num,N) for(int(i)=(num);(i)<(N);++(i))
#define rrep(i,num,N) for(int (i)=(num);(i)>(N);--(i))
#define all(v) (v).begin() , (v).end()
#define rall(v) (v).rbegin() , (v).rend()
#define MP make_pair
#define pb(q) push_back(q)
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};

vector<vector<bool>> graph;
vector<int> A,B;
vector<bool> visited;
int N,M,ans;

void dfs(int v){
    if(visited[v]) return;
    visited[v] = true;

    rep(i,0,N){
        if(graph[v][i] && !visited[i]) dfs(i);
    }
}


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

    graph.assign(N,vector<bool>(N,false));
    A.resize(M); B.resize(M);

    rep(i,0,M){
        cin>>A[i]>>B[i];
        --A[i]; --B[i];
        graph[A[i]][B[i]] = graph[B[i]][A[i]] = true;
    }

    rep(i,0,M){
        visited.assign(N,false);
        graph[A[i]][B[i]] = graph[B[i]][A[i]] = false;

        dfs(0);

        bool bridge = false;
        rep(i,0,N){
            if(!visited[i]) bridge = true; 
        }

        ans += (bridge?1:0);
        graph[A[i]][B[i]] = graph[B[i]][A[i]] = true;
    }
    
    put(ans);
}

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

int main(){
  int a, b;
  
  cin >> a >> b;
  
  string s;
  
  if(a < b)        cout << "a < b"  << endl;
  else if(a == b)  cout << "a == b" << endl;
  else             cout << "a > b"  << endl;
  
  return 0;
}



Measured memory_bytes: 3124
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

using lli = long long int;
using ulli = unsigned long long int;

#define INF 999999999;

//#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

string AC;
bool a= false;

int main(){
	cin.tie(0);
	std::ios::sync_with_stdio(false);
	cin >> AC;
	for(int i = 0; i < AC.size()-1; i++){
		if(AC[i] == 'A' && AC[i+1] == 'C')a = true;
	}
	if(a) cout << "Yes";
	else cout << "No";
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")

#include "bits/stdc++.h"
using namespace std;

#define pb push_back
#define F first
#define S second
#define f(i,a,b)  for(int i = a; i < b; i++)
#define endl '\n'

using ll = long long;
using db = long double;
using ii = pair<int, int>;

const int N = 1e5 + 5, LG = 19, MOD = 1e9 + 7;
const int SQ =225;
const long double EPS = 1e-7;
int n, a, b, dp[20005], H;
int32_t main(){
#ifdef ONLINE_JUDGE
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif

  cin >> H >> n;

  memset(dp,63,sizeof dp);
  dp[0] = 0;

  f(i,0,n){
    cin >> a >> b;
    for(int j = a; j <= 20000; j++){
      dp[j] = min(dp[j], dp[j-a] + b);
    }
  }

  cout << *min_element(dp+H,dp+20001) << '\n';

  return 0;
}


Measured memory_bytes: 384
X = int(input())

if X >= 400 and X <= 599 :
    print("8")
elif X >= 600 and X <= 799:
    print("7")
elif X >= 800 and X <= 999:
    print("6")
elif X >= 1000 and X <= 1199:
    print("5")
elif X >= 1200 and X <= 1399:
    print("4")
elif X >= 1400 and X <= 1599:
    print("3")
elif X >= 1600 and X <= 1799:
    print("2")
elif X >= 1800 and X <= 1999:
    print("1")



Measured memory_bytes: 9080
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define pll  pair <long long,long long>
#define ss second
#define ff first
#define inf 9223372036854775807
#define maa 1000000007
#define ld long double
#define fast  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define bug(x) cout << #x <<": " << x << '\n';
const ll N=200002 ;
ll  power(ll  i,ll  j)
{
    if(j==0)
    return 1 ;
    ll t=power(i,j/2)%maa ;
    if(j%2==0)
    return (t%maa*t%maa)%maa ;
    else
    return ((t%maa*t%maa)%maa*(i%maa)%maa)%maa ;
}

int main()
{
   fast ;
   ll h,w,a,b ;
   cin>>h>>w>>a>>b ;
   ll fac[N],ifac[N];
   fac[0]=1 ;
   ifac[0]=1 ;
   for(ll i=1;i<N;i++)
   {
       fac[i]=(fac[i-1]*i)%maa ;
       ifac[i]=power(fac[i],maa-2) ;
   }
   ll ans=fac[h-1+w-1] ;
   ans=(ans*ifac[h-1])%maa ;
   ans=(ans*ifac[w-1])%maa ;

//   cout<<ans<<endl ;

   for(ll i=h-a+1;i<=h;i++)
   {
       ll j=b ;

       ll x=fac[i-1+j-1] ;
       x=(x*ifac[i-1])%maa ;
       x=(x*ifac[j-1])%maa ;

       ll y=fac[w-j-1+h-i] ;
       y=(y*ifac[w-j-1])%maa ;
       y=(y*ifac[h-i])%maa ;

       x=(x*y)%maa ;
      // cout<<x<<endl ;
       ans%=maa ;
       ans-=x ;
       ans%=maa ;
       ans+=maa ;
       ans%=maa ;
   }
   cout<<ans ;



}


Measured memory_bytes: 3456
import math
a, b, x = [int(x) for x in input().split()]
V = a*a*b
if (x > V/2):
    ans = math.degrees(math.atan(2*(V-x)/(a**3)))
    print(ans)
else:
    ans = math.degrees(math.atan(a*b*b/(2*x)))
    print(ans)


Measured memory_bytes: 38384
from itertools import accumulate
import bisect
N,x = map(int,input().split())
A = sorted(list(map(int,input().split())))
A = list(accumulate(A))
ind = bisect.bisect_right(A,x)-1
if ind == -1:
    print(0)
elif ind == N-1:
    if A[ind] == x:
        print(ind+1)
    else:
        print(ind)
else:
    print(ind+1)


Measured memory_bytes: 3188
import sys
input = sys.stdin.readline
import numpy as np
sys.setrecursionlimit(10**6)

N = int(input())
graph = [[] for _ in range(N+1)] # parent to child
for i,p in enumerate(input().split(),2):
    graph[int(p)].append(i)
X = [None] + [int(x) for x in input().split()]

def dfs(v):
    # None または 白、黒の2つ組を返す
    child = []
    for w in graph[v]:
        c = dfs(w)
        if c is None:
            return None
        child.append(c)
    S = sum(a+b for a,b in child)
    x = X[v]
    dp = np.zeros(x+1, dtype=np.bool) # 2択の繰り返しで作れる和
    dp[0] = 1
    for a,b in child:
        prev = dp
        dp = np.zeros_like(prev)
        if a <= x:
            dp[a:] = prev[:x+1-a]
        if b <= x:
            dp[b:] |= prev[:x+1-b]
    nz = np.nonzero(dp)[0]
    if len(nz) == 0:
        return None
    return x, S - nz[-1]

answer = 'POSSIBLE' if dfs(1) is not None else 'IMPOSSIBLE'
print(answer)



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

#define mod 1000000007
#define ll long long

int main()
{
    ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
   ll a,b,c,k;
   cin>>a>>b>>c>>k;
   ll ans=a-b;
   k--;
   if(abs(ans) >= 1e18)cout<<"Unfair";
   else {
       if(k%2)cout<<a-b;
       else cout<<b-a;
   }
   

}


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

int main(){
    int N;
    char S[10010];
    cin >> N >> S;
    
    unsigned long lng = strlen(S);
    for ( int i = 0; i < lng; ++i){
        int x = S[i] - 'A';
        x = ( x + N ) % 26;
        S[i] = 'A' + x;
    }
    
    cout << S << endl;
    
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

/**
 * Created by labuser on 2016/04/15.
 */
public class Main {
    public static void main(String[] args) {
        new Main().run();
    }


    private static void run() {
        int x;
        int a;

        Scanner sc = new Scanner(System.in);
        x = Integer.parseInt(sc.nextLine());

        a = x * x * x;
        System.out.println(a);
    }

}

Measured memory_bytes: 25984
s = input()

if s =='SAT':
  print(1)
elif s == 'FRI':
  print(2)
elif s == 'THU':
  print(3)
elif s == 'WED':
  print(4)
elif s == 'TUE':
  print(5)
elif s == 'MON':
  print(6)
elif s == 'SUN':
  print(7)

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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

bool P[100005];
ll S[100005];

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

    ll N;
    cin >> N;
    memset(S, 0, sizeof(S));
    memset(P, 0, sizeof(P));
    P[0] = P[1] = true;
    for (ll i = 2; i <= 100002; ++i) {
        if (P[i])
            continue;
        for (ll j = 2 * i; j <= 100002; j += i) {
            P[j] = true;
        }
    }
    
    REP(i, 100002) {
        if (P[i])
            continue;
        if (P[(i + 1) / 2])
            continue;
        S[i]++;
    }

    REP(i, 100002) {
        S[i + 1] += S[i];
    }

    REP(i, N) {
        ll l, r;
        cin >> l >> r;
        cout << S[r] - S[l - 1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1536
// #define DEBUGGING
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
using ll = std::int64_t;
using ull = std::uint64_t;
using PLL = std::pair<ll, ll>;
using TLL = std::tuple<ll, ll, ll>;
template <typename T> using V = std::vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }
#define mv_rec make_v(init, tail...)
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, size_t s, Tail... tail) { return V<decltype(mv_rec)>(s, mv_rec); }
#undef mv_rec
using namespace std;

#ifdef DEBUGGING
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

using BS = bitset<64>;
VV<ll> edges(50);
map<PLL, ll> id;

bool dfs(ll cur, ll pre, ll u, ll v, BS &bs) {
    if (cur == v) return true;
    bool ret = false;
    for (ll nxt : edges[cur]) {
        if (nxt == pre) continue;
        if (dfs(nxt, cur, u, v, bs)) {
            ret = true;
            bs.set(id[PLL(cur, nxt)], 1);
        }
    }
    return ret;
}

int main() {
    ll N, M;
    cin >> N;
    for (ll i = 1; i < N; i++) {
        ll u, v;
        cin >> u >> v;
        u--; v--;
        edges[u].push_back(v);
        edges[v].push_back(u);
        id[PLL(u, v)] = i - 1;
        id[PLL(v, u)] = i - 1;
    }

    cin >> M;
    V<BS> cons(M);
    for (ll i = 0; i < M; i++) {
        ll u, v;
        cin >> u >> v;
        u--; v--;
        dfs(u, -1, u, v, cons[i]);
        DEBUG(cons[i].to_string());
    }

    V<ll> pow2(N + 1, 1);
    for (ll i = 1; i < pow2.size(); i++) pow2[i] = 2 * pow2[i - 1];
    ll ans = 0;
    DEBUG(ans);
    for (ll S = 0; S < (1 << M); S++) {
        BS bs;
        ll bcnt = 0;
        for (ll j = 0; j < M; j++) {
            if ((S >> j) & 1) {
                bs |= cons[j];
                bcnt++;
            }
        }
        ll cnt = bs.count();
        DEBUG(make_tuple(cnt, bcnt, pow2[N-1-cnt]));
        if (bcnt & 1) ans -= pow2[(N - 1) - cnt];
        else ans += pow2[(N - 1) - cnt];
    }

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


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

using ll = long long;

using namespace std;

#define INF 10000000

int main() {
    int n, m, x;
    cin >> n >> m >> x;
    int c[n], a[n][m];
    for (int i=0; i<n; i++) {
        cin >> c[i];
        for (int j=0; j<m; j++) {
            cin >> a[i][j];
        }
    }
    int ans = INF;
    for (int i=0; i<(1 << n); i++) {
        int rikai[m], cost = 0;
        fill(rikai, rikai+m, 0);
        for (int d=0; d<n; d++) {
            if (i & (1 << d)) {
                cost += c[d];
                for (int j=0; j<m; j++) {
                    rikai[j] += a[d][j];
                }
            }
        }
        bool success = true;
        for (auto &ri:rikai) if (ri < x) success = false;
        if (success) ans = min(ans, cost);
    }
    cout << (ans < INF ? ans : -1) << '\n';
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
#include <string>
#include <bitset>
#include <fstream>
#include <stack>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> T;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define revrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define f first
#define s second
#define pb push_back

ll mod = 1000000007;
const ll INF = 100000000000010000;
//const ull B = 998244353;
//ll kai[3010];

//void pres(double A, ll x = 20) { printf("%.20f\n", x); }

vector<ll> dx = { 0, 1, 0, -1, 1, -1, 1, -1, 0};
vector<ll> dy = { 1, 0, -1, 0, 1, 1, -1, -1, 0};

void chmin(ll& x, ll y) {
	x = min(x, y);
}

void chmax(ll& x, ll y) {
	x = max(x, y);
}

ll pow_long(ll x, ll y) {
	ll res = 1;
	while (y > 0) {
		if (y % 2 == 1) res *= x;
		x *= x;
		y /= 2;
	}
	return res;
}

void test() {
	cout << "888888888888888888888888" << endl;
}

ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}

ll pow_mod(ll x, ll k) {
	x %= mod;
	ll res = 1;
	while (k > 0) {
		if (k % 2) {
			res *= x; res %= mod;
		}
		x *= x; x %= mod;
		k /= 2;
	}
	return res;
}

ll div_mod(ll x) {
	return pow_mod(x, mod - 2);
}

//コンビネーション
const int MAXcomb = 1000010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAXcomb; 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 comb(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * finv[k] % mod * finv[n - k] % mod;
}

ll N;

void solve() {
	cin >> N;
	if (N % 2 == 1) cout << N / 2 + 1 << endl;
	else cout << N / 2 << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll T = 1;
	//cin >> T;
	rep(i, T) solve();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mem(dp,a) memset(dp,a,sizeof(dp))
#define pb(x) push_back(x)
#define m_p(x,y) make_pair(x,y)
#define f(n) for(ll i=0;i<n;i++)
#define r(n) for(ll j=0;j<n;j++)
#define all(v) (v).begin(),(v).end()
#define ff first
#define ss second
#define pi 3.141592653589793238462
#define hs ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
typedef long long int ll;
typedef long double ld;
ll ESP=1e18;
ll INF=1e9+7;

int main()
{
 hs;
 ll n,k;
 cin>>n>>k;
 unordered_set<ll>ss;
 f(k)
 {
  ll x;
  cin>>x;
  r(x)
  {
   ll y;
   cin>>y;
   ss.insert(y);
  }
 }
 cout<<n-ss.size()<<"\n";
 return 0;

}


Measured memory_bytes: 3624
# Binary Tree


class Node():
    def __init__(self, idx=-1, parent=-1, left=-1, right=-1):
        self.idx = idx
        self.parent = parent
        self.left = left
        self.right = right
        self.sibling = -1
        self.depth = -1
        self.height = -1
        self.type = None
        self.degree = -1


class BinaryTree():
    def __init__(self, n):
        self.T = [Node(i) for i in range(n)]

    def set_children(self, idx, l, r):
        node = self.T[idx]
        node.left = l
        node.right = r

        deg = 0
        if l != -1:
            deg += 1
            self.T[l].parent = idx
            self.T[l].sibling = r

        if r != -1:
            deg += 1
            self.T[r].parent = idx
            self.T[r].sibling = l

        node.degree = deg

    def get_root(self):
        for idx, node in enumerate(self.T):
            if node.parent == -1:
                return idx

    def set_type(self):
        for i, node in enumerate(self.T):
            if node.parent == -1:
                node.type = 'root'
            elif node.left == -1 and node.right == -1:
                node.type = 'leaf'
            else:
                node.type = 'internal node'

    def set_depth(self):
        root = self.get_root()
        self.set_depth_rec(root, 0)

    def set_depth_rec(self, idx, depth):
        node = self.T[idx]
        node.depth = depth
        if node.left != -1:
            self.set_depth_rec(node.left, depth+1)
        if node.right != -1:
            self.set_depth_rec(node.right, depth+1)

    def set_height(self):
        root = self.get_root()
        self.set_height_rec(root)

    def set_height_rec(self, idx):
        node = self.T[idx]
        if node.left == -1 and node.right == -1:
            node.height = 0
            return 0

        height = max(
            self.set_height_rec(node.left),
            self.set_height_rec(node.right)
        ) + 1

        node.height = height
        return height


N = int(input())
tree = BinaryTree(N)

for _ in range(N):
    idx, l, r = map(int, input().split())

    tree.set_children(idx, l, r)

tree.set_type()
tree.set_depth()
tree.set_height()

for node in tree.T:
    i = node.idx
    p = node.parent
    s = node.sibling
    deg = node.degree
    dep = node.depth
    h = node.height
    typ = node.type

    print(
        f'node {i}: parent = {p}, sibling = {s}, degree = {deg}, depth = {dep}, height = {h}, {typ}')



Measured memory_bytes: 5636
import java.io.*;
import java.util.*;

class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int max = -1;
    int min = 1001;
    for(int i = 0; i < n; i++) {
      int curr = sc.nextInt();
      max = Math.max(curr, max);
      min = Math.min(curr, min);
    }
    System.out.println(max-min);
  }
}


Measured memory_bytes: 23124
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String args[]) {
		FastScanner scanner = new FastScanner();
		int n=scanner.nextInt();
		int m=scanner.nextInt();
		List<Pair> list=new ArrayList<>();
		for(int i=0;i<m;i++){
			int a=scanner.nextInt();
			int b=scanner.nextInt();
			list.add(new Pair(a,b));
		}
		Collections.sort(list);
		int ans=0;
		while(!list.isEmpty()){
			Pair p=list.get(0);
			Iterator<Pair> iter = list.iterator();
			while (iter.hasNext()) {
				Pair pair = (Pair) iter.next();
				if(p.b>pair.a){
					iter.remove();
				}
			}
			ans++;
		}
		System.out.println(ans);
	}
}

class Pair implements Comparable<Pair>{
	int a,b;
	Pair(int a,int b){
		this.a=a;
		this.b=b;
	}
	@Override
	public int compareTo(Pair o) {
		if(this.b>o.b)return 1;
		else if(this.b==o.b)return 0;
		else return -1;
	}
	
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


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

ll qpow(ll a,ll n){
    ll ret=1;
    while(n){
        if(n&1)ret=ret*a;
        a=a*a;
        n>>=1;
        if(ret>1e12)return LLONG_MAX;
    }return ret;
}
int main(){
    ll n,p;
    cin>>n>>p;
    if(n>40){
        puts("1");return 0;
    }
    if(n==1){
        cout<<p;return 0;
    }
    if(p==1){
        puts("1");return 0;
    }
    bool isp=1;
    ll yz;
    for(ll i=2;i*i<=p;i++){
        if(p%i==0){
            isp=0;
            yz=i;break;
        }
    }
    if(isp){
        if(n==1)cout<<p;
        else puts("1");
        return 0;
    }
    else{
        ll ans=1;
        for(ll i=2;i*i<=p;i++){
            if(p%i==0){
                ll in = qpow(i,n);
                while(p%in==0){
                    p/=in;
                    ans*=i;
                }
            }
        }
        cout<<ans;
    }
    return 0;
}


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

string str;
char a = '0', b = '1';
int sumA = 0, sumB = 0;

int main(int argc, char *argv[])
{
    cin >> str;
    for (char ch : str)
    {
        if (ch == a)
        {
            ++sumA;
        }
        if (ch == b)
        {
            ++sumB;
        }
        swap(a, b);
    }
    cout << min(sumA, sumB) << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#define myfor(i,N) for(i=0;i<N;i++)
#define myforFL(i,f,l) for(i=f;i<l;i++)
#define myforInv(i,N) for(i=N;i>=0;i--)
#define myforFLInv(i,f,l) for(i=f;i>l;i--)

using namespace std;

int main(){
	long N,K,A[200000];

	int i;
	cin >> N >> K;
	myfor(i,N){
		cin >> A[i];
	}
	myfor(i,N-K){
		if(A[i] < A[i+K])cout << "Yes" << endl;
		else cout << "No" << endl;
	}

	return 0; 

}


Measured memory_bytes: 5180
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

void Main()
{
    int a, b, c;
    cin >> a >> b >> c;
    if (a < b && b < c)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

int main()
{
    std::cout << std::fixed << std::setprecision(15);
    Main();
}

//　if文
// if (num == 0)
// {
//     cout << "0";
// }
// else if (num == 1)
// {
//     cout << "1"; // 1が表示される
// }
// else
// {
//     cout << "01以外";
// }


Measured memory_bytes: 3104
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
 
const int N = 1e5 + 10 , M = 5e5+10 ,  MOD = 1e9+7;
const int OO = 0x3f3f3f3f;
const double EPS = 1e-3;
 
#define clr(arr,val) memset(arr , val , sizeof (arr))
#define loop(i,n) for(int i = 0;i < int(n);i++)
#define rloop(i,n) for(int i = int(n)-1;i >= 0;i--)
#define range(i,a,b) for(int i = int(a);i <= int(b);i++)
#define ALL(v) ((v).begin()) , ((v).end())
#define SZ(v)  ((int)((v).size()))
typedef pair <int,int> pii ;
typedef vector < pii > vii ;
typedef vector < int > vi;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction
//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
 


int x , y , l ,w;



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

    

    cin >> l >> w >> x >> y;

    bool multipleSol = 0;

    if(x+x == l && y+y == w)
        multipleSol = 1;
    
    cout << fixed << setprecision(6) <<((double)l*(double)w) / 2 << " ";
    cout << multipleSol << "\n"; 

   
 
    
    return 0;
}


Measured memory_bytes: 256
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = Counter(a)
m = max(a) + 1
dp = [False]*m
ans = 0
for ai in a:
    if dp[ai]:
        continue
    if c[ai] == 1:
        ans += 1
    for i in range(ai, m, ai):
        dp[i] = True
print(ans)

Measured memory_bytes: 38460
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))
#define all(x) x.begin(),x.end()


int main()
{
	ll t1, t2, a1, a2, b1, b2;
	cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
	if (((a1-b1)*t1 + (a2-b2)*t2>0 && (a1 - b1)*t1>0) || ((a1 - b1)*t1 + (a2 - b2)*t2 < 0 && (a1 - b1)*t1 < 0))cout << 0 << endl;
	else if ((t1*a1 + t2 * a2) == (t1 * b1 + t2 * b2))cout << "infinity" << endl;
	else
	{
		ll dif = abs((t1*a1 + t2 * a2) - (t1 * b1 + t2 * b2));
		ll tmp = abs(b1*t1 - a1 * t1);
		ll ans = (tmp / dif) * 2;
		if (tmp%dif != 0)++ans;
		cout << ans << endl;
	}
}


Measured memory_bytes: 256
import sys,collections,math,random;sys.setrecursionlimit(10**7)
from fractions import gcd
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n,u,v = Is()
tree = [[] for _ in range(n)]
for _ in range(n-1):
    a,b = Is()
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

md_u, md_v = [-1]*n, [-1]*n
qs = [[u-1,0]], [[v-1,0]]
for md,q in zip([md_u,md_v],qs):
    while q:
        n,d = q.pop()
        md[n] = d
        for e in tree[n]:
            if md[e] == -1:
                q.append([e,d+1])
#print(md_u,md_v)
ans = -2
for a,b in zip(md_u,md_v):
    if a < b:
        ans = max(b,ans)
print(ans-1)


Measured memory_bytes: 31644
import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();

		double[] a = new double[n];
		double result = 0;
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextDouble();
			result += 1 / a[i];
		}
		System.out.println(1 / result);
		sc.close();
	}

}


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

int read() {
	int x = 0, c = getchar();
	for(; !(c > 47 && c < 58); c = getchar());
	for(; (c > 47 && c < 58); c = getchar()) x = x * 10 + c - 48;
	return x;
}

int a[100005];

int main(){
    int n = read();
	for(int i = 0; i < n; a[i ++] = read());
	sort(a, a + n, greater<int>());

	int pos = 0;
	for(int i = 0; i < n; ++ i)
		if(a[i] > i) pos = i;

    if((a[pos] - pos) % 2 == 0) return puts("First"), 0;

	for(int i = pos + 1; i <= n; ++ i)
		if(a[i] <= pos) {
            if((i - pos) % 2 == 0) return puts("First"), 0;
            break;
		}

    puts("Second");
}


Measured memory_bytes: 640
while True:
    N,A,B,C,X = map(int,input().split())
    if N == 0: break
    ar = list(map(int,input().split()))
    ar.reverse()
    r = X
    for i in range(10001):
        if r == ar[-1]:
            ar.pop()
            if len(ar) == 0:
                print(i)
                break
        r = (A*r + B) % C
    else:
        print(-1)

Measured memory_bytes: 5616
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int a,b;
	cin>>a>>b;
	if (2*b>=a)
	{
		cout<<0;
		return 0;
	}
	cout<<a-2*b;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define sws ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define vi vector<int>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define sz(x) ((int) x.size())
#define fo(i, n) for( int i = 0; i < n; i++ )

const int INF = 1e9;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;


int main() {sws;

    int x;
    cin >> x;
    cout << ( x >= 30 ? "Yes\n" : "No\n");

    return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,a,b;
  int sum;
  cin >> n >> a >> b;
  sum = 0;

 for(int i = 0; i < n; i++){
     int k;
     int s;
     k = i + 1;
     s = 0;
    for(int j = 0;j <= 5; j++){
        s += k % 10;
        k = k / 10;    
        }
     if(s >= a){
         if(s <= b){
             sum += i + 1;
         }
     }
 }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef pair<string, string> pss;
#define pb push_back
#define PI acos(-1.0)
#define EPS 1e-4
#define mp make_pair
#define all(x) x.begin(), x.end()
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define fout(S,x)            cout<<fixed<<setprecision(x)<<(S)<<endl
#define present(c,x) ((c).find(x) != (c).end())
#define T() ll t;cin>>t;while(t--)
#define mem(input,b) memset(input,b,sizeof(input))
#define ff first
#define ss second
#define fread(input) freopen("input","r",stdin)
#define fwrite(b) freopen("b","w",stdout)
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#define FOREACH(i,c) for (__typeof ((c).begin()) i = (c).begin() ; i != (c).end() ; i++)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
const int maxn=1e5+5;
const int mod=1e9+7;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;  } return 0;  }
bool lessThan(const string &a, const string &b) {
    if (a == "") {
            return true;
              
    } else if (a.size() == b.size()) {
            return a < b;
              
    } else {
            return a.size() < b.size();             
    }
    
}
int main(){
    fastio;
    ll n,m;
    cin>>n>>m;
    vector<ll> a(m);
    for(int i=0;i<m;++i)
        cin>>a[i];
    vector<string> dp(n+1,"$");
    ll matches[9] = {2,5,5,4,5,6,3,7,6};
    dp[0]="";
    for(int i=0;i<n;++i){
        if(dp[i]=="$")
            continue;
        for(auto x:a){
            if(i+matches[x-1]>n){
                continue;
            }
            if(lessThan(dp[i+matches[x-1]],dp[i]+(char)('0'+x))){
                dp[i+matches[x-1]] = dp[i] + (char)('0'+x);
            }
        }
    }
    cout<<dp[n]<<endl;
    return 0;
}    


Measured memory_bytes: 43136
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>

using namespace std;
const int INF = 2000000005;
int main()
{
	int a, b, c, x, y, ans = 0;
	cin >> a >> b >> c >> x >> y;
	if (a + b > c * 2) {
		ans += c * 2 * min(x, y);
		int p1 = (max(x, y) - min(x, y)) * 2 * c;
		int p2s;
		if (x > y) p2s = a;
		else p2s = b;
		int p2 = (max(x, y) - min(x, y))*p2s;
		ans += min(p1, p2);
	}
	else {
		ans = a*x + b*y;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        arc078_b solver = new arc078_b();
        solver.solve(1, in, out);
        out.close();
    }

    static class arc078_b {
        Node[] nodes;

        public void solve(int testNumber, Scanner s, PrintWriter out) {
            int N = s.nextInt();
            nodes = new Node[N];
            for (int i = 0; i < N; i++)
                nodes[i] = new Node();
            for (int i = 1; i < N; i++) {
                int x = s.nextInt() - 1, y = s.nextInt() - 1;
                nodes[x].adj.add(nodes[y]);
                nodes[y].adj.add(nodes[x]);
            }
            int black = 0, white = 0;
            ArrayList<Node> queue = new ArrayList<>();
            nodes[0].color = 1;
            queue.add(nodes[0]);
            nodes[N - 1].color = 2;
            queue.add(nodes[N - 1]);
            while (queue.size() > 0) {
                int k = queue.size();
                while (k-- > 0) {
                    Node cur = queue.remove(0);
                    for (Node n : cur.adj) {
                        if (n.color == 0) {
                            n.color = cur.color;
                            queue.add(n);
                        }
                    }
                }
            }
            for (Node n : nodes)
                if (n.color == 1) black++;
                else white++;
            out.println((black > white) ? "Fennec" : "Snuke");
        }

        private class Node {
            int color = 0;
            ArrayList<Node> adj = new ArrayList<Node>();

        }

    }
}



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

int main(){
  int N,M;
  cin >> N >> M;
  Graph G(N);
  for (int i = 0; i < M; ++i) {
    int a, b;
    cin >> a >> b;
    G[a-1].push_back(b-1);
    G[b-1].push_back(a-1);
  }
  
  vector<int> dist(N,-1);
  queue<int> que;
  
  dist[0] = 0;
  que.push(0);
  
  while(!que.empty()){
    int v = que.front();
    que.pop();
    
    for(int nv : G[v]){
      if(dist[nv] != -1) continue;
      
      dist[nv] = v;
      que.push(nv);
    }
  }
  bool flag = true;
  for(int v=0;v<N;v++){
    if(dist[v] == -1) flag = false;
  }
  
  if(flag){
    cout << "Yes" << endl;
    for (int v = 1; v < N; ++v) cout << dist[v]+1 << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 10028
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
using ll = long long;
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pll = pair<long long,long long>;
#define cY cout<<"Yes"<<endl
#define cN cout<<"No"<<endl
const long long INF = 1LL << 60;
const long long MOD = 1000000007;

//最大最小の入れ替え
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
//コンビネーション
ll nCr(ll n, ll r) {
    ll ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}
//素因数分解
map< ll, ll > prime_factor(ll n) {
  map< ll, ll > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

//切り上げの割り算は(a + b - 1) / bでできる
//時間を意識しろ
//コードテストちゃんとして
//画面とにらめっこするな書け
//WA出すたびにABCは五億円払え
//わからない問題はとばせ
//躊躇なくぐぐれ

//ここから
int main(){
    ll N,K,R,S,P;
    cin>>N>>K>>R>>S>>P;
    map<char,ll> m;
    m['s']=R;
    m['r']=P;
    m['p']=S;
    string T;
    cin>>T;
    ll score=0;
    rep(i,N){
        if(i-K>=0){
            if(T.at(i-K)==T.at(i)){
                T.at(i)='M';
                continue;
            }
        }
        score+=m[T.at(i)];
    }
    cout<<score<<endl;
}


Measured memory_bytes: 512
#include<iostream>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll INF=2e18;
const ll MOD=1e9+7;
ll N,M;
ll modMap[100010];
ll modPairMap[100010];

int main(){
    cin>>N>>M;    
    map<ll,ll> mp;
    for(ll i=0;i<N;i++){
        ll x;
        cin>>x;
        modMap[x%M]++;
        mp[x]++;
    }
    for(auto p:mp){
        if(p.second>1){
            modPairMap[p.first%M]+=p.second/2*2;
        }
    }
    // for(ll i=0;i<M;i++){
    //     cout<<i<<":"<<modMap[i]<<endl;
    // }
    ll ans=modMap[0]/2;
    if(M%2==0)ans+=modMap[M/2]/2;
    for(ll i=1;i<(M+1)/2;i++){
        ans+=min(modMap[i],modMap[M-i]);
        if(modMap[i]>modMap[M-i]){
            ans+=min(modPairMap[i],modMap[i]-modMap[M-i])/2;
        }else{
            ans+=min(modPairMap[M-i],modMap[M-i]-modMap[i])/2;
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

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

  return 0;
}

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

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(int(n))
  return table
  
num1, num2 = map(int, input().split())

primeList = prime_decomposition(gcd(num1, num2))
primeSet = set(primeList)
print(len(primeSet) + 1)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int fibo[60] = {};

int fib(int n){
fibo[0] = 1;
fibo[1] = 1;
  for(int i = 2;i <= n;i++) fibo[i] = fibo[i - 1] + fibo[i - 2];
return fibo[n];
}

int main(){

  int n;
  cin >> n;
  cout << fib(n) << endl;

}

Measured memory_bytes: 3104
#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
#include<vector>
#include<algorithm>	

using namespace std; 

int main() 
{ 
//	ios::sync_with_stdio(0);
//	cin.tie(0);
	
	int k,a,b;
	cin>>k>>a>>b;
	b=b/k;
	if(k*b >= a){
		cout<<"OK";
	}
	else{
		cout<<"NG";
	}
	
	return 0; 
} 


Measured memory_bytes: 3596
//300
fun ac095(args: Array<String>) {
    val numList = args[1].split(" ").map { it.toInt() }
    val sortedNumList = numList.sorted()
    val medIndex = (numList.size - 1) / 2
    val med = sortedNumList[medIndex]
    val even = numList.size % 2 == 0
    val buffer = StringBuilder()
    numList.forEach {
        if (even) {
            buffer.append(if (it > med) med else sortedNumList[medIndex + 1])
        } else {
            buffer.append(if (it < med) med else sortedNumList[medIndex - 1])
        }
        buffer.append("\n")
    }
    print(buffer)
}

fun main(args: Array<String>) {
    ac095(readLineList())
}

fun readLineList(): Array<String> {
    val lineList = mutableListOf<String>()
    while (true) {
        val line = readLine()
        if (line.isNullOrBlank()) {
            break
        } else {
            lineList.add(line!!)
        }
    }
    return lineList.toTypedArray()
}

Measured memory_bytes: 94448
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
#define loop(i,a,n) for (int i = (a); (i) < (n); ++ (i))
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF (int)1e9
#define MOD (long long)1e9+7
//#define int ll
using namespace std;
typedef vector<long long> vl;

signed main() {
  ll n,k,sum=0;
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> k;
  rep(i,n-k+2) {
    sum += ((k+i)*n)-((k+i)-1)*(k+i)+1;
    sum %= MOD;
  }
  cout << sum << endl;
  return 0;
}



Measured memory_bytes: 3652
a,b,x=map(int,input().split())
import math
v=a*a*b
if x>=v/2:
    print(180*math.atan(2*(v-x)/(a*a*a))/math.pi)
else:
    print(90-(180*math.atan(2*x/(a*b*b)))/math.pi)

Measured memory_bytes: 62260
#include <bits/stdc++.h>
#define ll long long
#define arena ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
 
int main()
{
    arena
    ll a,b;
    cin>>a>>b;
    if(a<=9&&b<=9)
    cout<<a*b;
    else
    cout<<"-1";
    cout<<'\n';
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
  int a, b, c, n=0, m=1;
  scanf("%d %d %d", &a, &b, &c);
  if(1 <= a && a <= 10000 && 1 <= b && b <= 10000 && 1 <= c && c  <= 10000 && a<=b){
    for(n = a;n <= b ;n++){
      if(c%n == 0){
        m++;
      }
    }
  }
  m--;
  printf("%d\n",m);
  return 0;
}    

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef greater<int> gt;
typedef priority_queue<int, vector<int>, gt> minq;
typedef long long ll;
typedef pair<ll,ll> pll;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

int main() {
  int r; cin >> r;
  cout << 3*r*r << endl;
  return 0;
}

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

#define ll long long
#define Fi first
#define Se second
#define Pb push_back

const int INF = 1e9;
const int MOD = 1e9+7;

#define all(v) v.begin(),v.end()
#define output_s(a) printf("%s\n",(a).c_str())

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m) for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m) for(int i=(int)(n);i>=(int)(m);i++)
#define RepA(x) for(auto &item:(x))

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

//library----------------------------------------------

int main() {
    CIN(H,N);
    vector<int> v(N);
    rep(i,N) cin>>v[i];
    sort(all(v),greater<int>());
    int &ans = H;
    bool ok = false;
    rep(i,N){
        ans -= v[i];
        if(ans<=0) ok = true;
    }
    printf(ok?"Yes":"No");
    return 0;
}

Measured memory_bytes: 640
#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順

using namespace std;
using ll = long long int;

int main(){
    int R;cin>>R;
    cout << 2*R*3.141592 << endl;
    return 0;
}

Measured memory_bytes: 3776
package main

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

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func min(a, b int) int {
	if a <= b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}

func yesno(result bool) {
	if result {
		fmt.Fprintln(write, "Yes")
	} else {
		fmt.Fprintln(write, "No")
	}
}

func printansStr(result bool, a, b string) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func printansInt(result bool, a, b int) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func main() {
	defer write.Flush()

	var a int
	fmt.Fscan(read, &a)
	fmt.Fprintln(write, 3*a*a)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

ll n, m;
vector<vector<ll>> to;
vector<ll> ans;

void bfs() {
  queue<ll> q;
  ans[0] = 0;
  q.push(0);
  while (!q.empty()) {
    ll cv = q.front();
    q.pop();
    for (ll nv : to[cv]) {
      if (ans[nv] != -1) {
        continue;
      }
      ans[nv] = cv;
      q.push(nv);
    }
  }
}

int main() {
  cin >> n >> m;
  to = vector<vector<ll>>(n);
  ans = vector<ll>(n, -1);
  REP(i, m) {
    ll a, b;
    cin >> a >> b;
    a--, b--;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  bfs();

  cout << "Yes"
       << "\n";
  FOR(i, 1, n) { cout << ans[i] + 1 << "\n"; }
}

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

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

using namespace std;

typedef long long ll;
typedef long double ld;

void solve() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int n1 = (a + d - 1) / d, n2 = (c + b - 1) / b;
	if (n1 >= n2) cout << "Yes\n";
	else cout << "No\n";
}

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

Measured memory_bytes: 3648