akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
const ll INF = 1LL << 60;

int main() {
	int A, B;
	cin >> A >> B;
	cout << (B - 1 + A - 2) / (A - 1) << endl;
}


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

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, result = -1;
    cin >> n;
    for (int i = 1; i <= n; i++){
        if(int(i * 1.08) == n)
            result = i;
    }

    if (result != -1)
        cout << result << "\n";
    else
        cout << ":(\n";
    return 0;
}


Measured memory_bytes: 3620
X=int(input())
for j in range(int(X**0.5)+2,0,-1):
    if X%j==0:
        for a in range(2*(10**4)):
            b=a-j
            S=j*(a**4+b**4+(a**3)*b+(a**2)*(b**2)+a*(b**3))
            if S==X:
                print(a,b)
                exit(0)

Measured memory_bytes: 9332
import java.util.*;

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

        int H = scan.nextInt();
        int W = scan.nextInt();
        String C[] = new String[H];
        //String cnt[] = new String[H*2];
        
        for(int i = 0 ; i < H ; i++){
          C[i] = scan.next();
        }
        
        for(int i = 0 ; i < H ; i++){
          for(int j = 0 ; j < 2 ; j++){
          System.out.println(C[i]);
          }
        }
        
	  }
}

Measured memory_bytes: 22484
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (int i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,v) for (int i = 0; i < v.size(); i++)
#define SORT(v) sort(v.begin(), v.end())
#define MIN_ELEMENT(v) min_element(v.begin(), v.end())
#define MAX_ELEMENT(v) max_element(v.begin(), v.end())
#define COUNT(v,n) count(v.begin(), v.end(), n);
typedef long long ll;
typedef unsigned long long ull;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

int main()
{
    int r = 0, b = 0;
    int n;
    cin>>n;

    REP(i,n) {
        char t;
        cin>>t;
        if (t == 'R')
            r++;
        else
            b++;
    }

    if (r <= b) {
        cout<<"No"<<endl;
    } else {
        cout<<"Yes"<<endl;
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int count=scanner.nextInt();

		for(int i=0;i<count;i++){
			int[] array=new int[3];
			for(int k=0;k<3;k++){
				array[k]=scanner.nextInt();
			}

			if(isRightTriangle(array))
				System.out.println("YES");
			else
				System.out.println("NO");
		}
	}

	static boolean isRightTriangle(int a,int b,int c) {
		return c==Math.sqrt(a*a+b*b);
	}

	static boolean isRightTriangle(int[] array) {
		if(isRightTriangle(array[0], array[1], array[2]))
			return true;
		if(isRightTriangle(array[1], array[2], array[0]))
			return true;
		if(isRightTriangle(array[2], array[0], array[1]))
			return true;
		return false;
	}
}

Measured memory_bytes: 23376
using System;
using System.Collections.Generic;
using System.Windows;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    public class Program
    {
        static void Main(string[] args)
        {
            var d = DateTime.Now;
            var n = Read().ToInt();
            var s = Read();

            var r = new List<int>();
            var g = new List<int>();
            var b = new List<int>();

            for (int i = 0; i < n; i++)
            {
                var aa = s[i].ToString();
                if (aa == "R") r.Add(i);
                if (aa == "G") g.Add(i);
                if (aa == "B") b.Add(i);
            }
            decimal ans = r.Count.ToDecimal() * g.Count.ToDecimal() * b.Count.ToDecimal();
            if (ans == 0)
            {
                WriteRead(0);
                return;
            }
            decimal sub = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (i + (2 * j) >= n) continue;
                    if (s[i] != s[i + j] && s[i] != s[i + (2 * j)] && s[i + j] != s[i + (2 * j)])
                    {
                        sub++;
                    }
                }
            }
            WriteRead(ans - sub);
        }

        public static string Read()
        {
            return Console.ReadLine();
        }

        public static string[] ReadSplit()
        {
            return Console.ReadLine().Split(' ');
        }

        public static void WriteRead(object str)
        {
            Console.WriteLine(str);
            Read();
        }

        public static void Write(object str)
        {
            Console.WriteLine(str);
        }
    }
}


public static class Extentions
{
    public static int ToInt(this object obj)
    {
        return int.Parse(obj.ToString());
    }

    public static decimal ToDecimal(this object obj)
    {
        return decimal.Parse(obj.ToString());
    }

    public static double ToDouble(this object obj)
    {
        return double.Parse(obj.ToString());
    }

    public static T2 GetValueZero<T1, T2>(this Dictionary<T1, T2> d, T1 key) where T2 : struct
    {
        T2 value;
        if (d.TryGetValue(key, out value))


        {
            return value;
        }
        return new T2();
    }
}



Measured memory_bytes: 19956
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
#define MAX 2000000
#define INF (1<<30)

// priority_queue
int main() {

    int key;
    string com;
    priority_queue<int> PQ;

    while (1) {
        cin >> com;
        if (com == "end") break;
        if (com == "insert") {
            cin >> key;
            PQ.push(key);
        } else {
            cout << PQ.top() << endl;
            PQ.pop();
        }
    }

    return 0;
}


/*
int H, A[MAX+1];

void maxHeapify(int i) {
    int l, r, largest;
    l = i * 2;
    r = i * 2 + 1;

    // 左の子、自分、右の子から最大のノードを選ぶ
    if (l <= H && A[l] > A[i]) 
        largest = l;
    else
        largest = i;
    if (r <= H && A[r] > A[largest])
        largest = r;
    
    if (largest != i) {
        swap(A[i], A[largest]);
        maxHeapify(largest);
    }
}

int extract() {
    int maxv;
    if (H < 1) return -INF;

    maxv = A[1];
    A[1] = A[H--];
    maxHeapify(1);
    return maxv;
}

void increaseKey(int i, int key) {
    if (key < A[i]) return;
    A[i] = key;
    while (i > 1 && A[i/2] < A[i]) {
        swap(A[i], A[i/2]);
        i = i / 2;
    }
}

void insert(int key) {
    H++;
    A[H] = -INF;
    increaseKey(H, key);
}

int main() {

    int key;
    string com;

    while (1) {
        cin >> com;
        if (com == "end") break;
        if (com == "insert") {
            cin >> key;
            insert(key);
        } else {
            cout << extract() << endl;
        }
    }

    return 0;
}
*/


Measured memory_bytes: 7104
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            Solve();

            Console.ReadKey();
        }

        static void Solve()
        {
            var str = IO.GetIntList();
            var ans = str[0] % 2 == str[1] % 2 ? ((str[0] + str[1]) / 2).ToString() : "IMPOSSIBLE";

            Console.WriteLine(ans);
        }
    }


    static class IO
    {
        static public string GetString() { return Console.ReadLine(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public List<string> GetStringList() { return Console.ReadLine().Split(' ').ToList(); }
        static public List<int> GetIntList() { return Console.ReadLine().Split(' ').Select(int.Parse).ToList(); }
        static public List<long> GetLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteStrings<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
    }
}

Measured memory_bytes: 11348
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(0);
	int a,b;
	cin>>a>>b;
	if(a<=b){
		cout<<a;
		return 0;
	}
	else{
		cout<<a-1;
		return 0;
	}
}

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int testcase=1;
   // cin>>testcase;
    for(int p=0;p<testcase;p++){
     ll x1=0,x2=0,x3=0,x4=0,x5=0  ;
    cin>>x1>>x2>>x3>>x4>>x5;
    if(x1==0)
    cout<<"1"<<"\n";
    else if(x2==0)
    cout<<"2"<<"\n";
    else if(x3==0)
    cout<<"3"<<"\n";
    else if(x4==0)
    cout<<"4"<<"\n";
    else
    cout<<"5"<<"\n";
    }

    return 0;
}


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

int t[110];

int main()
{
    int n, m, p, x;
    int total = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> t[i];
        total += t[i];
    }
    
    cin >> m;
    for (int i = 0; i < m; i++)
    {
        cin >> p >> x;
        cout << total - t[p] + x << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
/* ABC069_B
    Stuartyg */

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

int main(void){
        char str[150]; //sのこと.これだけあれば安心
        scanf("%s",str);//標準入力からの受取り
        int length; //sの間に入っている文字数を求めるための変数

        length = strlen(str)-2; //strの間に入っている文字数
        printf("%c%d%c\n",str[0],length,str[length+1]); //0始まりなので終わりの文字は(length+1)番目
        return 0;
}



Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main(){
    int a,b;
    int area,line;
    
    cin >> a >> b;
    
    area = a * b;
    
    line = 2 * a + 2 * b;
    
    cout << area << " " << line << endl;
    
    return 0;
}


Measured memory_bytes: 3108
Omoji = ['A','B','C']
Kmoji = ['a','b','c']
n,k = map(int,input().split())
s = str(input())
ans = ''
for i in range(n):
    if i==(k-1):
        for j in range(len(Omoji)):
            if s[i]==Omoji[j]:
                ans += Kmoji[j]
    else:
        ans += s[i]
print(ans)

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

using namespace std;
typedef long long ll;

ll ans, mx, mn, flag, sum, cnt;

int main(){
	ll a,b;
	cin>>a>>b;
	if(a<=8 && b<=8) cout<<"Yay!";
	else cout<<":(";
}


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

int main(){
	long long N;
	cin>>N;
	long long MOD = 1000000000+7;
	long long ans=1;

	for(int i=1;i<=N;i++){
		ans = ((ans % MOD)*(i % MOD))%MOD;
	}
	cout<<ans<<endl;
}

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

struct Sieve{
    int n;
    vector<int> f,primes;
    Sieve(int n = 1):n(n), f(n+1) {
        f[0] = f[1] = -1;
        for(ll i = 2;i <= n; i++){
            if(f[i])continue;
            primes.push_back(i);
            f[i] = i;
            for(ll j = i * 2; j <= n; j += i){
                if(!f[j])f[j] = i;
            }
        }
    }
    bool isPrime(int x){return f[x] == x;}
    vector<int> factorList(int x){
        vector<int> res;
        while(x != 1){
            res.push_back(f[x]);
            x /= f[x];
        }
        return res;
    }
    vector<P> factor(int x){
        vector<int> fl = factorList(x);
        if(fl.size() == 0) return {};
        vector<P> res(1,P(fl[0],0));
        for(int p: fl){
            if(res.back().first == p){
                res.back().second++;
            }else{
                res.emplace_back(p,1);
            }
        }
        return res;
    }
};

int main() {
    ll n;
    cin >> n;
    if(n<10){
        cout << 0 << endl;
        return 0;
    }
    map<ll,ll> mp;
    Sieve s(110);
    for (int i=2; i<=n; i++) {
        if(s.isPrime(i)) mp[i] = 1;
        else{
            ve<P> f = s.factor(i);
            for(P x: f){
                mp[x.first] += x.second;
            }
        }
    }
    ll ans = 0;
    ll u2=0, u4=0,u14=0,u24=0,u74=0;
    for(P x:mp){
        ll cnt = x.second;
        if(cnt>=74){
            u2++;u4++;u14++;u24++;u74++;
            continue;
        }if(cnt>=24){
            u2++;u4++;u14++;u24++;
            continue;
        }if(cnt>=14){
            u2++;u4++;u14++;
            continue;
        }if(cnt>=4){
            u2++;u4++;
            continue;
        }if(cnt>=2)u2++;
    }
    ans += (u4*(u4-1)*(u2-2))/2;
    ans += u74;
    ans += u24*(u2-1);
    ans += u14*(u4-1);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second);
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define incl(v,x) find(rng(v),x)!=v.end()
#define incls(s,c) s.find(c)!=string::npos
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bit(n,k) ((n>>k)&1) // nのk bit目
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using vt = vector<T>;
const int mod = 1000000007;
const double EPS = 1e-9;
//const long double EPS = 1e-14;
//const int INF = (1<<30)-1;
const ll INF = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
inline int in() { int x; scanf("%d",&x); return x;}
//template<class T = int> inline T in() { T x; cin >> x; return (x);}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
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; }

int main () {
  ll x;
  cin >> x;

  ll ans = 0;
  rep(i,x/500+1) {
    if (x - 500*i < 0) continue;
    ll tmp = 1000*i + (x-500*i)/5*5;
    ans = max(ans,tmp);
  }

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

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <iomanip>
#include <utility>
  
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
using namespace std;
      
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  string s;
  cin>>s;
  int sum=s.size();

  rep(i,sum){
    if(i%2==0 && s[i]=='L'){
      cout<<"No"<<'\n';
      return 0;
    }
    if(i%2==1 && s[i]=='R'){
      cout<<"No"<<'\n';
      return 0;
    }
  }
  cout<<"Yes"<<'\n';
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#define loop_input(fmt,...) while(~scanf(fmt,__VA_ARGS__))

int main() {
    int a, b;
    loop_input("%d%d", &a, &b) {
        printf("%d %d %lf", a/b, a%b, (double)a/b);
    }
    return 0;
}


Measured memory_bytes: 2756
/* 
 * File:   main.cpp
 * Author: freebsd
 *
 * Created on 2014/08/28, 10:07
 */

#include <cstdio>

using namespace std;

int main() {
    while (true) {
        int n = 0, pm = 0, pe = 0, pj = 0;
        int ave = 0, avepe = 0;
        
        scanf("%d", &n);
        
        if(n == 0) break;
        
        for (int i = 0; i < n; i++) {
        scanf("%d %d %d", &pm, &pe, &pj);
        
        avepe = (pm + pe) / 2;
        ave = (pm + pe + pj) / 3;
        
        if(pm == 100 || pe == 100 || pj == 100) printf("A\n");
        else if(avepe >= 90) printf("A\n");
        else if(ave >= 80) printf("A\n");
        else if(ave >= 70) printf("B\n");
        else if(ave >= 50 && (pm >= 80 || pe >= 80)) printf("B\n");
        else printf("C\n");
        }
    }
       
    return 0;
}

Measured memory_bytes: 1012
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
using namespace std;
typedef long long LL;

#define _CRT_SECURE_NO_WARNINGS
int N;
int a[105];
int main() {
	scanf("%d",&N);
	for (int i = 0; i < N;i++) {
		scanf("%d",a+i);
	}
	sort(a,a+N);
	int A, B;
	for (int i = 1; i <= N;i++) {
		if (i%2==1) {
			A += a[N-i];
		}
		else {
			B += a[N-i];
		}
	}
	printf("%d\n",A-B);
	return 0;
}

Measured memory_bytes: 128
N = int(input())
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
ans = 0
for i in range(N):
    tmp = 0
    tmp = sum(A1[:i+1])+sum(A2[i:])
    if tmp > ans:
        ans = tmp
print(ans)

Measured memory_bytes: 3060
# ABC174 E

n, k = map(int, input().split())
a_l = [int(x) for x in input().split()]

left = 0
right = max(a_l)


def cut(len):
    ret = 0
    for i in range(n):
        if a_l[i] % len == 0:
            ret += a_l[i] // len - 1
        else:
            ret += a_l[i] // len
    return ret


while (right - left) > 1:
    _q = (left + right) // 2
    _ret = cut(_q)
    if k >= _ret:
        right = _q
    else:
        left = _q

print(right)


Measured memory_bytes: 30752
#include <cstdio>
using namespace std;

int main() {
	
	int arr[] = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
	int k;
	scanf("%d", &k);
	printf("%d", arr[k - 1]);
	return 0;

}

Measured memory_bytes: 128
import bisect
n,k = map(int,input().split())
l = list(map(int,input().split()))


ans = 10**10

for i in range(n-k+1):
    count = 0
    left = l[i]
    right = l[i+k-1]
    if left <= 0 and right > 0:
        count = min(abs(left),abs(right))*2+max(abs(left),abs(right))
    elif right <= 0:
        count = abs(left)
    else:
        count = right
    ans = min(ans,count)
print(ans)   



Measured memory_bytes: 14480
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  int d,n;
  cin>>d>>n;
  
  if(d==0){
    if(n==100){
      cout<<101<<endl;
      return 0;
    }else{
      cout<<n<<endl;
      return 0;
    }
  }
  
  int ans=1;
  REP(i,d){
    ans *= 100;
  }
  if(n!=100){
    ans *= n;
  }else{
    ans *=101;
  }
  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <limits.h>
#include <float.h>
#include <numeric>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

const ll mod = 1000000007;
ll fact[200200];
ll invfact[200200];

inline ll take_mod(ll a){
    return (a % mod + mod) % mod;
}

inline ll add(ll a, ll b){
    return take_mod(a+b);
}

inline ll sub(ll a, ll b){
    return take_mod(a-b);
}


inline ll mul(ll a, ll b){
    return take_mod(a * b);
}

inline ll pow(ll x, ll n){
    ll res = 1LL;
    while(n > 0){
        if(n & 1) res = mul(res, x);
        x = mul(x, x);
        n >>= 1;
    }
    return res;
}

ll mod_inv(ll x){
    return pow(x, mod-2);
}

// nは上限
void make_fact(ll n){
    fact[0] = 1;
    ll res = 1;
    for(int i = 1; i <= n; i++){
        fact[i] = res;
        res = mul(res, i+1);
    }
}

// nは上限
void make_invfact(ll n){
    invfact[0] = 1;
    invfact[n] = mod_inv(fact[n]);
    for(int i = n-1; i >= 1; i--){
        invfact[i] = mul(invfact[i + 1], i + 1);
    }
}

ll perm(ll n, ll k){
    return mul(fact[n], invfact[n-k]);
}

ll comb(ll n, ll k){
    return mul(mul(fact[n], invfact[n-k]), invfact[k]);
}

int N, K, Q;
vector<int> a;
int l[2100][2100];
int r[2100][2100];
int order[2100];
vector<int> b;


int main(){
    cin >> N >> K >> Q;
    for(int i = 0; i < N; i++){
        int aa; cin >> aa;
        a.push_back(aa);
    }

    int res = INT32_MAX;
    for(int i = 0; i < N; i++){
        vector<int> total;
        vector<int> tmp;
        for(int j = 0; j < N; j++){
            if(a[j] >= a[i]){
                tmp.push_back(a[j]);
            }
            else{
                int m = tmp.size();
                sort(tmp.begin(), tmp.end());
                for(int k = 0; k < m-K+1; k++){
                    total.push_back(tmp[k]);
                }
                tmp.clear();
            }
        }
        int m = tmp.size();
        sort(tmp.begin(), tmp.end());
        for(int k = 0; k < m-K+1; k++){
            total.push_back(tmp[k]);
        }
        tmp.clear();
        sort(total.begin(), total.end());
        if(total.size() >= Q){
            res = min(res, total[Q-1] - total[0]);
        }
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 2432
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 30;
int a[200010]; 
int main() {
  int n, k;
  cin >> n >> k;
  rep(i,n) cin >> a[i];
  sort(a,a+n);
  vector<int> num_cnt;
  int ptr = 0, cnt = 0;
  while (ptr < n)
  {
    int cc = a[ptr], f = 0;
    while (ptr < n && a[ptr] == cc)
    {
      f++; ptr++;
    }
    num_cnt.push_back(f); cnt++;
  }
  sort(num_cnt.begin(),num_cnt.end());
  int ans = 0, i = 0;
  while (cnt > k)
  {
    ans += num_cnt[i];
    cnt--;
    i++;
  }
  cout << ans << endl;
  return 0;
}

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

typedef long long ll;

ll n,p,q;
pair<ll,ll> a[55];
ll ans;

void func(){
    ll res=0;
    bool u[55];
    memset(u,false,sizeof(u));
    while(true){
        ll cp,cq;
        bool f=false;
        for(ll i=1;i<=n;i++){
            if(!u[i]){
                cp=a[i].first;
                cq=a[i].second;
                res++;
                f=true;
                u[i]=true;
                break;
            }
        }
        if(!f)break;
        for(ll i=1;i<=n;i++){
            if(a[i].first==cp+p&&a[i].second==cq+q){
                cp=a[i].first;
                cq=a[i].second;
                u[i]=true;
            }
        }
    }
    ans=min(res,ans);
}

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin>>n;
    for(ll i=1;i<=n;i++){
        cin>>a[i].first>>a[i].second;
    }
    sort(a+1,a+n+1);
    ans=n;
    for(ll i=1;i<=n;i++){
        for(ll j=i+1;j<=n;j++){
            p=a[j].first-a[i].first;q=a[j].second-a[i].second;
            func();
        }
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P; 
const int inf = 1<<21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    int ans = n;
    rep(i, m){
        int tmp;
        cin >> tmp;
        ans -= tmp;
    }

    cout << max(-1, ans) << endl;

    return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  int n;
  cin >> n;
  vector<int>b(n,0);
  for(int i=0;i<n-1;i++) {
    int a;
    cin >> a;
    --a;
    b.at(a)++;}
  for(int i=0;i<n;i++) {
    cout << b.at(i) << endl;}
  return 0;
  }

Measured memory_bytes: 4048
#include <bits/stdc++.h>
using i64 = long long;

long long *fact, *inv;

template <typename T, typename U, typename V>
constexpr auto pow(T x_, U n_, V mod_) {
    std::common_type_t<T, U, V> ret = 1, x = x_, n = n_, mod = mod_;
    while(n > 0) {
        if ((n & 1) == 1) ret = (ret * x) % mod;
        x = (x * x) % mod;
        n >>= 1;
    }
    return ret;
}

template <typename T, typename U>
constexpr auto inverse(T x, U p) { return pow(x, p - 2, p); }

void init_factorial(int n, long long mod) {
    fact = new long long[n + 1];
    inv = new long long[n + 1];
    fact[0] = 1;
    for (long long i = 1; i <= n; i++) fact[i] = fact[i - 1] * i % mod;
    inv[n] = inverse(fact[n], mod);
    for (long long i = n; i > 0; i--) inv[i - 1] = inv[i] * i % mod;
}

int main() {
    constexpr i64 mod = 1000000007;
    i64 x, y;
    std::cin >> x >> y;

    i64 n = 2 * y - x, a = n / 3, b = y - 2 * a;
    if (n % 3 != 0 || a < 0 || b < 0) {
        std::cout << 0 << std::endl;;
        return 0;
    }

    init_factorial(a + b, mod);
    std::cout << fact[a + b] * inv[a] % mod * inv[b] % mod << std::endl;

    return 0;
}


Measured memory_bytes: 10624
// 2_abc140_b
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define SZ(x) ((int)(x).size())
#define INF (1e16)
#define MOD (1000000007)
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    vector<int> c(n - 1);
    rep(i, n){
        cin >> a[i];
        a[i]--;
    }
    rep(i, n){
        cin >> b[i];
    }
    rep(i, n - 1){
        cin >> c[i];
    }

    int ans = b[a[0]];
    int prev = a[0];
    for(int i = 1; i < n; i++){
        ans += b[a[i]];
        if(prev + 1 == a[i]) ans += c[prev];

        prev = a[i];
    }

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


Measured memory_bytes: 256
// By Mohit Gupta
#include <bits/stdc++.h>
using namespace std;
#define printint(v) copy(begin(v), end(v), ostream_iterator<int>(cout," "))
#define printintv(s,e) copy(s,e, ostream_iterator<int>(cout," "))
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define clz(a) __builtin_clz(a) // count leading zeroes
#define ctz(a) __builtin_ctz(a) // count trailing zeroes
#define popc(a) __builtin_popcount(a) // count set bits (for ints only diff for ll)
//https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html for other in built
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef pair<int,int> p32; 
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
typedef map<int,int> m32;
#pragma GCC optimize ("-O2")
const int LIM = 5e5+5, MOD = 998244353;
int t,n,m,k,x,y;
 
 
int32_t main()
{
	IOS;
	int ans=0;
	cin>>n;
	forsn(i,1,n+1) forsn(j,1,n+1) forsn(k,1,n+1) ans+=(__gcd(i,__gcd(j,k)));
	cout<<ans<<ln;
}


Measured memory_bytes: 3648
n,m = map(int,input().split())
sc = [list(map(int,input().split())) for _ in range(m)]
st = 0 if n==1 else 10**(n-1)
en = 10**n
for x in range(st,en):
    xs = str(x)
    for i in range(m):
        if int(xs[sc[i][0]-1]) != sc[i][1]:
            break
    else:
        print(x)
        break
else:
    print(-1)

Measured memory_bytes: 3064
#include <cstdio>
int H,W,K,c[40][40],A[40][40];
long long solve(){
	long long sum=0;
	for(int T=0;;T++){
		long long tmp=0;
		for(int i=0;i<H;i++){
			for(int l=0,r;l<W;l=r){
				while(l<W&&!A[i][l])l++;
				for(r=l;r<W&&A[i][l]==A[i][r];r++);
				if(r-l>=K){
					for(int j=l;j<r;j++)tmp+=A[i][j],A[i][j]=0;
				}
			}
		}
		sum+=tmp<<T-1;
		bool ok=1;
		for(int j=0;j<W;j++){
			for(int i=H-1,i2=H-1;i>=0;i--){
				while(i2>=0&&!A[i2][j])i2--;
				if(i2>=0){
					if(i2<i)ok=0;
					A[i][j]=A[i2--][j];
				}
				else A[i][j]=0;
			}
		}
		if(ok)return sum;
	}
}
char str[110];
int main(){
	scanf("%d%d%d",&H,&W,&K);
	for(int i=0;i<H;i++){
		scanf("%s",str);
		for(int j=0;j<W;j++)c[i][j]=str[j]-'0';
	}
	long long ans=0;
	for(int x=0;x<H;x++){
		for(int y=0;y<W;y++){
			for(int i=0;i<H;i++)
				for(int j=0;j<W;j++)A[i][j]=i==x&&j==y?0:c[i][j];
			long long tmp=solve();
			if(tmp>ans)ans=tmp;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define eb emplace_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
// const int mod=998244353;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int a,b;
    cin>>a>>b;
    cout<<a*b<<endl;
}

Measured memory_bytes: 3592
import sys
import  math
from heapq import *
import fractions
import bisect
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N=int(input())
A=nl()
A.append(0)
m=1000
kabu=0
for i in range(N):
    if(A[i]<A[i+1]):
        tmp=m//A[i]
        m=m-(A[i]*tmp)
        kabu+=tmp
    elif(A[i-1]<=A[i] and A[i+1]<A[i]):
        m+=kabu*A[i]
        kabu=0

print(m)

    

Measured memory_bytes: 10380
def tri(a,b,c):
	return a**2 == b**2 + c**2
for time in range(int(input())):
	x,y,z = [int(i) for i in input().split()]
	if tri(x,y,z) or tri(y,z,x) or tri(z,x,y):
		print("YES")
	else:
		print("NO")

Measured memory_bytes: 7636
#include <stdio.h>
#include <stdlib.h>


int main (void){
        int N,all=0,min,now;
        int i1[100],i2[100];
        scanf("%d",&N);
        for (int i = 0; i < N; i++) {
                scanf("%d",&i1[i]);
        }
        for (int i = 0; i < N; i++) {
                scanf("%d",&i2[i]);
        }

        for (int i = 0; i < N; i++) {
                all+=i1[i];
                all+=i2[i];
        }
        min=all;
        for (int i = 0; i < N; i++) {
                now=0;
                for (int j = 0; j < i; j++) {
                        now+=i2[j];
                }
                for (int j = i+1; j < N; j++) {
                        now+=i1[j];
                }
                if (now<min) {
                        min=now;
                }

        }
        printf("%d",(all-min));
        return 0;
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

template <typename T,typename E>
struct SegmentTree{
	typedef function<T(T,T)> F;
	typedef function<T(T,E)> G;
	typedef function<E(E,E)> H;
	typedef function<E(E,int)> P;
	int n;
	F f;
	G g;
	H h;
	P p;
	T d1;
	E d0;
	vector<T> dat;
	vector<E> laz;

	SegmentTree(int n_,
				F f,//要素と要素をマージする関数
				G g,//要素に作用素を作用させる関数
				H h,//作用素と作用素をマージする関数
				T d1,//要素のモノイド
				E d0,//作用素のモノイド
				vector<T> v=vector<T>(),
				P p=[](E a,int b){return a;})://区間に対する操作が要素数に比例して変化する場合
	f(f),g(g),h(h),d1(d1),d0(d0),p(p){
		init(n_);
		if(n_==(int)v.size()) build(n_,v);
	}
	
	void init(int n_){
		n=1;
		while(n<n_) n*=2;
		dat.clear();
		dat.resize(2*n-1,d1);
		laz.clear();
		laz.resize(2*n-1,d0);
	}
	
	void build(int n_, vector<T> v){
		for(int i=0;i<n_;i++) dat[i+n-1]=v[i];
		for(int i=n-2;i>=0;i--){
			dat[i]=f(dat[i*2+1],dat[i*2+2]);
		}
	}
	
	inline void eval(int len,int k){
		if(laz[k]==d0) return;
		if(k*2+1<n*2-1){
			laz[k*2+1]=h(laz[k*2+1],laz[k]);
			laz[k*2+2]=h(laz[k*2+2],laz[k]);
		}
		dat[k]=g(dat[k],p(laz[k],len));
		laz[k]=d0;
	}
	
	
	T update(int a,int b,E x,int k,int l,int r){
		eval(r-l,k);
		if(r<=a||b<=l) return dat[k];
		if(a<=l&&r<=b){
			laz[k]=h(laz[k],x);
			return g(dat[k],p(laz[k],r-l));
		}
		return dat[k]=f(update(a,b,x,k*2+1,l,(l+r)/2),
				update(a,b,x,k*2+2,(l+r)/2,r));
	}
	
	T update(int a,int b,E x){
		return update(a,b,x,0,0,n);
	}
	
	T query(int a,int b,int k,int l,int r){
		eval(r-l,k);
		if(r<=a||b<=l) return d1;
		if(a<=l&&r<=b) return dat[k];
		T vl=query(a,b,k*2+1,l,(l+r)/2);
		T vr=query(a,b,k*2+2,(l+r)/2,r);
		return f(vl,vr);
	}
	
	T query(int a,int b){
		return query(a,b,0,0,n);
	}
};
/**
	SegmentTree(int n_,
				F f,//要素と要素をマージする関数
				G g,//要素に作用素を作用させる関数
				H h,//作用素と作用素をマージする関数
				T d1,//要素のモノイド
				E d0,//作用素のモノイド
				vector<T> v=vector<T>(),//初期配列
				P p=[](E a,int b){return a;})://区間に対する操作が要素数に比例して変化する場合
				
	区間加算、区間和
	SegmentTree<ll,ll> seg(n,
	[](ll a,ll b){return a + b;},
	[](ll a,ll b){return a + b;},
	[](ll a,ll b){return a + b;},
	0,
	0,
	vector<ll>(n,0),
	[](ll a,int b){return a * b;});
	
	

**/

int main(){
	
	int n,q;cin >> n >> q;
	
	SegmentTree<ll,ll> seg(n,
	[](ll a,ll b){return min(a, b);},
	[](ll a,ll b){return b;},
	[](ll a,ll b){return b;},
	(1LL << 31) - 1,
	(1LL << 31) - 1,
	vector<ll>(n,(1LL << 31) - 1),
	[](ll a,int b){return a;});
	
	REP(i,q){
		int type;cin >> type;
		if(type == 0){
			int a,b,c;cin >> a >> b >> c;
			seg.update(a,b+1,c);
		}
		else {
			int a,b;cin >> a >> b;
			cout << seg.query(a,b+1) << endl;
		}
	}
	
	return 0;
}



Measured memory_bytes: 8448
#include<cstdio>
#include<vector>
#define ll long long
#define rep(i, l, r) for(int i=l; i<=r; ++i)
#define N 200005
#define mod 1000000007
using namespace std;
int t;
int n;
int a[N];
int dp[N];
int f[N];
int main() {
	scanf("%d", &n);
	rep(i, 1, n) scanf("%d", &a[i]);
	dp[0]=1;
	rep(i, 1, n){
		dp[i]=0;
		if(i==1 || a[i-1]!=a[i]) f[a[i]]=(f[a[i]]+dp[i-1])%mod;
		dp[i]=(dp[i]+f[a[i]])%mod;
	}
	printf("%d", dp[n]);
	return 0;
}

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

int main(){
  string s;
  cin >> s;
  
  vector<char> restr1(s.size(),'1');
  for ( int i = 0; i < s.size();i++)if (i % 2 == 1) restr1.at(i) = '0';
  vector<char> restr0(s.size(),'0');
  for ( int i = 0; i < s.size();i++)if (i % 2 == 1) restr0.at(i) = '1';
  
  
  int ans0 = 0;
  for(int i = 0; i < s.size(); i++){
    if(s.at(i) != restr0.at(i))ans0++;
  }
  
  int ans1 = 0;
  for(int i = 0; i < s.size(); i++){
    if(s.at(i) != restr1.at(i))ans1++;
  }
  
  cout << min(ans0, ans1) << endl;
}

Measured memory_bytes: 512
/* ****devACE**** */

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

#define N  100005

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		ll n,m,i,j,k;
		cin>>n>>m;
		ll a[m],b[m];
		ll mask[m];
		for(i=0;i<m;i++){
			cin>>a[i]>>b[i];
			mask[i]=0;
			for(j=0;j<b[i];j++){
				ll num;
				cin>>num;
				num--;
				mask[i]+=(1LL<<num);
			}
		}

		ll min_cost[(1LL<<(n+1))];
		memset(min_cost,-1,sizeof min_cost);

		min_cost[mask[0]]=a[0];

		for(i=1;i<m;i++){
			
			ll cur_mask = mask[i];
			if(min_cost[cur_mask]==-1)min_cost[cur_mask]=a[i];
			else min_cost[cur_mask]=min(min_cost[cur_mask],a[i]);

			for(j=0;j<(1<<n);j++){
				if(min_cost[j]!=-1){
					min_cost[j|cur_mask]=(min_cost[j|cur_mask]==-1)?min_cost[j]+a[i]:min(min_cost[j|cur_mask],min_cost[j]+a[i]);
				}
			}
		}

		cout<<min_cost[(1<<n)-1];
	}
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h> 
using namespace std;
#define     mod             1e9+7
#define     ll              long long
#define     mp              make_pair
#define     t()             int test;cin>>test;while(test--)
#define     setbits(x)      __builtin_popcountll(x)
#define     si              set<int>
#define     ii              pair<int,int>
#define     vi              vector<int>
#define     que_max         priority_queue <int>
#define     que_min         priority_queue <int, vi, greater<int>>
#define     IOS             ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define     endl            '\n'

/*
	For Debugging we have define TRACE.
*/

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif  

const int N = 1e7 + 5;
int a[N];
int reach [10000001];

void solve(){


	int ac = 0,wa = 0,tle = 0,re = 0;

	int n;
	cin>>n;
	while(n--){
		string str;
		cin>>str;
		if(str == "AC") ac++;
		else if(str == "TLE") tle++;
		else if(str == "WA") wa++;
		else if(str == "RE") re++;
	}

	cout<<"AC x "<<ac<<endl;
	cout<<"WA x "<<wa<<endl;
	cout<<"TLE x "<<tle<<endl;
	cout<<"RE x "<<re<<endl;



}
 
int32_t main()
 
{  
    #ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    #endif

    IOS;

    solve();


}

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

int N;
bool good[17];
int T[17][17];

int res = 0;

inline void check() {
  for (int tt = 1; tt <= N; ++tt) {
    if (good[tt]) {
      for (int p = 1; p <= N; ++p) {
        if (T[tt][p] == 1 && !good[p]) {
          return;
        }
        if (T[tt][p] == 0 && good[p]) {
          return;
        }
      }
    }
  }
  for (int tt = 1; tt <= N; ++tt) {
    if (!good[tt]) {
      continue;
    }
    for (int t = tt + 1; t <= N; ++t) {
      if (good[t]) {
        for (int p = 1; p <= N; ++p) {
          if (T[tt][p] != -1 && T[t][p] != -1) {
            if (T[tt][p] != T[t][p]) {
              return;
            }
          }
        }
      }
    }
  }
  int cur = 0;
  for (int i = 1; i <= N; ++i) {
    cur += good[i];
  }
  res = max(res, cur);
}

void dfs(int idx) {
  if (idx == N + 1) {
    check();
    return;
  }
  good[idx] = false;
  dfs(idx + 1);
  good[idx] = true;
  dfs(idx + 1);
}

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

  cin >> N;
  for (int tt = 1; tt <= N; ++tt) {
    for (int i = 0; i <= N; ++i) {
      T[tt][i] = -1;
    }
    int n;
    cin >> n;
    while (n--) {
      int p, b;
      cin >> p >> b;
      T[tt][p] = b;
    }
  }
  dfs(1);
  cout << res << '\n';
}

Measured memory_bytes: 256
def examA():
    X, Y, Z = LI()
    X, Y = Y,X
    X,Z = Z, X
    print(X,Y,Z)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examA()

"""

"""

Measured memory_bytes: 39152
#include<bits/stdc++.h>
#include<string>
#include<cmath>

using namespace std;

#define ll long long int
#define loop(i, n) for (int i = 0; i < n; i++)
#define loops(i, s, n) for (int i = s; i < n; i++)
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
#define MOD 1000000007

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

    string s;
    cin>>s;
    for(int i = 0; i<sz(s); i++){
        if(s[i] == '?'){
            s[i] = 'D';
        }
    }
    cout<<s;
}

Measured memory_bytes: 3716
#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 int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define PI acos(-1)
#define all(c) (c).begin(),(c).end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

int modpow(int x, int n, int m) {
	x %= m;
	int res = 1;
	while(n > 0) {
		if(n & 1)
			res = res * x % m;
		x = x * x % m;
		n >>= 1;
	}
	return res;
}

const ll inf = 2e18;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;

signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	srand(chrono::steady_clock::now().time_since_epoch().count());
	#ifndef ONLINE_JUDGE
		// freopen("input.txt", "r", stdin);
		// freopen("output.txt", "w", stdout);
	#endif

	int n;
	cin >> n;
	map<pii, int> m;
	int ans = 0;
	for(int i = 1; i <= n; i++) {
		vi v;
		int tmp = i;
		while(tmp) {
			v.pb(tmp % 10);
			tmp /= 10;
		}
		m[{v.back(), v[0]}]++;
	}
	for(int i = 1; i <= 9; i++) {
		for(int j = 1; j <= 9; j++) {
			ans += m[{i, j}] * m[{j, i}];
		}
	}
	cout << ans;

	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	char a[3];
	a[0]='a';
	a[1]='b';
	a[2]='c';
	for(int i=0;i<3;i++){
		for(int j=0;j<3;j++){
			if(s[i]==a[j]) a[j]='z';
		}
	}
	if(a[0]=='z'&&a[1]=='z'&&a[2]=='z') cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	cout<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define F first
#define S second
#define pb emplace_back
#define mt make_tuple
#define mp make_pair
#define gcd __gcd
#define PI 3.141592653589
// Input
#define in(a) scanf("%d",&a)
#define in2(a,b) scanf("%d%d",&a,&b)
#define in3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define llin(a) cin >> a
#define inl(a) scanf("%lld",&a)
#define read(v,i,n) for(i=0;i<n;i++)in(v[i])
#define twod(mat,i,j,n,m) rep(i,n){rep(j,m)in(mat[i][j]);}
#define sc(ch) scanf("%c",&ch)
#define sstr(str) scanf("%s",str)
// Output
#define pr(a) printf("%d ",a)
#define pr2(a,b) printf("%d %d\n",a,b)
#define pr3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out(a) printf("%d\n",a)
#define outl(a) printf("%lld\n",a)
#define llpr(a) cout << a << " "
#define llout(a) cout << a << "\n"
#define yes printf("YES\n")
#define no printf("NO\n")
#define lin printf("\n")
// Iterator
#define lp(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define lower(v,k) lower_bound(v.begin(),v.end(),k)-v.begin()
#define upper(v,k) upper_bound(v.begin(),v.end(),k)-v.begin()
#define tf(mytuple) get<0>(mytuple)
#define ts(mytuple) get<1>(mytuple)
#define tt(mytuple) get<2>(mytuple)
// Debug
#define dbg(v,i,n) for(i=0;i<n;i++)pr(v[i]); lin
#define what(x) cerr << #x << " : " << x << "\n"
#define ck printf("continue\n")
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
	cerr << *it << " = " << a << "\n";
	err(++it, args...);
}
// Data Type
#define ll long long int
#define ii pair<int,int>
//#define pli pair<ll,int>
#define triple tuple<int,int,int>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define viii vector<pair<pair<int,int>,int> >
#define vvii vector<vector<pair<int,int> > >
#define M 1000000007
#define N 1000005  //check the limits, man
const ll INF = 1e18;
int main()
{
    int i,n,a,f;
    in(n);
    vi v(n,0);
    rep(i,n)
        in(a),v[a]++;
    f=1;
    for(i=n-1;i>0;i-=2)
        if(v[i]!=2)f=0;
    if(i==0)
    {
        if(v[0]!=1)
            f=0;
    }
    ll ans=f;
    n/=2;
    rep(i,n)
        ans*=2,ans%=M;
    llout(ans);
}


Measured memory_bytes: 640