akhauriyash/Code-Regression huggingface dataset:
#include <string>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <cmath>
#include <limits>
#include <tuple>
#include <queue>
#include <stack>
#include <array>

using namespace std;
typedef long long ll;

// ref. http://nupioca.hatenadiary.jp/entry/2013/11/03/200006

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> PI;

// res: bridges
// v: current node
// from: parent node
int dfs(VVI& g, vector<PI>& res, int v, int& count, int from, VI& low, VI& pre) {
	pre[v] = count++;
	low[v] = pre[v];
	for (VI::iterator it = g[v].begin(); it != g[v].end(); it++) {
		int to = *it;
		if (pre[to] == -1) {
			// destination has not been visited
			// visit destination and update low[v]
			low[v] = min(low[v], dfs(g, res, to, count, v, low, pre));
			if (low[to] == pre[to]) {
				// edge is not contained in a closed path -> bridge
				res.push_back(make_pair(v, to));
			}
		} else {
			if (from == to) {
				// ignore a path to parent
				continue;
			}
			low[v] = min(low[v], low[to]);
		}
	}
	return low[v];
}

// Calculate bridges in a undirected graph.
// Assume graph is connected and has no parallel edges or self-loops.
// g: adjacency list
// V: number of nodes
vector<PI> bridges(VVI& g, int V) {
	vector<PI> res;
	if (V > 0) {
		// assume at least the first vertex exists
		VI low(V, -1);  // lowest reacheable index
		VI pre(V, -1);  // pre-order index
		int count = 0;  // pre-order index counter
		dfs(g, res, 0, count, -1, low, pre);  // start dfs from vertex 0
	}
	return res;
}

int main()
{
	int N, M;
	cin >> N >> M;
	VVI G(N, VI());
	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		A--, B--;
		G[A].push_back(B);
		G[B].push_back(A);
	}
	auto ans = bridges(G, N);
	cout << ans.size() << endl;
	return 0;
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val l = readLine()!!.split(' ').map { it.toInt() }
    var a = l[0]
    var b = l[1]
    var c = l[2]
    var cnt = 0
    while (a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
        if (a == b && b == c && c == a) {
            println(-1)
            return
        }
        val nexta = b/2 + c/2
        val nextb = a/2 + c/2
        val nextc = a/2 + b/2
        a = nexta
        b = nextb
        c = nextc
        cnt++
    }
    println(cnt)
}


Measured memory_bytes: 37900
# -*- coding: utf-8 -*-
A , B = map(int, input().split())
if A == 1 and B == 1:
    print('Draw')
elif A == 1:
    print('Alice')
elif B == 1:
    print('Bob')
else:
    if A > B:
        print('Alice')
    elif A < B:
        print('Bob')
    else:
        print('Draw')
    

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=1001;
const ll INF=1LL<<61;
vector<int> T[MAX],can(MAX);
vector<pair<int,ll>> S[MAX];
vector<ll> dis(MAX);
int N;

void DFS(int u){
    for(int i=0;i<N;i++){
        can[i]=0;
    }
    can[u]=1;
    stack<int> st;
    st.push(u);
    
    while(!st.empty()){
        int a=st.top();
        st.pop();
        for(int i=0;i<T[a].size();i++){
            int b=T[a][i];
            if(can[b]) continue;
            can[b]=1;
            st.push(b);
        }
    }
}

bool bell(){
    for(int i=0;i<N;i++){
        dis[i]=INF;
    }
    dis[0]=0;
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            for(int k=0;k<S[j].size();k++){
                int a=S[j][k].first;
                long long int b=S[j][k].second;
                if(dis[j]!=INF&&dis[a]>dis[j]+b){
                    dis[a]=dis[j]+b;
                    if(i==N-1) return true;
                }
            }
        }
    }
    return false;
}

int main(){
    
    int M;cin>>N>>M;
    vector<int> A(M),B(M);
    vector<ll> C(M);
    for(int i=0;i<M;i++){
        int a,b;
        ll c;
        cin>>a>>b>>c;
        a--;b--;
        A[i]=a;
        B[i]=b;
        C[i]=c;
        T[b].push_back(a);
    }
    
    DFS(N-1);
    
    for(int i=0;i<M;i++){
        if(can[A[i]]&&can[B[i]]){
            S[A[i]].push_back(make_pair(B[i],-C[i]));
        }
    }
    
    if(bell()){
        cout<<"inf"<<endl;
    }else cout<<-dis[N-1]<<endl;
}


Measured memory_bytes: 384
#include <stdio.h>

int main(void)
{
        char s[3];

        scanf("%s",s);

        if ((s[0]!=s[1])&&(s[1]!=s[2])&&(s[2]!=s[0]))
                printf("Yes\n");
        else
                printf("No\n");

        return 0;
}

Measured memory_bytes: 128
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if v <= w:
    if a != b:
        print('NO')
    else:
        print('YES')
else:
    if abs(a - b) <= abs(v - w) * t:
        print('YES')
    else:
        print('NO')


Measured memory_bytes: 9176
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, a, b;
    cin >> n >> a >> b;
    int sol = 0;
    for (int k = 1; k <= n; ++k)
    {
        int sum = 0;
        int q = k;
        while (q)
            sum += q % 10, q /= 10;
        if (sum >= a && sum <= b)
            sol += k;
    }
    cout << sol;
}


Measured memory_bytes: 256
#include<algorithm>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<cstring>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;

using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;

#define REP(i, x, n) for(int i = (x), i##_len = int(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = int(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = int(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = int(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = int(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << endl

constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-8;

constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
constexpr int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

template<typename T>
bool chmax(T& a, T b, bool equal = false){
    if(a < b || equal && a == b){
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool chmin(T& a, T b, bool equal = false){
    if(b < a || equal && a == b){
        a = b;
        return true;
    }
    return false;
}

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

    string n;
    cin >> n;

    if(n[0] == n[2]){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int ans = 0;
		for(int i = 0 ; i <= num ;i++)
			ans += i;
		System.out.println(ans);
	}

}

Measured memory_bytes: 22484
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1001001001
#define LINF (1LL << 62)
using namespace std;
using ll = long long;
using P = pair<int, int>;

void solv() {
    int n, m;
    cin >> n >> m;
    cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl;
}

int main() {
    solv();
    return 0;
}

Measured memory_bytes: 3568
#include<bits/stdc++.h>
#define sqr(x) ((x)*(x))
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define debuge cerr<<"isok"<<endl
#define debug(x) cerr<<#x<<"="<<x<<endl
#define SS second
#define FF first
#define ls (k<<1)
#define rs (k<<1|1)
#define inf 0x3f3f3f3f
#define clr(a,x) memset(a,x,sizeof(a))
#define cpy(a,x) memcpy(a,x,sizeof(a))
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout);
using namespace std;

const int N=100005,M=100005,mod=1e9+7;
template<class T> inline void gmin(T &x,const T &y){if(x>y) x=y;}
template<class T> inline void gmax(T &x,const T &y){if(x<y) x=y;}
inline void ch(int &x,int y){x=(x+y)%mod;}
template<class T>inline void read(T &x){
	x=0;char ch=getchar(),rev=0;
	while(ch>'9'||ch<'0') rev=(ch=='-'),ch=getchar();
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	x=rev?-x:x;
}
template<class T>inline void print(T x,const char c){
	if(!x){putchar('0');putchar(c);return;}
	if(x<0) putchar('-'),x=-x;
	int m=0,a[10];
	while(x) a[m++]=x%10,x/=10;
	while(m--) putchar(a[m]+'0');
	putchar(c);
}
inline int exp(int x,int y){
	int ans=1;
	while(y){
		if(y&1) ans=(ll)ans*x%mod;
		x=(ll)x*x%mod;y>>=1;
	}return ans;
}

int n,k,a[N];

int main(){
#ifdef rqgao2014
	freopen("input.txt","r",stdin);
#endif
	scanf("%d%d",&n,&k);
	bool x1=0,x2=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		if(a[i]>=k) x1=1;
		a[1]=__gcd(a[1],a[i]);
	}
		
	if(k%a[1]==0&&x1) puts("POSSIBLE"); else puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <functional>
#include <array>

using namespace std;

int main(){
    int X, A, B;
    cin >> X >> A >> B;
    cout << (X - A) % B << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF (1<<30)-1
using ll = long long;
using namespace std;
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; }

int main(){
  int n,a,b,c,d; cin >> n >> a >> b >> c >> d;
  string s; cin >> s;
  a--; b--; c--; d--;
  bool ok = true;
  if(d < c){
    ok = false;
    for(int i = b-1; i <= d-1; i++) if(s.substr(i,3) == "...") ok = true;
  }
  bool ans = true;
  for(int i = a; i < max(c,d); i++) if(s.substr(i,2) == "##") ans = false;
  cout << (ok && ans ? "Yes" : "No");
  cout << "\n";
  return 0;
}


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

int main(){
	int q;
	scanf("%d", &q);
	bitset<64> bit(0);
	for(int i = 0; i < q; i++) {
		int id, x;
		scanf("%d", &id);
		if(id == 0) {
			scanf("%d", &x);
			printf("%d\n", bit.test(x));
		}else if(id == 1) {
			scanf("%d", &x);
			bit.set(x);
		}else if(id == 2) {
			scanf("%d", &x);
			bit.reset(x);
		}else if(id == 3) {
			scanf("%d", &x);
			bit.flip(x);
		}else if(id == 4) {
			printf("%d\n", bit.all());
		}else if(id == 5) {
			printf("%d\n", bit.any());
		}else if(id == 6) {
			printf("%d\n", bit.none());
		}else if(id == 7) {
			printf("%lu\n", bit.count());
		}else if(id == 8) {
			printf("%lu\n", bit.to_ulong());
		}

	}
}



Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const long long INF = 1e18;
//const ll mod = 1000000007;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    while(M--) {
        ll A;
        cin >> A;
        N -= A;
    }
    if(N < 0) N = -1;
    cout << N << endl;
    return 0;
}


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

class Radix {
private:
  const char* s;
  int a[128];
public:
  Radix(const char* s = "0123456789ABCDEF") : s(s) {
    int i;
    for(i = 0; s[i]; ++i)
      a[(int)s[i]] = i;
  }
  std::string to(ll p, int q) {
    int i;
    if(!p)
      return "0";
    char t[64] = { };
    for(i = 62; p; --i) {
      t[i] = s[p % q];
      p /= q;
    }
    return std::string(t + i + 1);
  }
  std::string to(const std::string& t, int p, int q) {
    return to(to(t, p), q);
  }
  ll to(const std::string& t, int p) {
    int i;
    ll sm = a[(int)t[0]];
    for(i = 1; i < (int)t.length(); ++i)
      sm = sm * p + a[(int)t[i]];
    return sm;
  }
};

int main()
{
    ll N, K;
    cin >> N >> K;

    Radix r;

    cout << r.to(N, K).length() << endl;
    
    
    return 0;
}

Measured memory_bytes: 256
sss = input()
while not sss == '0 0':
	ss = sss.split(' ')
	H = int(ss[0])
	W = int(ss[1])
	for i in range(1, H+1):
		sh = ''
		for j in range(1, W+1):
			if (j > 1 and j < W) and (i > 1 and i < H):
				sh += '.'
			else:
				sh += '#'
		print(sh)
	print('')
	sss = input()


Measured memory_bytes: 7624
/*
ID: learnin7
TASK: test
LANG: C++                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main(){
        
    ios_base::sync_with_stdio(0);
    //ofstream fout ("test.out");
    //ifstream fin ("test.in");
    //fin >> a >> b;
    //fout << a+b << endl;
    ll h;
    cin>>h;
    ll expo = ll(log2(h)) + 1;
    ll ans = ll(pow(2, expo)) - 1;
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 256
n = int(input())
s = 0

for i in range(n + 1):
  
  if i % 3 == 0 and i % 5 == 0:
    continue
  elif i % 3 == 0:
    continue
    
  elif i % 5 == 0:
    continue
    
  else:
    s = s + i
    
print(s)
    

Measured memory_bytes: 9156
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
const lli N=1e5+5;
vector<lli> v[N];

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    lli n,m;
    cin>>n>>m;
    lli i,x,y,h[n+1],flag=1;
    
    for(i=1;i<=n;i++) cin>>h[i];
    
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    
    lli ans=0;
    for(i=1;i<=n;i++)
    {
        flag=1;
        for(auto j : v[i])
        {
            if(h[j]>=h[i])
            {
                flag=0;
            }
        }
        if(flag) ans++;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 10276
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    int x,y,z;
    cin >> x >> y >> z;
    int r,ans;
   ans = 0;
    r = x - z;
    while (r>=y+z){
        ans++;
        r = r-y-z;
    }
    cout << ans << endl;
}

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

public class Main {

    FastReader in = new FastReader();
    PrintWriter out = new PrintWriter(System.out);
    int N = (int)1e5+1, mod = (int)1e9+7,n,m; 


    void solve(){
        char[] a = in.next().toCharArray();
        int ans1 = 0,ans2 = 0;
        for(int i=0;i<a.length;i++){
            if(i%2==0){
                ans1 += a[i]=='0'?0:1;
                ans2 += a[i]=='0'?1:0;
            }   
            else{
                ans1 += a[i]=='1'?0:1;
                ans2 += a[i]=='1'?1:0;
            }
        }
        out.println(Math.min(ans1,ans2));
    }

    void run(){
        solve();
        // out.flush();
        out.close();
    }
    public static void main(String[] args) {
        boolean memory = false;
        Thread t=new Thread(null, null, "T", 1<<28) {
            public void run() {
                new Main().run();
            }
        };
        if(memory) t.start();
        else new Main().run();
    }
    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine(){
            String str = "";
            try{   
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }  
            return str;
        }
        int ni(){return Integer.parseInt(in.next());}
        long nl(){return Long.parseLong(in.next());}
        double nd(){return Double.parseDouble(in.next());}
    }
    class Edges{
        int u,v,w;
        public Edges(int u,int v,int w){
            this.u = u;
            this.v = v;
            this.w = w;
        }
    }
    void pn(Object o){out.println(o);out.flush();}
    long inv(long a, long b){return 1<a ? b - inv(b%a,a)*b/a : 1;}//a^(-1)%b
    long fe(long a,long b){
        long ans = 1L;
        while(b>0){
            if((b&1)>0)ans=ans*a%mod;
            a = a%mod*a%mod;
            b>>=1;
        }
        // pn("ans = "+ans);
        return ans;
    }
    long gcd(long a,long b){
        if(a==0)return b;
        return gcd(b%a,a);
    }
    class pair{
        int x,y;
        public pair(int f,int s){
            this.x = f;
            this.y = s;
        }
    }
    class triple{
        int i,l,r;
        public triple(int i,int l,int r){
            this.i = i;
            this.l = l;
            this.r = r;
        }
    }
}

Measured memory_bytes: 25172
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		String s = sc.get();
		System.out.println(s.matches("[a-z]") ? "a" : "A");
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}

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

struct Ftree {
  vector<int> dat;
  Ftree(int n) : dat(n + 1) {}
  void add(int x, int v) {
    for (int i = x + 1; i < dat.size(); i += i & -i) {
      dat[i] += v;
    }
  }
  int sum(int x) {
    if (x < 0) return 0;
    int res = 0;
    for (int i = x + 1; i; i -= i & -i) {
      res += dat[i];
    }
    return res;
  }
};

signed main() {
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  vector<int> A(N);
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
  }

  int maxa = *max_element(A.begin(), A.end());
  int ans = -1; {
    int lb = 0;
    int ub = maxa + 1;
    while (ub - lb > 1) {
      int mb = lb + ub >> 1;
      vector<int> a = A;
      for (int &v : a) v = v < mb ? -1 : 1;
      vector<int> sa = vector<int>(a.size() + 1);
      for (int i = 0; i < a.size(); ++i) {
        sa[i + 1] = sa[i] + a[i];
      }
      Ftree tree(2 * N + 1);
      int64_t cnt = 0;
      for (int v : sa) {
        cnt += tree.sum(2 * N) - tree.sum(N + v);
        tree.add(N + v, 1);
      }
      (1LL*N*(N+1)/4 < cnt ? ub : lb) = mb;
    }
    ans = lb;
  }

  cout << ans << endl;

  return 0;
}


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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;


int main() {
    string S; cin >> S;
    int n = 0, w = 0, e = 0, s = 0;
    for(int i = 0; i < (int)S.size(); i++){
        if(S[i] == 'N') n++;
        if(S[i] == 'S') s++;
        if(S[i] == 'E') e++;
        if(S[i] == 'W') w++;
    }

    if((0 < n && s == 0) || (n == 0 && 0 < s)){
        cout << "No" << endl;
        return 0;
    }
    if((0 < e && w == 0) || (e == 0 && 0 < w)){
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 3568
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)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (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")
    };
}

use std::cmp::{min, max};

fn main() {
    input!{
        w: usize,
        h: usize,
        x: usize,
        y: usize
    }
    print!("{} ", (w * h) as f64 / 2.0);
    if x * 2 == w && y * 2 == h {
        println!("1");
    } else {
        println!("0");
    }
}


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

vector<long long> a,f;
long long sum=0,k;
int n;

//{{{ Check
bool Check(long long time){
	long long tmp=0;
	for(int i=0;i<n;i++){
		tmp+=min(time/f[i] , a[i]);
	}

	if(sum-tmp<=k)return true;
	else return false;
}
//}}}

int main(){
	cin>>n>>k;
	a.resize(n);	f.resize(n);
	for(int i=0;i<n;i++){ cin>>a[i];	sum+=a[i]; }
	for(int i=0;i<n;i++){ cin>>f[i]; }

	sort(a.begin(), a.end());
	sort(f.begin(), f.end(), greater<>());

	long long R=1e12, L=-1;
	while(R-L!=1){
		long long mid=(R+L)/2;
		if(Check(mid)){
			R=mid;
		}else{
			L=mid;
		}
	}
	cout<<R<<endl;

	return 0;
}


Measured memory_bytes: 3456
#include <iostream>
#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define debug int debug = 0;
#define RREP(i,a) for(int i=a-1;i>=0;i--)
#define rrep(i,a,b) for(int i=a-1;i>=b;i--)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> Pi;
typedef pair<int, Pi> V;
typedef vector<int> VE;
const ll mod = 1e9 + 7; //10^9+7

int gcd(int m,int n){
    if((m==0)||(n==0))return 0;

    while(m!=n){
        if(m>n)m=m-n;
        else n=n-m;
    }
    return m;
}

int main(){
    int n, x;
    VE xc;
    VE sub;
    cin >> n >> x;
    int X;
    REP(i, n){
        cin >> X;
        xc.push_back(X);
    }
    xc.push_back(x);
    sort(xc.begin(), xc.end());
//    REP(i, n + 1){
//        print(xc[i]);
//    }
    REP(i, n){
        sub.push_back(xc[i + 1] - xc[i]);
//        print(sub[i]);
    }
    int ans = sub[0];
    rep(i, 1, n){
        ans = gcd(sub[i], ans);
    }
    print(ans);
}

Measured memory_bytes: 1400
import sys

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


def main():
    X, Y, Z = map(int, readline().split())

    ans = (X - Z) // (Y + Z)

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9184
open System
open System.Collections.Generic;

let S =stdin.ReadLine()
let T =stdin.ReadLine()
[<EntryPoint>]
let sf argv = 
    let mutable ans = 0
    for i in [0.. 2] do
        ans <- ans + if S.[i]=T.[i] then 1 else 0
    printf "%d" ans
    0


Measured memory_bytes: 14044
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}

constexpr int inf = 1e9;
constexpr ll linf = 3e18;
constexpr double eps = 1e-9;

int Q;
string S;

signed main()
{
    cin >> S >> Q;
    int rev = 0;
    vector<char> arr[2];
    rep(_, Q) {
        int t; cin >> t;
        if (t == 1) {
            rev++;
        } else {
            int f; char c;
            cin >> f >> c;
            if (f == 1) {
                if (rev % 2 == 0) {
                    arr[0].push_back(c);
                } else {
                    arr[1].push_back(c);
                }
            } else {
                if (rev % 2 == 0) {
                    arr[1].push_back(c);
                } else {
                    arr[0].push_back(c);
                }
            }
        }
    }

    // 実質反転してない
    if (rev % 2 == 0) {
        rrep(i, arr[0].size()) printf("%c", arr[0][i]);
        cout << S;
        rep(i, arr[1].size()) printf("%c", arr[1][i]);
        printf("\n");
    } else {
        rrep(i, arr[1].size()) printf("%c", arr[1][i]);
        reverse(all(S));
        cout << S;
        rep(i, arr[0].size()) printf("%c", arr[0][i]);
        printf("\n");
    }
}


Measured memory_bytes: 1024
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
l=[]
for i in range(N):
    l.append([A[i],3])
    l.append([B[i],2])
    l.append([C[i],1])
l.sort()
a=0
c=N
s=0
for i in range(3*N):
    if l[i][1]==3:
        a+=1
    elif l[i][1]==2:
        s+=a*c
    else:
        c-=1
print(s)

Measured memory_bytes: 49552
//
#include <vector>
#include <set>
#include <array>
#include <iostream>
#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <numeric>
#include <bitset>
//
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);++i)
inline void yes(bool cond) { cond ? puts("Yes") : puts("No"); }
template<typename Type> inline void chmin(Type& a, Type b) { if (a > b) a = b; }
template<typename Type> inline void chmax(Type& a, Type b) { if (a < b) a = b; }
template<typename Arr, typename Type> inline void fill(Arr& arr, Type v) { std::fill(arr.begin(), arr.end(), v); }
template<typename Type> inline void sort(Type& arr) { std::sort(arr.begin(), arr.end()); }
template<typename Type> inline Type nth(vector<Type>& arr, size_t pos) { std::nth_element(arr.begin(), arr.begin() + pos, arr.end()); return arr[pos]; }
constexpr double BIGP = 1000000007L;
constexpr double INF_I = std::numeric_limits<double>::max();
constexpr double INF_F = std::numeric_limits<float>::infinity();
constexpr double PI = 3.14159265358979323846L;
//
int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    //
    ll N, K;
    cin >> N >> K;
    ll i=0;
    for (;N!=0;++i)
    {
        N = N / K;
    }
    cout << i;

    return 0;
}

Measured memory_bytes: 3144
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

const int mod = 1000000007;
struct mint {
    ll x;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) {
            x -= mod;
        }
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) {
            x -= mod;
        }
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

ll modpow(ll x, ll n){
    ll ret = 1;
    while(n > 0){
        if(n & 1)(ret *= x) %= mod;
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<vector<int>> to(200000);
vector<int> cnt(200000);

int dfs(int v, int p = -1){
    int ret = 1;
    for(int t : to[v]){
        if(t == p)continue;
        ret += dfs(t, v);
    }
    cnt[v] = ret;
    return ret;
}

int main() {
    int n;
    cin >> n;
    rep(i, n-1){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    dfs(0);
    mint ans = 0;
    rep(i, n){
        if(i == 0){
            if(to[i].size() == 1)continue;
            vector<mint> d(to[i].size(), 1);
            rep(j, to[i].size()){
                d[j] *= modpow(2, cnt[to[i][j]]);
                d[j] -= 1;
            }
            mint sum = modpow(2, n-1);
            rep(j, d.size())sum -= d[j];
            sum -= 1;
            ans += sum;
        }else{
            if(to[i].size() == 1)continue;
            int tot = 0;
            int mx = 0;
            for(int t : to[i]){
                tot += cnt[t];
                mx = max(mx, cnt[t]);
            }
            vector<mint> d(to[i].size(), 1);
            rep(j, to[i].size()){
                if(cnt[to[i][j]] == mx){
                    int c = n - (tot-mx+1);
                    d[j] *= modpow(2, c);
                }else d[j] *= modpow(2, cnt[to[i][j]]);
                d[j] -= 1;
            }
            mint sum = modpow(2, n-1);
            rep(j, d.size())sum -= d[j];
            sum -= 1;
            ans += sum;
        }
    }
    
    mint dev = modpow(2, n);
    ans /= dev;
    cout << ans.x << endl;
}

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

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

int main(){
	int Q;
	cin >> Q;
	vector<int> l(Q),r(Q);
	for(int i=0;i<Q;i++)	cin >> l.at(i) >> r.at(i);
	
	vector<bool> prime(1e5+1,true);
	prime.at(0)=false;
	prime.at(1)=false;
	for(int i=2;i*i<=1e5;i++){
		if(prime.at(i)){
			for(int j=2;i*j<=1e5;j++){
				prime.at(i*j)=false;
			}
		}
	}
	vector<bool> like_num(1e5+1,false);
	for(int i=1;i<=1e5;i+=2){
		if(prime.at(i) && prime.at((i+1)/2))	like_num.at(i)=true;
	}
	vector<int> imos(1e5+1,0);
	for(int i=1;i<=1e5;i++){
		if(like_num.at(i))	imos.at(i)=imos.at(i-1)+1;
		else	imos.at(i)=imos.at(i-1);
	}

	for(int i=0;i<Q;i++){
		cout << imos.at(r.at(i)) - imos.at(l.at(i)-1) << endl;
	}
	
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)
 
using namespace std;
 
typedef long long ll;
 
const int max_k = 160 * 80;
bool dp[81][81][max_k+1];
 
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
 
	int h, w;
	cin >> h >> w;
 
	int a[h][w];
	rep(i, h) rep(j, w) cin >> a[i][j];
 
	int b[h][w];
	rep(i, h) rep(j, w) cin >> b[i][j];
 
	rep(i, 81) rep(j, 81) rep(k, max_k+1) dp[i][j][k] = false;
	dp[0][1][0] = true;
	dp[1][0][0] = true;
 
	rep(i, h) rep(j, w) rep(k, max_k+1){
		int d = abs(a[i][j] - b[i][j]);
 
		if(k + d <= max_k) dp[i+1][j+1][k + d] |= dp[i+1][j][k];
		if(abs(k - d) <= max_k) dp[i+1][j+1][abs(k - d)] |= dp[i+1][j][k];
		if(k + d <= max_k) dp[i+1][j+1][k + d] |= dp[i][j+1][k];
		if(abs(k - d) <= max_k) dp[i+1][j+1][abs(k - d)] |= dp[i][j+1][k];
 
	}
 
	rep(k, max_k + 1) {
		if(dp[h][w][k]) {
			cout << k << endl;
			return 0;
		}
	}
}

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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n;
    cin >> n;

    int c0 = 0, c1 = 0, c2 = 0, c3 =0;
    for (int i=0; i<n; i++) {
        string s;
        cin >> s;

        if (s == "AC") c0++;
        else if (s == "WA") c1++;
        else if (s == "TLE") c2++;
        else c3++;
    }

    cout << "AC x " << c0 << "\nWA x " << c1 << "\nTLE x " << c2 << "\nRE x " << c3 << "\n";

    return 0;
}


Measured memory_bytes: 3668
#include <iostream>
#include <vector>
#include <set>
#include <map>

using namespace std;

typedef long long ll;



int main(){
    int H,W,M;
    cin>>H>>W>>M;
    set<pair<int,int>> st;
    vector<int> H_n(H,0);
    vector<int> W_n(W,0);
 
    
    for(int i=0;i!=M;++i){
        int h,w;
        cin>>h>>w;
        --h;--w;
        st.insert(make_pair(h,w));
        ++H_n[h];
        ++W_n[w];
        
    }
    /*
    cout<<"----set----"<<endl;
    
    for(set<pair<int,int> >::iterator itr=st.begin();itr!=st.end();++itr){
        cout<<itr->first<<":"<<itr->second<<endl;
    }
    */

    
    int max_h=0;
    int max_w=0;
    
    vector<int> vh;
    vector<int> vw;
    
    for(int i=0;i<H;i++){
        max_h=max(max_h,H_n[i]);
    }
    
    //cout<<max_h<<endl;
    
    for(int i=0;i<H;i++){
        if(H_n[i]==max_h){
            vh.push_back(i);
        }
      }
    
    /*
    for(int i=0;i<vh.size();i++){
         cout<<vh[i]<<" ";
     }
     cout<<endl;
     */

    for(int i=0;i<W;i++){
        max_w=max(max_w,W_n[i]);
    }
    
    //cout<<max_w<<endl;

    for(int i=0;i<W;i++){
        if(W_n[i]==max_w){
            vw.push_back(i);
        }
    }
    /*
    for(int i=0;i<vw.size();i++){
        cout<<vw[i]<<" ";
    }
    cout<<endl;
    */
    
    bool flag=false;
    for(int i=0;i<vh.size();++i){
        for(int j=0;j<vw.size();++j){
            if(st.find(make_pair(vh[i],vw[j]))==st.end()){
                
               // cout<<"????"<<endl;
                flag=true;
                break;
            }
        }
    }
    
    //cout<<flag<<endl;
    
    if(flag){
        cout<<max_h+max_w<<endl;
    }else{
        cout<<max_h+max_w-1<<endl;
    }
        
    
    
}


Measured memory_bytes: 23852
#include<iostream>
using namespace std;
int main(){
int price,cnt=0;
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
if((price/500)!=0){
cnt+=(price/500);
price-=(price/500)*500;
}
if((price/100)!=0){
cnt+=(price/100);
price-=(price/100)*100;
}
if((price/50)!=0){
cnt+=(price/50);
price-=(price/50)*50;
}
if((price/10)!=0){
cnt+=(price/10);
price-=(price/10)*10;
}
if((price/5)!=0){
cnt+=(price/5);
price-=(price/5)*5;
}
if(price!=0){
cnt+=price;
price-=price;
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
}

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

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    int ans = 0;
    while(true){
        bool result = true;
        for(int i = 0; i < n; i++){
            result &= (a[i] % 2 == 0);
            if(!result) break;
        }
        if(!result){
            break;
        } else {
            ans++;
            for(int i = 0; i < n; i++){
                a[i] /= 2;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	//	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)

	s := getString()
	var ans string

	for i := 0; i < len(s); i++ {
		if s[i] == '0' {
			ans += "0"
		} else if s[i] == '1' {
			ans += "1"
		} else if len(ans) != 0 {
			ans = ans[0 : len(ans)-1]
		}
	}
	fmt.Println(ans)

}


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

using namespace std;

#define LIMIT 100
typedef pair<int64_t, int64_t> ii;
typedef int64_t ll;
int gcd(ll a, ll b) { return (b==0)?a:gcd(b, a%b); }
int lcm(ll a, ll b) { ll i=(a/gcd(a,b))*b; assert(i>0); return i; }

//  ***** MAIN *****
int main(){
  //ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n; string s;
  cin >> s ;
  n = stoi(s);
  int d = 0;
  for(char c : s){d += c-'0'; }
  if(n%d== 0){
    std::cout << "Yes" << std::endl;
  }
  else {
    std::cout << "No" << std::endl;
  }

  return 0;
}



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

using namespace std;

int main()
{

    int a, b ;
    cin >> a >> b;
    int interval = b - a;
    for(int i = 1; i <= interval; i++)
    {
        b -= i;

    }
    cout << abs(b) << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define ll long long
#define INF 999999999

const ll mod = 1e9+7;

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;

int main(){
  long long int A, M ;
  long double B ;
  cin >> A >> B ;
  long long int ans = A * B ;
  
  cout << ans << endl ;
  return 0 ;
}  

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

int main(){
    int x;
    cin>>x;
    int a[10000];
    for(int i=0;i<x;i++) cin>>a[i];
    
    int mn = a[0], mx = a[0];
    long long sum = 0;
    for(int i=0;i<x;i++){
        mn=min(mn, a [i]);
        mx = max(mx, a[i]);
        sum += a[i];
        
    }
    
    cout<<mn<<" "<<mx<<" "<<sum<<endl;
    return 0;
        
        
    
    
    
}


Measured memory_bytes: 3124
"use strict";

const main = (arg) => {
  const input = arg.trim().split(" ");
  const strAnsewer = input[0] + input[1];
  const heiho = parseInt(strAnsewer);

  for (let i = 0; i < heiho; i++) {
    let answer = i * i;
    if (heiho === answer) {
      console.log("Yes");
      break;
    }
    if (heiho < answer) {
      console.log("No");
      break;
    }
  }
};
main(require("fs").readFileSync("/dev/stdin", "utf8"));
// main("12 10");
// https://atcoder.jp/contests/abc086/tasks/abc086_b


Measured memory_bytes: 21064
#include<iostream>

using namespace std;

typedef long long ll;

int main()
{
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	ll ans = a * c;
	ans = max(ans, a * d);
	ans = max(ans, b * c);
	ans = max(ans, b * d);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std; 
using namespace __gnu_pbds;
#define pb push_back
#define int long long
#define m_p make_pair
#define pair pair<int,int> 
//#define M 998244353
#define M 1000000007
const int inf=4e18;
const int MX=100;
const int MN=-100;
const double pi=3.14159265358979;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
int power(int x,int y)
{
	int res=1;
	x=x%M;
	while(y>0)
	{
		if(y&1)
			res=(res*x)%M;
		y=y>>1;
		x=(x*x)%M;
	}
	return res;
}
int nCr(int n,int r,int fac[])
{
	return fac[n]*power(fac[r],M-2)%M*power(fac[n-r],M-2)%M;
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	int n,k;cin>>n>>k;
	int fac[n+1],a[n+1],i;fac[0]=1;
	for(i=1;i<=n;i++)
		fac[i]=fac[i-1]*i%M;
	int o=0;
	for(i=1;i<=n;i++)
		cin>>a[i];
	sort(a+1,a+n+1);
	for(i=1;i<=n;i++)
	{
		if(i<=n-k+1)
			o=(o-(nCr(n-i,k-1,fac)*(a[i]+M)%M)%M+M)%M;
		if(i>=k)
			o=(o+(nCr(i-1,k-1,fac)*(a[i]+M)%M)%M)%M;
	}
	cout<<o<<endl;
}

Measured memory_bytes: 1792
a, b ,c = map(int, input().split())

if a > b:
     temp = a
     a = b
     b = temp
if b > c:
    temp = b
    b = c
    c = temp
if a > b:
     temp = a
     a = b
     b = temp
print(str(a) + ' ' + str(b) + ' ' + str(c))



Measured memory_bytes: 5596
#include<bits/stdc++.h>
using namespace std;
int A[100000];
int partition(int p,int r){
    int i=0;
    for(int j=p;j<=r;j++){
        if(A[j]<=A[r]){
            int tmp=A[i];
            A[i]=A[j];
            A[j]=tmp;
            i++;
        }
        /*for(int k=0;k<r;k++){
            cout<<A[k];
            if(k!=r) cout<<" ";
        }
        cout<<endl;*/
    }
    return i-1;
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++) cin>>A[i];
    int q=partition(0,n-1);
    for(int i=0;i<n;i++){
        if(i==q){
            cout<<"[";
        }
        cout<<A[i];
        if(i==q){
            cout<<"]";
        }
        if(i!=n-1) cout<<" ";
    }
    cout<<endl;
    return 0;
}



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

int main(){
	char tile[3];	for(int i=0;i<3;i++)cin>>tile[i];

	char ch;
	string ans="YES";
	for(int i=2;i>=0;i--){
		cin>>ch;
		if(ch!=tile[i])ans="NO";
	}

	cout<<ans<<endl;


	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
int Max(int(a), int(b), int(c)) {
	return max(max(a, b), c);
}
int Min(int(a), int(b), int(c)) {
	return min(min(a, b), c);
}





int main() {

	ll A,B,C,D;
	cin >> A>>B>>C>>D;
	string s = "NO";
	if (A + B + C + D == 21 && A * B * C * D == 252) {
		s = "YES";
	}
	cout <<s<< endl;


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
ll ca(ll x,ll y){
    if(y==0)return 0;
    else if(y==1)return x;
    else if(y==2)return 2*x-1;
    return -1;
}
int main(void){
    ll a,b;
    cin>>a>>b;
    ll ans=0;
    rep(0,i,3){
        ll sum=ca(a,i)+ca(b,2-i);
        //cout<<sum<<endl;
        ans=max(ans,sum);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
using namespace std;
char ch;
int cnt=0,x,cnt2;
int in[2000][2];
map <int,int> t;
map <int,bool>u;
map <int,bool>v;
string str;
vector <int> w;
int main(){
  while(getline(cin,str)){
    if(str=="")cnt2=cnt;
    x=0;
    for(int i=0;i<(int)str.size();i++){
      if('0'<=str[i]&&str[i]<='9')x=x*10+str[i]-'0';
      else break;
    }
    in[cnt][0]=x;
    cnt++;
  }
  
  for(int i=0;i<cnt2;i++){
    if(t[in[i][0]]==0)w.push_back(in[i][0]);
    t[in[i][0]]++;
    u[in[i][0]]=true;
  }

  for(int i=cnt2+1;i<cnt;i++){
    t[in[i][0]]++;
    v[in[i][0]]=true;
  }
  sort(w.begin(),w.end());
  for(int i=0;i<(int)w.size();i++){
    if(u[w[i]]&&v[w[i]])cout<<w[i]<<" "<<t[w[i]]<<endl;
  }
  return 0;
}

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


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

  for (int i = 1; i <= n; i++) {
    printf("node %d: key = %d, ", i, heap[i]);
    if (i != 1)
      printf("parent key = %d, ", heap[i/2]);
    if (2*i <= n)
      printf("left key = %d, ", heap[2*i]);
    if (2*i+1 <= n)
      printf("right key = %d, ", heap[2*i+1]);
    printf("\n");
  }
  return EXIT_SUCCESS;
}




Measured memory_bytes: 3228
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
  int h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int hour;
  int min;

  int t1, t2, t3;
  t3 = h2 * 60 + m2;
  t2 = t3 - k;
  t1 = h1 * 60 + m1;

  int ans;
  
  ans = t2 - t1;

  cout << ans << endl;


}

Measured memory_bytes: 3632
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {


	static Scanner scan = new Scanner(System.in);
	public static void main(String[] args){
		int a = scan.nextInt();
		int b = scan.nextInt();
//		int a = Integer.parseInt(args[0]);
//		int b = Integer.parseInt(args[1]);

		int d = a /b;
		int r = a % b;
		double f = (double)a/b;
		BigDecimal src = BigDecimal.valueOf(f);
		src  = src.setScale(6, BigDecimal.ROUND_DOWN);
		
		System.out.println(d+" "+r+" "+src);
	}
}



Measured memory_bytes: 26428