akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

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

        int[] L = new int[N];
        for (int i = 0; i < N; i++) {
            L[i] = sc.nextInt();
        }

        int sum = 0;
        int i = 0;
        for (; i < N; i++) {
            sum += L[i];
            if (sum > X) {
                break;
            }
        }

        System.out.println(i + 1);
    }
}

Measured memory_bytes: 23760
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <tuple>
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    cout << (a * b % 2 ? "Odd" : "Even") << endl;
    return 0;
}

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

int main() {
    string o, e;
    cin >> o >> e;

    string ans;
    for(int i = 1; i <= o.size() + e.size(); i++) {
        if(i % 2 == 1) ans.push_back(o[i/2]);
        else ans.push_back(e[i/2-1]);
    }

    cout << ans << endl;

    return 0;  
}

Measured memory_bytes: 256
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 1))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (ql:quickload :cl-debug-print))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)

;; BEGIN_INSERTED_CONTENTS
(defmacro println (obj &optional (stream '*standard-output*))
  `(let ((*read-default-float-format* 'double-float))
     (prog1 (princ ,obj ,stream) (terpri ,stream))))

;; Hauptteil

(declaim (inline find-smallest-delta))
(defun find-smallest-delta (table k)
  (loop for begin-idx from 0
        for end-idx from (- (min k (length table)) 1) below (length table)
        minimize (- (aref table end-idx) (aref table begin-idx))))

(deftype uint nil `(integer 0 ,(expt 10 9)))
(defun main ()
  (declare #.OPT)
  (let* ((n (read))
         (k (read))
         (table (make-array (list n) :element-type 'uint)))
    (declare (uint k))
    (dotimes (idx n)
      (setf (aref table idx) (parse-integer (read-line))))
    (sort table #'<)
    (println (find-smallest-delta table k))))

#-swank(main)


Measured memory_bytes: 41448
object Main extends App {
  val n = io.StdIn.readLine.toInt
  val ans = Iterator.continually(io.StdIn.readLine.split(" "))
    .take(n)
    .forall(in => {
      val c = in(0).toInt - in(1).toInt - in(2).toInt
      if (c >= 0 && (c & 1) == 0) true else false
    })

  println(if(ans) "Yes" else "No")
}

Measured memory_bytes: 43592
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int MOD = 1000000007;
int INF = numeric_limits<int>::max() / 2;
 
 
signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
 
  int N;
  cin >> N;
  int A[N];
  rep(i, N) cin >> A[i];
  int sum[N+1] = {};
  map<int, int> mp;
  mp[0]++;
  for(int i=0;i<N;i++){
    sum[i+1] = sum[i] + A[i];
    mp[sum[i+1]]++;
  }

  int ans = 0;
  for(auto P : mp){
    ans += P.second*(P.second-1)/2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 15872
#include<stdio.h>
int main(void){//float?????????double???
int a,b,r,i;
char op;
i=1;
while(i=1){
scanf("%d %c %d",&a,&op,&b);//??????????????¨??????%c?????§char??§??£?¨?
if(op=='+'){
r=a+b;
printf("%d\n",r);
}
if(op=='-'){
r=a-b;
printf("%d\n",r);
}
if(op=='*'){
r=a*b;
printf("%d\n",r);
}
if(op=='/'){
r=a/b;
printf("%d\n",r);
}
if(op=='?'){
 return 0;
}
}
return 0;
}

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

#define FOR(i,a,b) for(int i=(a); i<(b); ++i)
inline int in() {int x; cin >> x; return x;}

bool is_prime(int x){
  for (int i=2; i*i<=x; i++)
    if (x%i == 0)
      return false;
  return true;
}
void solve() {
  int x = in();
  while (!is_prime(x)) x++;
  cout << x << endl;
}

#undef int
int main() {
  solve();
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n,a,b;
	cin>>n>>a>>b;
	int cnt1,cnt2;
	if(n>a) cnt1=n-a;
	else cnt1=a-n;
	if(n>b) cnt2=n-b;
	else cnt2=b-n;
	if(cnt1>cnt2) cout<<"B";
	else cout<<"A";
	return 0;
}

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

int main()
{   float n;
    cin >> n;
    float v[101];
    float sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        sum += 1 / v[i];
    }
    cout << 1.0 / sum;

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;

const int MAXN = 1E5 + 10;

int n;
ll a[MAXN];

int main(){
	ll A, B;
	scanf("%d%lld%lld", &n, &A, &B);
	ll ans = 0;
	for (int i = 1; i <= n; ++i){
		scanf("%lld", a + i);
		if (i > 1)
			ans += min((a[i] - a[i - 1]) * A, B);
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
#define LL long long

int main(){
	LL a, n, i, cur, addBy=0, prev=std::numeric_limits<LL>::max(), subSequences=0;
	std::cin >> n;
	std::vector<LL> sums(n+1);
	sums[0] = 0;
	for(i=0;i<n;i++){
		std::cin >> a;
		sums[i+1] = sums[i]+a;
	}

	std::sort(sums.begin(), sums.end());

	for(i=0;i<=n;i++){
		cur = sums[i];
		if(cur!=prev){
            prev = cur;
            addBy = 0;
		} else {
            addBy++;
            subSequences+=addBy;
		}
	}

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


Measured memory_bytes: 1792
import java.util.Scanner;
 
// C - Dubious Document 2
// https://atcoder.jp/contests/abc076/tasks/abc076_c
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        String T = scanner.next();
        scanner.close();
 
        // 正規表現で判定するため ? を . に変換する
        S = S.replaceAll("\\?", ".");
 
        int length = S.length();
        int tLength = T.length();
        for (int i = length - tLength; i >= 0; i--) {
            String regex = S.substring(i, i + tLength);
            if (T.matches(regex)) {
                S = S.replaceFirst(S.substring(0, i) + regex, S.substring(0, i) + T);
                System.out.println(S.replaceAll("\\.", "a"));
                return;
            }
        }
 
        System.out.println("UNRESTORABLE");
    }
}

Measured memory_bytes: 21844
/*Arnab's Code
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define vll vector<ll>
#define vii vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>/*Arnab's Code
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define vll vector<ll>
#define vii vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define take(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define takes(a,n,st) for(ll i=st;i<n+st;i++)cin>>a[i]
ll sum(ll a[],ll n,ll s){ for(ll i=0;i<n;i++)s+=a[i]; return s;}
#define mod 1000000009
ll power(ll x, ll y, ll p)  {  
    ll res = 1;  
    x = x % p;   
    if (x == 0) return 0;  
    while (y > 0){  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1;
        x = (x*x) % p;  
    }  
    return res;  
}
void solve(){
	ll d,t,s;
	cin>>d>>t>>s;
	if(t*s < d)
		cout<<"No";
	else
		cout<<"Yes";
	return;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ll t,T;
//	cin>>T;
	T=1;
	for(t=1;t<=T;t++){
//		cout<<"Case #"<<t<<": ";
		solve();
	}
	return 0;
}


Measured memory_bytes: 3648
#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 fi first
#define se second
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;
#define MAX int(1e5 +5)

int main(){
    llong a,b,c;
    cin >> a >> b >> c;
    cout << b + min(c,a+b+1) << endl;
}

Measured memory_bytes: 256
/****************************************************
*   Template for coding contests                    *
*   Author    :    Sanjeev Sharma                   *
*   Email     :    thedevelopersanjeev@gmail.com    *
*****************************************************/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    const int mod = 2019;
    int l, r;
    cin >>l >>r;
    if((l-1) / mod != r / mod){
        cout <<0;
        return 0;
    }
    l %= mod;
    r %= mod;
    int ans = mod - 1;
    for(int i = l; i < r; i++){
        for(int j = i+1; j <= r; j++){
            ans = min(ans, (i*j)%mod);
        }
    }
    cout <<ans;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#define all(x) (x).begin(),(x).end()
typedef long long ll;

using namespace std;

int main()
{
    ll N, M;    cin >> N >> M;
    ll mod2 = 1000000007;
    ll ans = 1;
    if(abs(N-M) > 1)    ans = 0;
    else{
        for(ll i=min(N,M); i>0; i--)    ans = ans*i%mod2;
      	ans = ans*ans%mod2;
        if(N != M)  ans = ans*max(N,M)%mod2;
        else   ans = ans*2%mod2;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3580
import java.util.Scanner;

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

    int n;
    double[] s;
    while ((n = reader.nextInt()) != 0) {
      s = new double[n];
      double sum = 0;
      for (int i = 0; i < n; i++) {
        s[i] = reader.nextDouble();
        sum += s[i];
      }
      double m = sum / n;

      double sumA = 0;
      for (int i = 0; i < n; i++) {
        sumA += Math.pow(s[i] - m, 2);
      }
      sumA /= n;
      double Alpha = Math.sqrt(sumA);
      System.out.println(Alpha);
    }
  }
}

Measured memory_bytes: 39604
import sys
def input(): return sys.stdin.readline().strip()

def main():
    l,r=map(int,input().split())
    if r-l>2018:
        print(0)
        return
    print(min((i*j)%2019 for i in range(l,r) for j in range(i+1,r+1)))

main()

Measured memory_bytes: 2940
a = int(input())
ar = list(map(int,input().split(" ")))
br = []
count = 0
for r in ar:
    if r >= 1 and r <= 399:
        br.append("g")
    elif r >= 400 and r <= 799:
        br.append("b")
    elif r >= 800 and r <= 1199:
        br.append("gr")
    elif r >= 1200 and r <= 1599:
        br.append("w")
    elif r >= 1600 and r <= 1999:
        br.append("bl")
    elif r >= 2000 and r <= 2399:
        br.append("y")
    elif r >= 2400 and r <= 2799:
        br.append("o")
    elif r >= 2800 and r <= 3199:
        br.append("r")
    else:
        count += 1
if len(set(br)) == 0:
    print(1,count)
else:
    print(len(set(br)),len(set(br)) + count)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

int main () {
	
	int h, w, hh, ww;
	cin >> h >> w >> hh >> ww;
	cout << h * w - (hh * w + ww * h - hh * ww);

}

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define cinv(n,vec) VL vec(n);for(auto&v:vec)cin>>v;
#define int long long
#define itn int
#define pb push_back
#define eb emplace_back
#define m_p make_pair
#define m_t make_tuple
#define p_p(a,b) pb(m_p(a,b))
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(all(a),greater<>())
#define UNIQUE(a) a.erase(unique(all(a)),a.end())
#define SZ(a) (signed)(a.size())
#define debg(a) cout<<#a<<" "<<a<<endl;
#define debgp(a) cout<<#a<<" "<<a.fi<<" : "<<a.se<<endl
#define call(a) for(auto i:a)cout<<i<<" ";cout<<endl
#define callp(a) for(auto [k,v]:a)cout<<k<<":"<<v<<endl
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define out(a) cout<<(a)<<endl
#define ENDL cout<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define fi first
#define se second
#define V vector
#define P pair
#define T tuple
#define PQ priority_queue
#define cont const auto
#define VV(type,name,y,x,a) vector<vector<type>> name = vector<vector<type>>(y,vector<type>(x,a))
typedef long long ll;
typedef double D;
typedef long double LD;
typedef string str;
typedef vector<ll> VL;
typedef pair<ll,ll> PL;
typedef vector<pair<ll,ll>> VP;
typedef tuple<ll,ll,ll> T3;
typedef tuple<ll,ll,ll,ll> T4;
typedef struct{ll to;ll cost;} Graphs;
typedef V<V<Graphs>> AdjList;
const long long MOD = (1e9+7);
const long long INF = (1LL<<60);
const long long LMAX = LLONG_MAX;
void YN(bool b){cout<<(b?"Yes":"No")<<endl;}
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T>inline bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(10);
  
  ll n,m;
  cin>>n>>m;
  VL a(m),b(m),c(m);
  rep(i,m){
    cin>>a[i]>>b[i]>>c[i];
    a[i]--;b[i]--;c[i]=-c[i];
  }

  VL dist(n,INF);
  dist[0]=0;
  rep(j,n){
    rep(i,m){
      if(dist[a[i]]==INF)continue;
      chmin(dist[b[i]],dist[a[i]]+c[i]);
    }
  }
  ll res=dist[n-1];

  V<bool> negative(n,false);
  rep(j,n){
    rep(i,m){
      if(dist[a[i]]==INF)continue;

      if( chmin(dist[b[i]],dist[a[i]]+c[i]) ){
        negative[b[i]]=true;
      }

      if(negative[a[i]])negative[b[i]]=true;
    }
  }

  if(negative[n-1])out("inf");
  else out(-res);
  
  
  return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
int main(){
  int a,b,c,k;
  scanf("%d %d %d", &a, &b, &c);
  k=a;a=b;b=k;
  k=a;a=c;c=k;
  printf("%d %d %d", a, b, c);
  
  return 0;
}

Measured memory_bytes: 1732
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>

using namespace std;

long long int a, b, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, n, i = 0, j = 0;
int p[100001], q[100001];
vector<int> vec1, vec2;
int main() {
	cin >> n;
	for (int k = 0; k < n + 1; k++) {
		p[k] = 0;
		q[k] = 0;
	}
	for (int k = 0; k < n / 2; k++) {
		cin >> a >> b;
		vec1.push_back(a);
		vec2.push_back(b);
	}
	sort(vec1.begin(), vec1.end());
	sort(vec2.begin(), vec2.end());
	a = 0;
	b = 0;
	for (int k = 0; k < n / 2; k++) {
		p[vec1[k]]++; q[vec2[k]]++;
		if (p[vec1[k]] >= c) {
			if (vec1[k] != a) {
				e = a;//2番目のデータ
				g = c;
			}
			a = vec1[k];
			c = p[vec1[k]];
		}
		if (p[vec1[k]] >= g&&p[vec1[k]] < c) {
			e = vec1[k];
			g = p[e];
		}
		if (q[vec2[k]] >= d) {
			if (vec2[k] != b) {
				f = b;//2番目のデータ
				h = d;
			}
			b = vec2[k];
			d = q[vec2[k]];
		}
		if (q[vec2[k]] >= h&&q[vec2[k]] < d) {//1番目と2番目の間のやつ
			f = vec2[k];
			h = q[f];
		}
	}
	if (a == b) {
		if (c + h > d + g) {
			cout << n - c - h << '\n';
		}
		else {
			cout << n - d - g << '\n';
		}
	}
	else {
		cout << n - c - d;
	}

	return 0;
}


Measured memory_bytes: 1660
import atexit
import io
import sys

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())

n = input()
l = map(int, raw_input().split())
ans = 0
for i in xrange(n):
	valid = 1
	for j in xrange(i):
		if l[j] > l[i]:
			valid = 0
			break
	if valid:
		ans += 1
print ans

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

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  ll sum=0;
  for(ll i=0;i<N;i++){cin >> A[i]; sum+=A[i];}
  ll s=0; ll memo;
  for(ll i=0;i<N;i++){
    s+=A[i];
    if(s*2>=sum){
      ll a=abs(sum-s-s);
      ll b=abs(sum-s+A[i]-(s-A[i]));
      //cout << i << endl;
      cout << min(a,b) << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main() {
    int A,B,C;
    cin >> A >> B >> C;
    if (A < B) {
        if (C >= A && C <= B)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    } else {
        if (C <= A && C >= B)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <cstring>
#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
#include <cmath>
#include <numeric>
#include <float.h>
#include <math.h>
#include <sstream>
using namespace std;
// repマクロの定義
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// allマクロの定義
#define all(v) v.begin(), v.end()
const  long long INF = 1LL << 60;
typedef unsigned long long ll;
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;
}

int ctoi(char c) {
 	switch (c) {
		case '0': return 0;
		case '1': return 1;
		case '2': return 2;
		case '3': return 3;
		case '4': return 4;
		case '5': return 5;
		case '6': return 6;
		case '7': return 7;
		case '8': return 8;
		case '9': return 9;
		default: return 0;
	}
}


int main(){ 
ll N,A,B,C,D,E; cin >> N >> A >> B >> C>> D >> E;
ll time = 4;
ll x = min(A,min(B,min(C,min(D,E))));
time += ceil(double(N) / double(x));
cout << time << endl;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

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

int main() {
  double n, sum, a[10];

  while(cin >> n) {
    sum = 0;
    a[0] = n;
    for(int i = 1; i < 10; i++) {
      if(i%2 == 1) a[i] = a[i-1] * 2;
      else a[i] = a[i-1] / 3;
    }
    for(int i = 0; i < 10; i++) sum += a[i];
    printf("%.8lf\n", sum);
  }
}

Measured memory_bytes: 1236
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define test() int t;cin>>t;loop(test,1,t+1)
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define nl cout<<"\n"
#define sp cout<<" "
#define F first
#define S second
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<pii>
#define vll vector<pll>
#define MOD 1000000007
#define all(x) x.begin(),x.end()

template<class C> void min_self( C &a, C b ){ a = min(a,b); }
template<class C> void max_self( C &a, C b ){ a = max(a,b); }

void mod( ll &n, ll m=MOD ){ n%=m,n+=m,n%=m; }

const int MAXN = 1e5+5;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

int main() 
{
    fastio();

    int n,m;
    cin>>n>>m;

    int k[m+3],p[m+3];
    int s[m+3][n+3];

    loop(i,0,m)
    {
        cin>>k[i];
        loop(j,0,k[i])
        {
            cin>>s[i][j];
            s[i][j]--;
        }
    }
    loop(i,0,m)
        cin>>p[i];

    int ans = 0;
    int total = (1<<n);
    for(int i=0;i<total;i++)
    {
        int aa = 0;
        for(int bulb=0;bulb<m;bulb++)
        {
            int cc = 0;
            for(int kk=0;kk<k[bulb];kk++)
            {
                int set = (1<<s[bulb][kk]);
                if( set&i )
                {
                    cc++;
                }
            }
            if( cc%2 == p[bulb] )
            {
                aa++;
            }
        }
        if( aa == m )
        {
            // cout<<" Combination : "<<i,nl;
            ans++;
        }
    }

    cout<<ans,nl;

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

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**6)

a, b, c = map(int, input().split())
k = int(input())

trial = 0

while trial <= k:
    if b > a and c > b:
        print('Yes')
        break
    elif b <= a:
        b *= 2
        trial += 1
    elif c <= b:
        c *= 2
        trial += 1
else:
    print('No')

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

int main(){
	int input, money = 100000;
	cin >> input;

	for(int i=0; i < input; i++){
		money *= 1.05;
		if(0 < money % 1000) money = money - money%1000 + 1000;
	}

	cout << money << endl;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
 bool solve(const vector<string>& W){
   const int n = W.size();
   for(int i=0;i<n-1;i++){
     if(W[i].back() != W[i+1].front()){
       return false;
     }
   }
   
   for(int i=0;i<n;i++){
     for(int j=i+1;j<n;j++){
       if(W[i] == W[j]){
         return false;
       }
     }
   }
   return true;
 }

vector<string> input(){
  int n;
  cin >> n;
  vector<string>W(n);
  for(int i=0;i<n;++i){
    cin >> W[i];
  }
  return W;
}

int main(){
  const vector<string>W = input();
  if(solve(W)){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
}

Measured memory_bytes: 256
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

n,k = na()
a = na()

dic = {}

for num in a:
    if num in dic:
        dic[num] += 1
    else:
        dic[num] = 1

if len(dic) <= k:
    print(0)
else:
    dic = sorted(dic.items(), key=lambda x:x[1], reverse=True)
    ans = 0
    for i in dic[k:]:
        ans += i[1]
    print(ans)


Measured memory_bytes: 39152
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    int N;
    cin >> N;
    map<string, int> mp;
    for (int i = 0; i < N; i++) {
        string S;
        cin >> S;
        mp[S]++;
    }
    vector<string> v{"AC", "WA", "TLE", "RE"};
    for (string s : v) {
        if (mp.count(s) == 0) cout << s << " x " << 0 << '\n';
        else cout << s << " x " << mp[s] << '\n';
    }
}


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


int main(){
    while(1){
        int a, b;
        cin >> a >> b;
        if((a!= 0)&&(b!= 0)){
            vector<vector<string> >l(a, vector<string>(b, "#"));
            for(int i = 0; i < a; i++){
                for(int j = 0; j < b; j++){
                    cout << l[i][j];
                }
                cout << endl;
            }
          cout << endl;
        }else{
            break;
        }
     }
}


Measured memory_bytes: 3160
using System;
class Program
{
  static void Main()
  {
    string[] input = Console.ReadLine().Split(' ');
    int n = int.Parse(input[0]);
    int m = int.Parse(input[1]);
    int[] args = new int[m];
    int count = 0;
    for(int i = 0; i < n; i++)
    {
      string[] input2 = Console.ReadLine().Split(' ');
      int nums = int.Parse(input2[0]);
      for(int j = 1; j <= nums; j++)
      {
        args[int.Parse(input2[j]) - 1]++;
      }
    }
    for(int k = 0; k < m; k++)
    {
      if(args[k] == n) count++;
    }
    Console.WriteLine(count);
  }
}

Measured memory_bytes: 11092
#include<bits/stdc++.h>
#define ll long long
#define iof ios_base::sync_with_stdio(false); cin.tie(NULL)
#define pi 3.1415926535897
#define mod 1000000007
#define inf (1ll<<60)
using namespace std;


int main()
{
    iof;
    ll n; cin>>n;
    ll a[n],b[n],c[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    ll dp[n][3];
    dp[0][0]=a[0],dp[0][1]=b[0],dp[0][2]=c[0];
    for(ll i=1;i<n;i++)
    {
        dp[i][0]=max(dp[i-1][1]+a[i],dp[i-1][2]+a[i]);
        dp[i][1]=max(dp[i-1][0]+b[i],dp[i-1][2]+b[i]);
        dp[i][2]=max(dp[i-1][0]+c[i],dp[i-1][1]+c[i]);
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main(int argc, char *argv[]) {
    // cin.tie(0);
    // ios::sync_with_stdio(false);
    int N; cin >> N;
    string s; cin >> s;
    int r = 0;
    rep(i, N) if (s[i] == 'R') r++;
    cout << (r > N-r ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
from collections import *
import sys
try: inp = raw_input
except: inp = input
def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]

N, K = nl()

MOD = 10**9 + 7
s1 = sum(range(0, K))
s2 = sum(range(N - K + 1, N+1))
no = s2 - s1 + 1
for k in range(K, N+1):
    s1 += k
    s2 += N - k
    no += (s2 - s1 + 1)
print(no%MOD)


Measured memory_bytes: 70892
N,A,B,K = list(map(int,input().split()))


mod = 998244353

ans = 0

comb = [1]
c = 1

for i in range(1,N+1):
    c *= N - i + 1
    c *= pow(i,mod-2,mod)
    c %= mod
    comb.append(c)

for a in range(N+1):
    if K<a*A:
        break
    if (K-a*A)%B==0:
        b = (K-a*A)//B
        if b <= N:
            ans += comb[a]*comb[b]
            ans %= mod

print(ans)

Measured memory_bytes: 73704
#include <stdio.h>
#include <algorithm>
#include <deque>

using namespace std;
int main() {
	int n, A[101];
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d", A + i);

	long long dp[110][2] = { 0 };
	for (int i = A[1] - 1; i <= A[1] + 1; i++) {
		if (i & 1)
			dp[1][1]++;
		else
			dp[1][0]++;
	}
	for (int i = 2; i <= n; i++) {
		for (int j = A[i] - 1; j <= A[i] + 1; j++) {
			if (j & 1) {
				dp[i][0] += dp[i - 1][0];
				dp[i][1] += dp[i - 1][1];
			}
			else {
				dp[i][0] += dp[i - 1][0] + dp[i - 1][1];
			}
		}
	}
	printf("%lld\n", dp[n][0]);
}

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

const ll MOD = 1e9 + 7;
const int A = 0, G = 1, C = 2, T = 3;
ll dp[101][4][4][4]; //初期値0

int main(){
    int n; cin >> n;
    rep(i,4) rep(j,4) rep(k,4) dp[3][i][j][k] = 1;
    dp[3][A][G][C] = dp[3][A][C][G] = dp[3][G][A][C] = 0;
    for(int i = 4; i <= n; i++){
        rep(j,4){ //i-3文字目
            rep(k,4){ //i-2文字目
                rep(l,4){ //i-1文字目
                    rep(m,4){ //i文字目
                        if((j == A && k == G && m == C) || (j == A && l == G && m == C)) continue;
                        dp[i][k][l][m] = (dp[i][k][l][m] + dp[i-1][j][k][l]) % MOD;
                    }
                }
            }
        }
        dp[i][A][G][C] = dp[i][A][C][G] = dp[i][G][A][C] = 0;
    }
    ll ans = 0;
    rep(i,4) rep(j,4) rep(k,4) ans = (ans + dp[n][i][j][k]) % MOD;
    cout << ans << endl;
}

Measured memory_bytes: 256
N=int(input())
out=''
while N>26:
    if N%26!=0:
        out=str(chr(ord('a')+N%26-1))+out
        N=N//26
    else:
        out=str(chr(ord('a')+25))+out
        N=N//26-1
if N!=0:
    print(str(chr(ord('a')+N-1))+out)
else:
    print(out)

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

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;
using P = pair<int, int>;

int main() {
    char c;
    cin >> c;
    if (c == 'a' || c == 'o' || c == 'e' || c == 'i' || c == 'u')
        cout << "vowel" << endl;
    else
        cout << "consonant" << endl;
    return 0;
}

Measured memory_bytes: 3528
#include <bits/stdc++.h>
typedef long long ll;

using namespace std;


vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
int min_steps = INT_MAX;
int main() {
    int n, m, k; cin >> n >> m >> k;
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
    vector<string> grid;
    for(int i = 0; i < n; i++){
        string cur; cin >> cur;
        grid.push_back(cur);
    }
    x1--;
    y1--;
    x2--;
    y2--;
    using P = pair<int,pair<int,int>>;
    queue<P> q;
    q.push(P(0, {x1, y1}));
    vector<vector<int>> dist(n, vector<int>(m, INT_MAX));
    dist[x1][x2] = 0;
    while(!q.empty()){
        P temp = q.front(); q.pop();
        int cost = temp.first;
        int x = temp.second.first; int y = temp.second.second;
        for(int i = 0; i < 4; i++){
            for(int j = 1; j <= k; j++){
                int ny = y + dy[i] * j;
                int nx = x + dx[i] * j;
                // Check borders
                if(nx < 0 || ny < 0 || nx >= n || ny >= m)
                    continue;
                int ncost = cost + 1;
                if(grid[nx][ny] == '@') break;
                if(dist[nx][ny] > ncost){
                    dist[nx][ny] = ncost;
                    q.push(P(ncost, {nx, ny}));
                } else if(dist[nx][ny] == ncost){
                    continue;
                } else {
                    break;
                }
            }
        }
    }
    if(dist[x2][y2] == INT_MAX){
        cout << -1 << endl;
    } else {
        cout << dist[x2][y2] << endl;
    }
}


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


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



    return 0;
}


Measured memory_bytes: 3608
# 絶対に参考にするな他を当たれ
n, q = map(int, input().split())

links = [[] for _ in range(n + 1)]
point = [0] * (n + 1)
checked = [False] * (n + 1)

for _ in range(n - 1):
    a, b = map(int, input().split())
    links[a].append(b)
    links[b].append(a)

for _ in range(q):
    p, x = map(int, input().split())
    point[p] += x

nextCheck = [1]

while nextCheck:
    idx = nextCheck.pop()
    for dest in links[idx]:
        if not checked[dest]:
            point[dest] += point[idx]
            nextCheck.append(dest)
            checked[idx] = True

print(*point[1:])


Measured memory_bytes: 55828
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define popCnt(x) (__builtin_popcountll(x))
typedef unsigned long long Long;

const int N = 33;
const int MOD = round(1e9 + 7);

int cnt[N];

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifdef Local
  freopen("test.in", "r", stdin);
#else
#define endl '\n'
#endif


  int n;
  cin >> n;

  string s;
  cin >> s;

  for (char c : s) {
    ++cnt[c - 'a'];
  }

  int res = 1;

  for (int i = 0 ; i < N ; ++i) {
    res = 1LL * res * (cnt[i] + 1) % MOD;
  }

  res = (res - 1 + MOD) % MOD;
  
  cout << res << endl;

}



Measured memory_bytes: 512
#include<stdio.h>
#include<string.h>
int h,w,n,a,c[101][101],i,j,k,step;
int main(){
    scanf("%d%d%d",&h,&w,&n);
    i=1;j=1;step=1;
    for(k=1;k<=n;k++){
        scanf("%d",&a);
        while(a--){
            c[i][j]=k;
            j+=step;
            if(j>w){
                i++;
                j=w;
                step=-1;
            }else if(j<1){
                i++;
                j=1;
                step=1;
            }
        }
    }
    for(i=1;i<=h;i++){
        for(j=1;j<w;j++) printf("%d ",c[i][j]);
        printf("%d\n",c[i][w]);
    }
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int N = 2000;
int n, vis[N], f[N], c[N];
int read() {
    char s[10];
    scanf("%s", s);
    if (s[0] == '-') while(1);
    return s[0] == 'R' ? 1: -1;
}
int query(int pos) {
    if (vis[pos] == 1) return f[pos];
    vis[pos] = 1;
    printf("?");
    for (int i = pos; i < pos + n; i ++) {
        printf(" %d", i);
    }
    printf("\n");
    fflush(stdout);
    return f[pos] = read();
}
int main() {
    scanf("%d", &n);
    int lef = 1, rig = n + 1;
    while (rig - lef > 1) {
        int mid = (lef + rig) >> 1;
        if (query(mid) != query(lef)) {
            rig = mid;
        } else {
            lef = mid;
        }
    }
    if (query(rig) == 1) c[rig + n - 1] = 1;
    else c[rig + n - 1] = -1;
    if (query(lef) == 1) c[lef] = 1;
    else c[lef] = -1;
    for (int i = 1; i <= 2 * n; i ++) {
        if (c[i]) continue;
        if (i < lef || i > rig + n - 1) {
            printf("?");
            for (int j = rig; j < rig + n - 1; j ++) printf(" %d", j);
            printf(" %d\n", i); fflush(stdout);
            if (read() == query(rig)) c[i] = c[rig + n - 1]; else c[i] = - c[rig + n - 1]; 
        }
    }
    int v = -1;
    for (int j = 1; j < lef; j ++) if (c[j] == -query(lef))v = j;
    for (int j = lef + n; j <= 2 * n; j ++) if (c[j] == -query(lef)) v = j;
    for (int i = 1; i <= 2 * n; i ++) {
        if (c[i]) continue;
        if (i >= lef && i <= rig + n - 1) {
            printf("?");
            for (int j = 1; j < lef; j ++) if (j != v) printf(" %d", j);
            for (int j = lef + n; j <= 2 * n; j ++) if (j != v) printf(" %d", j);
            printf(" %d\n", i); fflush(stdout);
            if (read() == - query(lef)) c[i] = c[v]; else c[i] = - c[v]; 
        }
    }
    printf("! ");
    for (int i = 1; i <= 2 * n; i ++) printf("%c", c[i] == 1 ? 'R' : 'B');
    printf("\n");
    fflush(stdout);
}

Measured memory_bytes: 724
/**
  @file c.cpp
  @title C - Unification
  @brief https://atcoder.jp/contests/abc120/tasks/abc120_c
**/

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

template <class T>
void show(vector<T>& v) {
  for (uint i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
}

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

  int one  = 0;
  int zero = 0;

  if (S.length() == 0) {
    cout << "0" << endl;
  } else {
    for (int i = 0; i < S.length(); i++) {
      if (S[i] == '0') {
        zero++;
      } else {
        one++;
      }
    }
    cout << S.length() - abs(zero - one) << endl;
  }

  return 0;
}


Measured memory_bytes: 512
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
ans = 1
cnt = 0
for i in range(1,n):
  if a[i-1]<=i*2-2-cnt*2:
    cnt += 1
  ans = ans*(i+1-cnt)%mod
print(ans)    

Measured memory_bytes: 14588
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        if(N<100){
            if(N%10 == 3){
                System.out.println("bon");
            }
            else if(N%10 == 0 ||N%10 == 1 || N%10 == 6 || N%10 == 8){
                System.out.println("pon");
            }
            
            else{
                System.out.println("hon");
            }
        }
        
        else{
            if((N%100)%10 == 3){
                System.out.println("bon");
            }
            else if((N%100)%10 == 0 ||N%10 == 1 || N%10 == 6 || N%10 == 8){
                System.out.println("pon");
            }
            
            else{
                System.out.println("hon");
            }
        }
    }
}

Measured memory_bytes: 35736
#include<iostream>
using namespace std;
int t[100010], x[100010], y[100010];
int s[100010];
int t1[100010];

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> t[i] >> x[i] >> y[i];
	}
	s[0] = x[0] + y[0];
	for (int i = 1; i < n; i++) {
		s[i] = abs(x[i - 1] - x[i]) + abs(y[i - 1] - y[i]);
	}
	t1[0] = t[0];
	for (int i = 1; i < n; i++) {
		t1[i] = t[i] - t[i - 1];
	}
	int flag = true;
	for (int i = 0; i < n; i++) {
		if (s[i] > t[i]) {
			cout << "No" << endl;
			return 0;
		}
		else {
			if (abs(t1[i] - s[i]) % 2 == 1) {
				flag = false;
			}
		}
	}
	if (flag == true) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 2176
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    while(1){
    int n,s[100],m=100000,M=0,sum=0;
    cin >> n;
        if(n==0)break;
    for(int i=0;i<n;i++)    cin >> s[i];
    for(int i=0;i<n;i++){
        sum+=s[i];
        m=min(m,s[i]);
        M=max(M,s[i]);
    }
    cout << (sum-M-m)/(n-2)<<endl;
    }
    return 0;
}

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

#define st first
#define nd second
#define pb push_back
#define mp make_pair
typedef pair< int ,int > pii;
typedef vector< pii > vii;
typedef long long ll;
typedef map<int,int> mii;
typedef set<pii> sii;
typedef set<int> si;
typedef vector< int > vi;

const ll MOD = 119 << 23 | 1;

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

ll power(ll x, ll y)
{
    ll res = 1ll;     // Initialize result
    x%=MOD;
    if(x==0)
        return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % MOD;

        // y must be even now
        y = y>>1ll; // y = y/2
        x = (x*x) % MOD;
    }
    return res;
}

ll inv(ll x) {
    ll r = 1ll, t = x, k = MOD - 2ll;
    while (k) {
        if (k & 1ll) r = (long long) r * t % MOD;
        t = (long long) t * t % MOD;
        k >>= 1;
    }
    return r;
}

const int nax = 2e5+13;

void read(){
    int a,b,c;
    cin >> a >> b >> c;
    cout << c <<' '<< a<<' ' << b<<endl;
}

void solve(){

}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie();
    cout.tie();
    int T=1;
    //cin >> T;
    for(int i=1; i<=T; i++){

        read();
        //cout << "Case #"<<i<<": ";
        solve();
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define VI vector<int>
#define VVI vector<vector<int>>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
#define INF 1e9
#define All(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

int main() {
  int N, A, B;
  string s;
  cin >> N >> A >> B >> s;
  int a = 0, b = 0;
  for (int i = 0; i < N; i++) {
    if (s[i] == 'a') {
      if(a < (A + B)){
        cout << "Yes" << endl;
        a++;
      } else
        cout << "No" << endl;
    } else if (s[i] == 'b') {
      if(a < (A + B) && (b < B)){
        cout  << "Yes" << endl;
        a++, b++;
      } else
        cout << "No" << endl;
    } else {
      cout << "No" << endl;
    }
  }

    return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()
 
using namespace std;
using ll = long long;
 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

struct edge { int to; int cost; };
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int MOD = 1e9+7;
const double EPS = 1.0e-10;
const double PI = acos(-1.0);
 
const int mx4[] = {0,1,0,-1};
const int my4[] = {1,0,-1,0};
const int mx8[] = {0,1,1,1,0,-1,-1,-1};
const int my8[] = {1,1,0,-1,-1,-1,0,1};

int main() {
	string s;
	cin >> s;
	cout << (s[2] == s[3] && s[4] == s[5] ? "Yes" : "No") << endl;	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <deque>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <climits>
#include <numeric>
#include <bitset>
#include <random>
#include <tuple>
#include <initializer_list>
#include <fstream>

int main() {
	long long int x; std::cin >> x;
	std::cout << (x / 500) * 1000 + (x % 500) / 5 * 5 << std::endl;
}


Measured memory_bytes: 888
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

int main()
{
	LL N, M;
	in >> N >> M;
	std::vector<LL>K(N);
	std::vector<std::vector<LL>>A(N);
	rep(i, N)
	{
		in >> K[i];
		A[i].resize(K[i]);
		rep(j, K[i]) in >> A[i][j];
	}

	std::vector<LL>cnt(M + 1);
	rep(i, N) rep(j, K[i]) ++cnt[A[i][j]];

	LL ans = 0;
	for (LL i = 1; i <= M; ++i)
	{
		if (cnt[i] == N) ++ans;
	}

	out << ans << std::endl;
}


Measured memory_bytes: 256
#include <iostream>

int main(){
    using namespace std;

    int S;
    int h, m, s;

    cin >> S;

    h = S / 3600;
    m = (S - 3600 * h) / 60;
    s = (S - 3600 * h - 60 * m);

    cout << h << ":" << m << ":" << s << endl;

}


Measured memory_bytes: 3096
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#define INF 1000000000
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define all(x) (x).begin(),x.end()
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

int main(){
  int w,n;
  int array[35];
  cin>>w>>n;
  REP(i,1,w+1)array[i]=i;
  rep(i,n){
    int a,b;
    cin>>a;
    getchar();
    cin>>b;
    swap(array[a],array[b]);
  }
  for(int i=1;i<=w;i++){
    cout<<array[i]<<endl;
  }
  return 0;
}

Measured memory_bytes: 2968
s = input()
t = input()
from collections import defaultdict
dic1 = defaultdict(set)
dic2 = defaultdict(set)
for i in range(len(s)):
    dic1[s[i]].add(t[i])
    dic2[t[i]].add(s[i])
f = True
for c in dic1.keys():
    if len(dic1[c]) >= 2:
        f = False
        break
for c in dic2.keys():
    if len(dic2[c]) >= 2:
        f = False
        break
print("Yes" if f else "No")

Measured memory_bytes: 3776
#include<bits/stdc++.h>
using namespace std;
long long ans;
inline int nextInt() {
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9' ) {
        if (c == '-') f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        x = x*10+c-'0';
        c = getchar();
    }
    return x*f;
}
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    multiset<int> A;
    while (N--) {
        int a;
        cin >> a;
        A.insert(a);
    }
    while (M--) {
        int a = *prev(A.end());
        A.erase(prev(A.end()));
        a /= 2;
        A.insert(a);
    }
    for (auto &a : A) {
        ans += a;
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 4992
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

N,M = map(int,input().split(" "))
S = input()
T = input()
N = len(S)
M = len(T)
x = gcd(N,M)
y = int(N*M/x)

for i in range(x):
    if S[int(i*y/M)] == T[int(i*y/N)]:
        continue
    else:
        print(-1)
        exit()
print(y)


Measured memory_bytes: 3316
/* Author rumoisen */
/* created 2018/11/07 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <cmath>
 
using namespace std;
 
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

void no(){cout<<"No"<<endl;exit(0);}
void yes(){cout<<"Yes"<<endl;exit(0);}
void No(){cout<<"NO"<<endl;exit(0);}
void Yes(){cout<<"YES"<<endl;exit(0);}

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

using namespace std;

int main()
{
    int x,y;
    cin>>x>>y;
    cout<<x+y/2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int dp[1009][1009];
int main(){
  int n;
  cin>>n;
  while(n--){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    dp[a][b]++;
    dp[a][d]--;
    dp[c][b]--;
    dp[c][d]++;
  }
  int ans=0;
  for(int i=0;i<1009;i++){
    for(int j=1;j<1009;j++){
      dp[i][j]+=dp[i][j-1];
    }
  }
  for(int j=0;j<1009;j++){
    for(int i=1;i<1009;i++){
      dp[i][j]+=dp[i-1][j];
      ans=max(ans,dp[i-1][j]);
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 7072
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;

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



Measured memory_bytes: 256