akhauriyash/Code-Regression huggingface dataset:
import java.text.DecimalFormat;
import java.util.Scanner;

public class Main {
	public static final double eps = 1E-8;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		DecimalFormat df = new DecimalFormat("0.000");
		while(sc.hasNext()) {
			double[][] a = new double[2][2];
			double[] b = new double[2];
			for(int i=0;i<2;i++) {
				for(int j=0;j<2;j++) {
					a[i][j] = sc.nextInt();
				}
				b[i] = sc.nextInt();
			}
			double[] x = solveEquation(a, b);
			System.out.println(df.format(x[0]) + " " + df.format(x[1]));
		}
	}
	public static double[] solveEquation(double[][] A,double[] b) {
		int n = A.length;
		double[][] B = new double[n][n+1];
		for(int i=0;i<n;i++) {
			for(int j=0;j<n;j++) {
				B[i][j] = A[i][j];
			}
			B[i][n] = b[i];
		}
		for(int i=0;i<n;i++) {
			int pivot = i;
			for(int j=i;j<n;j++) {
				if (Math.abs(B[j][i]) > Math.abs(B[pivot][i])) {
					pivot = j;
				}

			}
			swapRow(B, i, pivot);
			if (Math.abs(B[i][i]) < eps) {
				return null;
			}
			for(int j=i+1;j<=n;j++) {
				B[i][j] /= B[i][i];
			}
			for(int j=0;j<n;j++) {
				if (i==j) {
					continue;
				}
				for(int k=i+1;k<=n;k++) {
					B[j][k] -= B[j][i] * B[i][k];
				}
			}
		}
		double[] x = new double[n];
		for(int i=0;i<n;i++) {
			x[i] = B[i][n];
		}
		return x;
	}
	public static void swapRow(double[][] A,int i,int j) {
		double[] temp = A[i];
		A[i] = A[j];
		A[j] = temp;
	}
}

Measured memory_bytes: 18164
import sys
input = sys.stdin.readline
def chmax(dp, i, j, b):
    if dp[i][j] < b:
        dp[i][j] = b
        return True
    return False
def main():
    N, W = map(int, input().split())
    goods = []
    for _ in range(N):
        goods.append(list(map(int, input().split())))
    dp = [[0 for _ in range(W+1)] for _ in range(N+1)]
    for i in range(N):
        w, v = goods[i][0], goods[i][1]
        for j in range(W+1):
            chmax(dp, i+1, j, dp[i][j])
            if j-w >= 0:chmax(dp, i+1, j, dp[i][j-w]+v)
    print(dp[-1][-1])
if __name__ == "__main__":
    main()

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

int main() {
  int n;
  cin >> n;
  
  if(n>=64) {
    cout << 64 << endl;
  }
  else if(n>=32) {
    cout << 32 << endl;
  }
    else if(n>=16) {
    cout << 16 << endl;
  }
    else if(n>=8) {
    cout << 8 << endl;
  }
    else if(n>=4) {
    cout << 4 << endl;
  }
    else if(n>=2) {
    cout << 2 << endl;
  }
  else {
    cout << 1 << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n;
struct node{
	char s[11];
	int p;
	int id;
}a[110];
bool cmp(node u,node v){
	int w=strcmp(u.s,v.s);
	if(w!=0){
		return w<0;
	}
	return u.p>v.p;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%s%d",a[i].s,&a[i].p);
		a[i].id=i;
	}
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++)printf("%d\n",a[i].id);
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define RFOR(i, start, end) for (int i = start; end <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1000000007
typedef long long ll;
const int INF32 = 2147483647;
const ll INF64  = 9223372036854775807;
using namespace std;

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

    int N, K;
    string S;
    cin >> N >> S >> K;

    REP(i, N) {
        if (S[i] != S[K - 1]) {
            S[i] = '*';
        }
    }

    cout << S << endl;

    return 0;
}

Measured memory_bytes: 256
//AtCoder ABC080 B - Harshad Number
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;

int main() {
    string N;
    cin>>N;
    ll sum=0;
    ll val=stoi(N);
    for(const auto& s:N){
        sum+=s-'0';
    }
    cout<<(val%sum==0?"Yes":"No")<<endl;
    return 0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
score = list(map(int, input().split()))
t_str = input()
hand = 'rsp'
t = []
for x in t_str:
    t.append(hand.index(x))

ans = 0
for r in range(k):
    d = [0] * 3
    for h in t[r::k]:
        dd = [0] * 3
        for i in range(3):
            for j in range(3):
                if i != j:
                    point = 0
                    if (j - h) % 3 == 2:
                        point = score[j]
                    dd[j] = max(dd[j], d[i] + point)
        d = dd
    ans += max(d)
print(ans)

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)

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

  if(N>=10) cout << R;
  else cout << R+100*(10-N); 
}

Measured memory_bytes: 256
N,T = list(map(int,input().split()))
c0 = 1000
count = 0
for i in range(N):
  c,t = list(map(int,input().split()))
  if t <= T:
    if c < c0:
      c0 = c
    else:
      continue
  else:
    count += 1
    continue

if count == N:
  print("TLE")
else:
  print(c0)

Measured memory_bytes: 3060
#include <iostream>


using namespace std;

 

int main() 
{
    int w, h, x, y, r;
    cin >> w >> h >> x >> y >> r;
    if(x-r >= 0 && x+r<= w && y-r >= 0 && y+r <= h)
        cout << "Yes" << endl;
    else
    
        cout << "No" << endl;
}


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

int main() {
	
	int n;
	cin >> n;
	std::vector<int> arr(n) ;
	std::vector<int> dp(n) ;
	
	for(int i = 0; i < n; ++i)
	cin >> arr[i];
	    
	dp[0] = 0;
	dp[1] = abs(arr[1] - arr[0]);
	for(int i = 2; i < n; ++i)
	{
	    dp[i] = min(dp[i-1] + abs(arr[i] - arr[i-1]), dp[i-2]+ abs(arr[i] - arr[i-2]));
	}
	cout << dp[n-1];
	
	return 0;
}


Measured memory_bytes: 3976
#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;
using lli = long long int;
int main() {
  string s;cin >> s;
  int n = s.size();
  rep(i,n){

      char c = s[i];
    if((i&1) == 0){
      if(c=='R' or c=='U' or c=='D'){
        continue;
      }
    }
    else{
  if(c=='L' or c=='U' or c=='D'){
        continue;
      }
    }
    cout << "No"<<endl;
    return 0;
  }
  cout << "Yes"<<endl;
}


Measured memory_bytes: 256
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

rissoku=min(A,B,C,D,E)
if N%rissoku==0:
    print(N//rissoku-1+5)
else:
    print(N//rissoku+5)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 29)
using namespace std;

char a[4][3] = {"..", "#.", ".#", "##"};

void pushLine(int cnt, list< pair<char, char> > &v, bool c){
    if(c){
        v.push_front(make_pair(a[cnt][0], a[cnt][1]));
    }else{
        v.push_back(make_pair(a[cnt][0], a[cnt][1]));
    }
}

int main(){
    int n;
    list< pair<char, char> > v;
    cin >> n;

    bool c = true; //true == front, false == back
    int cnt = 0;
    while(true){
        if(c){
            cout << a[cnt][0];
            for(auto p : v) cout << p.first;
            cout << endl;
            cout << a[cnt][1];
            for(auto p : v) cout << p.second;
            cout << endl;
        }else{
            for(auto p : v) cout << p.first;
            cout << a[cnt][0];
            cout << endl;
            for(auto p : v) cout << p.second;
            cout << a[cnt][1];
            cout << endl;
        }
        fflush(stdout);

        string str;
        cin >> str;
        if(str[0] == 'T'){
            pushLine(cnt, v, c);
            cnt = 0;
        }else if(str[0] == 'F'){
            cnt++;
        }else{
            break;
        }
        if(cnt == 4){
            cnt = 0;
            c = false;
        }
    }
}


Measured memory_bytes: 724
import java.util.Scanner;

class Main{
   
 public static void main(String... args){
      final int INF = (int)(10e9 + 7);
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int W = sc.nextInt();

      int[] weight = new int[N];
      int[] value = new int[N];
      
      int sum_value = 0;
      for(int i = 0; i < N; i++){
        weight[i] = sc.nextInt();
        value[i] = sc.nextInt();
        sum_value += value[i];
      }
   
      //dp[i] = minimum weight by having exact value of i.
      //since here value <= 10^3 so dp[] dimension is taken as value
      //and not weight because weight <= 10^9
      long[] dp = new long[sum_value+1]; //if all N items are of value 1000.
      for(int i=0; i <= sum_value; i++){
      	dp[i] = INF;
      }
        
      dp[0] = 0;
      for(int item = 0; item < N; item++){
        for(int existing_val = sum_value; existing_val >= 0; existing_val--){
          if(existing_val >= value[item]){
          	dp[existing_val] = Math.min(dp[existing_val], 
                                        dp[existing_val - value[item]] + weight[item]);
          }
        }
      }
   
   	  long ans = 0;
      for(int i = 0; i <= sum_value; i++){
        if(dp[i] <= W)
      		ans = Math.max(ans, (long) i);
      }
      System.out.println(ans);
   
      if(sc != null)
        sc.close();
  }
}


Measured memory_bytes: 23636
#include <iostream>
#include <vector>
#include <utility>
#include <queue>

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<vector<pair<int, long long int> > > Edges(N+1);
    for(int n=0; n<N-1; n++) {
        int a, b;
        long long int c;
        cin >> a >> b >> c;
        Edges[a].push_back(make_pair(b, c));
        Edges[b].push_back(make_pair(a, c));
        // cout << a << b << c;
    }
    
    int Q, K;
    cin >> Q >> K;
    // cout << Q << K;
    
    vector<long long int> dist_from_k(N+1, -1);
    dist_from_k[K]=0;
    queue<int> que;
    que.push(K);
    while(!que.empty()) {
        int cur=que.front(); que.pop();
        
        for(int i=0; i<Edges[cur].size(); i++) {
            if(dist_from_k[Edges[cur][i].first]!=-1) continue;
            
            dist_from_k[Edges[cur][i].first] = dist_from_k[cur]+Edges[cur][i].second;
            que.push(Edges[cur][i].first);
        }
    }
    
    vector<long long int> ans;
    for(int q=0; q<Q; q++) {
        int x, y;
        cin >> x >> y;
        ans.push_back(dist_from_k[x]+dist_from_k[y]);
    }
    
    for(int q=0; q<Q; q++) {
        cout << ans[q] << endl;
    }


    return 0;
    
}

Measured memory_bytes: 13308
fun main(args: Array<String>) {

    val n = readLine()!!.toInt()
    val ls = readLine()!!.split(" ").map { it.toInt() }


    /*
    val n = 5
    val ls = listOf(4, 4, 9, 7, 5)
    */

    var answer = 0

    (0 until n).forEach { i ->
        (i + 1 until n).forEach { j ->
            (j + 1 until n).forEach { k ->
                //println("i $i, j: $j, k: $k")
                val a = ls[i]
                val b = ls[j]
                val c = ls[k]

                if (!(a == b || a == c || b == c) && isTriangle(a, b, c)) {
                    //println("ok: $a $b $c")
                    answer++
                }
            }
        }
    }

    println("$answer")
}

fun isTriangle(a: Int, b: Int, c: Int): Boolean {
    return a + b > c && b + c > a && c + a > b
}


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

#define int long long
struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;
using intpair = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

signed main(){
    char a, b;
    cin >> a >> b;
    cout << (a == b ? "H" : "D") << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <climits>
#include <float.h>

using namespace std;

int main()
{
	int N;
	cin >> N;
	int T;
	int A;
	cin >> T >> A;
	vector<int> H(N);
	for (int i = 0; i < N; i++)
	{
		cin >> H[i];
	}
	
	double tempDiff = DBL_MAX;
	int answer = -1;
	for (int i = 0; i < N; i++)
	{
		double temperature = T - H[i] * 0.006;
		double diff = fabs(A - temperature);
		if (diff < tempDiff)
		{
			tempDiff = diff;
			answer = i + 1;
		}
	}
	
	cout << answer << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define ll long long

using namespace std;
int main(void){
  vector<ll> x(4);
  for(int i = 0;i < 4;i ++){
    cin >> x[i];
  }
  ll ans = x[0] * x[2];
  for(int i = 0;i < 2;i ++){
    for(int j = 0;j < 2;j ++){
      if(ans < x[i]*x[j+2]){
        ans = x[i]*x[j+2];
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3624
from collections import Counter

N = int(input()) #本数
L = list(map(int, input().split()))

d = Counter(L)
l = list(set(L))
l.sort()

ans = 0
n = len(l)
for i in range(n-2):
    a = l[i]
    for j in range(i+1, n-1):
        b = l[j]
        for k in range(j+1, n):
            if (abs(a-b) < l[k]) and l[k] < a+b:
                ans += d[a]*d[b]*d[l[k]]
print(ans)


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

//解説
int main() {
    int n,m;
    cin >> n >> m;
    int p = pow(2,m);
    int x = 0;//answer;
    x = (1900*m + 100*(n-m)) * p;
    cout << x << endl;
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
import java.util.Scanner;

public class Main
{
	public static void main(String arg[])
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext())
		{
			int ob = sc.nextInt();
			if(ob == 0)
				return;
			int total = 0;
			int month = 0;
			int x=12;
			while(x-->0)
			{
				int m = sc.nextInt();
				int n = sc.nextInt();
				total = total+m-n;
				month++;
				if(total>=ob)
				{
					System.out.println(month);
					ob = Integer.MAX_VALUE;
				}
				if(month==12 && ob!=Integer.MAX_VALUE)
				{
					System.out.println("NA");
				}
			}
		}
	}
}

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

int main(){
	int N, M;
	cin >> N >> M;
	M*=2;
	vector<int> a(M);
	
	for(int i=0;i<M;i++){
		cin >> a.at(i);
	}
	
	for(int i=1;i<=N;i++){
		int ans=0;
		for(int j=0;j<M;j++){
			if(a.at(j)==i){
				ans++;
			}
		}
		cout << ans << endl;
	}
	
}

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

using namespace std;
typedef long long ll;
const int MAXN = (int)1e5 + 100;

ll C, rx[MAXN], lx[MAXN], rv[MAXN], lv[MAXN];
ll sumrv[MAXN], sumlv[MAXN], mre[MAXN], mle[MAXN];
ll ansr = 0;
ll ansl = 0;

int main() {
	int N;
	rx[0] = 0;
	lx[0] = 0;
	rv[0] = 0;
	lv[0] = 0;
	sumrv[0] = 0;
	sumlv[0] = 0;
	mre[0] = 0;
	mle[0] = 0;

	cin >> N >> C;
	for (int i = 1; i <= N; i++) {
		cin >> rx[i] >> rv[i];
		lx[N - i + 1] = C - rx[i];
		lv[N - i + 1] = rv[i];
	}
	sumrv[1] = rv[1];
	sumlv[1] = lv[1];
	for (int i = 1; i <= N; i++) {
		sumrv[i] = sumrv[i - 1] + rv[i];
		sumlv[i] = sumlv[i - 1] + lv[i];
	}
	for (int i = 1; i <= N; i++) {
		mre[i] = max(sumrv[i] - rx[i], mre[i - 1]);
		mle[i] = max(sumlv[i] - lx[i], mle[i - 1]);
	}
	for (int i = 0; i <= N; i++) {
		ll getre = mre[N - i] + sumlv[i] - 2 * lx[i];
		if (ansr < getre)ansr = getre;
		ll getle = mle[N - i] + sumrv[i] - 2 * rx[i];
		if (ansl < getle)ansl = getle;
	}
	cout << max(ansr, ansl) << endl;
	return 0;
}

Measured memory_bytes: 6528
import java.util.Scanner;


	public class Main {
		
		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int k = sc.nextInt();
			int s = sc.nextInt();
			
			int ret = 0;
			
			for(int i=0;i<=k;i++) {
				for(int j=0;j<=k;j++) {
					if(0<=(s-i-j)&&(s-i-j)<=k) {
						ret++;
					}
				}
			}
			
			System.out.println(ret);
			
	    }
		
	}
	


Measured memory_bytes: 35696
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

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

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    ll ans;
    rep(i,n){
        ll a;
        cin >> a;
        if(i==0){
            ans=a;
        }
        else{
            ans=gcd(a,ans);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3592
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

#define N_MAX 10000005

using namespace std;

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

const ll mod = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1LL << 60;

int main()
{
    int a,b,c;
    cin >> a >> b >> c;
    if((a == b && a != c)||(a==c && a != b)||(b == c && a != b)){
        cout << "Yes";
    }else{
        cout << "No";
    }
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
	int D, T, S;
	scanf("%d %d %d", &D, &T, &S);
	int n;
	n = T * S;
	if (D <= n) {
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
	}

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

string S;
string T[]={"dream","dreamer","erase","eraser"};

bool match(int n,int j)
{
	for(int i=0;i<T[j].size();i++)
	{
		if(S[n+i]!=T[j][i])
			return false;
	}
	return true;
}


int main()
{
	bool flag;
	cin >> S;
	
	reverse(S.begin(),S.end());
	for(int i=0;i<4;i++)
		reverse(T[i].begin(),T[i].end());
	
	for(int i=0;i<S.size();)
	{
		flag=false;
		for(int j=0;j<4;j++)
		{
			flag=match(i,j);
			if(flag==true)
			{
				i+=T[j].size();
				break;
			}
		}
		if(flag==false)
		{
			cout << "NO" << endl;
			return 0;
		}
	}
	
	cout << "YES" << endl;
	return 0;
}

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

int n;
int a[110];

int main()
{
    cin>>n;

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

    int ma = a[0];
    int mi = a[0];

    for (int i = 0; i < n; i++)
    {
        ma = max(ma,a[i]);
        mi = min(mi,a[i]);
    }
    
    cout << ma-mi << endl;
    
    return 0;
}


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

int main() {
  double a, b;
  cin >> a >> b;
  int c = a * b / 2;
  double d = a * b / 2;
  
  if (d - c == 0){
  cout << "Even" << endl;
  }
  else{
  cout << "Odd" << endl;
  }

  
}

Measured memory_bytes: 3688
//do not think about past and stay in this moment
//organize and work - Abhinav IIITA
#include <bits/stdc++.h>
#include <ctime>
using namespace std;
#define int long long
#define ld long double
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end() 
const ld pi = acos(-1.0);
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int mod;
void fx(vector<int> &a,int n, int m){

}

// -----------------------------------------------------------------------

int arr[3000000];
void input(int n){
	for(int i=0;i<n;++i)
	cin>>arr[i];
}

// -----------------------------------------------------------------------



void q1(){
	int a,b;
	cin>>a>>b;
	if(a==1 || b==1){
		if(a==1 && b==1)
		cout<<"Draw";
		else if(a==1)
		cout<<"Alice";
		else
		cout<<"Bob";
	}
	else if(a==b)
	cout<<"Draw";
	else if(a>b)
	cout<<"Alice";
	else
	cout<<"Bob";
	
}
// -----------------------------------------------------------------------


void q2(){
	string s,t;
	cin>>s;
	t="";
	int skip=0;
	for(int i=(int)s.size()-1;i>=0;i--){
		if(s[i]=='B'){
			skip++;
		} else{
			if(skip>0){
				skip--;
			} else{
				t+=s[i];
			}
		}
	}
	for(int i=sz(t)-1;i>=0;--i)
	cout<<t[i];
}

// -----------------------------------------------------------------------

void q3(){
	int n;
	cin>>n;
	input(n);
	ld sum=0;
	for(int i=0;i<n;++i){
		sum+=arr[i];
	}
	sum/=n;
	int l=sum;
	sum+=1.00;
	int u=sum;
	int pp,p;
	pp=0;
	sum=l;
	for(int i=0;i<n;++i){
		pp+=((arr[i]-sum)*(arr[i]-sum));
	}p=0;sum=u;
	for(int i=0;i<n;++i){
		p+=((arr[i]-sum)*(arr[i]-sum));
	}
	cout<<min(p,pp);
}


// -----------------------------------------------------------------------

void q4(){
	string s;
	cin>>s;
	int xp=sz(s);
	for(int i=0;i<xp-2;++i){
		if(s[i]==s[i+1]){
			cout<<i+1<<" "<<i+2<<endl;
			return ;
		}
		if(s[i]==s[i+2]){
			cout<<i+1<<" "<<i+3<<endl;
			return ;
		}
	}
	if(s[xp-1]==s[xp-2]){
		cout<<xp-1<<" "<<xp<<endl;
		return ;
	}
	cout<<"-1 -1\n";
	return ;
}

// -----------------------------------------------------------------------


int32_t main()
{
	mod=1e+7;
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); 	
	int t=1;
	//cin>>t;
	while(t--)
	q1();
	return 0;
}


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

int main()
{
    int n;
    set<int> s;
    cin >> n;
    for(int i = 0; i < n; ++i)
    {
        int t;
        cin >> t;
        s.insert(t);
    }
    cout << s.size() << endl;
}

Measured memory_bytes: 256
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
ans=0
for i in range(N):
    A=list(map(int,input().split()))
    judge=C
    for j in range(M):
        judge+=A[j]*B[j]
    if judge>0:
        ans+=1
        
print(ans)

Measured memory_bytes: 3064
#include <math.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <ostream>
#include <tuple>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef int _lcint;
#define REP(i, n) for (_lcint i = 0; i < n; i++)
#define FOR(i, a, b) for (_lcint i = (_lcint)(a); i < (_lcint)(b); i++)
#define FORREV(i, a, b) for (_lcint i = (_lcint)(b)-1; i >= (_lcint)(a); i--)
#define DEBUG(x) cout << #x << ": " << x << endl;
#define DEBUG_VEC(v)  \
  cout << #v << ": "; \
  REP(i, v.size()) cout << " " << v[i] << endl;

#define ALL(a) (a).begin(), (a).end()
#define CHMIN(a, b) a = min((a), (b))
#define CHMAX(a, b) a = max((a), (b))

// permutation
ll mPn(ll m, ll n) {
  ll a = 1;
  REP(i, n) { a *= m - i; }
  return a;
}

// excrametion
ll exc(ll m) {
  ll a = 1;
  FOR(i, 1, m) { a *= i + 1; }
  return a;
}

// combination
ll mCn(ll m, ll n) {
  ll a = 1, b = 1;
  REP(i, n) {
    a *= m - i;
    b *= n - i;
  }
  return a / b;
}

int main() {
  int N;

  cin >> N;
  char s[N + 1];
  scanf("%s", s);

  int r = 0;
  REP(i, N) {
    if (s[i] == 'R') {
      r++;
    }
  }

  if (N - r < r) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
 
#define pb push_back
#define eb emplace_back
#define x first
#define y second
#define all(c) (c).begin(), (c).end()
#define sz(x) ((int)(x).size())
 
 
template <class T, class U>
void chmin(T& t, const U& u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
    if (t < u) t = u;
}
 
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}
 
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "{";
    for(int i = 0; i < v.size(); i++) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}
 
#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif
 
const ll MOD = 1e9 + 7; //998244353
constexpr ll INF = 1e18;
const int MX = 3010;

V <int> g[100001];
int h[100001];
bool good[100001], vis[100001];
int n, m, u, v;


int main(){
    ios::sync_with_stdio(false);
    cin >> n >> m ;
    for(int i =1; i <= n; i++){
        cin >> h[i];
    }
    for(int i = 0; i < m; i++){
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }

    function < void (int) > dfs = [&] (int u){
        vis[u] = 1;
        for(auto v : g[u]){
            if(h[u] <= h[v])
                good[u] = 1;

            if(!vis[v])
                dfs(v);
        }
        return ;
    };
    for(int i = 1; i <= n; i++)
        if(!vis[i])
            dfs(i);
    
    int ans = 0;
    for(int i = 1; i <= n; i++)
        ans += (good[i] ? 0 : 1);

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 11396
N = int(input())
order = list(map(int, input().split(' ')))
Bs = list(map(int, input().split(' ')))
Cs = list(map(int, input().split(' ')))
old = None
ans = 0
for i in order:
    index = i - 1
    if old != None and old + 1 == index:
        ans += Cs[old]
    ans += Bs[index]
    old = index
        
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n;
  cin >> n;
  deque<ll> q;
  rep(i, n) {
    ll a;
    cin >> a;
    if(i % 2)
      q.push_front(a);
    else
      q.push_back(a);
  }
  rep(i, n) {
    if(n % 2) {
      cout << q.back() << (i == n - 1 ? '\n' : ' ');
      q.pop_back();

    } else {
      cout << q.front() << (i == n - 1 ? '\n' : ' ');
      q.pop_front();
    }
  }
}

Measured memory_bytes: 5264
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mem(dp, v) memset(dp, v, sizeof dp)
using namespace std;
const ll N = 1e5 + 7, inf = 1e17;
ll ar[N], br[N];
//string s;
//ll foo(int i, int j)
//{//cout<<"dsa";
//    ll &ret = dp[i][j];
//    if(i == j) return 1;
//    if(i > j) return 0;
//    if(ret != -1) return ret;
//    ll ans = 0;
//    if(s[i] == s[j]) ans = (1 + foo(i + 1, j - 1)) + foo(i + 1, j) + foo(i, j - 1)- foo(i + 1, j - 1);
//    else ans = foo(i + 1, j) + foo(i, j - 1) - foo(i + 1, j - 1);
//    return ret = ans;
//}
int main()
{
    string s;
    ll n, m, k;
    cin>>s;
    for(int i = 0; i < s.size(); i++) cout<<'x';
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=1000005;
char s[N];
int a[N],n,q,k;
inline int get_sum(int x,int y)
{
	if(y>n)	
		y=n;
	return a[y]-a[x-1];
}
int main()
{
	scanf("%d%s",&n,s+1);
	for(int i=1;i<=n;i++)
		a[i]=a[i-1]+(s[i]=='C');
	scanf("%d",&q);
	while(q--)
	{
		scanf("%d",&k);
		long long ans=0,sd=0,sm=0,sdm=0;
		for(int i=1;i<=n;i++)
		{
			if(s[i]=='D')
				sd++;
			if(s[i]=='M')
				sm++,sdm+=sd;
			if(s[i]=='C')
				ans+=sdm;
			if(i<k)
				continue;
			if(s[i-k+1]=='D')
				sd--,sdm-=sm;
			if(s[i-k+1]=='M')
				sm--;
		}
		printf("%lld\n",ans);
	} 
	return 0;
}


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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;

int main() {
    int x, y, z;
    cin >> x >> y >> z;
    swap(x, y);
    swap(x, z);
    cout << x<< " " << y<<" " << z << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
	#define debug(...) printf(__VA_ARGS__)
#else
	#define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

const int MAXN = 1e5 + 50;
int a[MAXN];
ll ans[MAXN];

int main() {
	int N;
	scanf("%d", &N);
	for(int i = 1; i <= N; i++)
		scanf("%d", &a[i]);
	vector<PII> num;
	for(int i = 1; i <= N; i++)
		num.PB(MP(a[i], i));
	sort(ALL(num));
	int sml = MAXN;
	for(int i = SZ(num) - 1; i >= 0; i--) {
		while(i > 0 && num[i].F == num[i - 1].F) i--;
		sml = min(sml, num[i].S);
		int with = SZ(num) - i;
		int diff;
		if(i > 0) diff = num[i].F - num[i - 1].F;
		else diff = num[i].F;
		ans[sml] += 1ll * with * diff;
	}
	for(int i = 1; i <= N; i++)
		printf("%lld\n", ans[i]);
	return 0;
}


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


int main() {
	int n, m;
	cin >> n >> m;
	priority_queue<int> pq;
	int a;
	for (int i=0; i<n; i++) {
		cin >> a;
		pq.push(a);
	}

	for (int i=0; i<m; i++) {
		pq.push(pq.top()/2);
		pq.pop();
	}

	int64_t sum =0;
	for (int i=0; i<n; i++) {
		sum +=pq.top();
		pq.pop();
	}
	cout << sum << endl;
	//cout << accumulate(a.begin(), a.end(), 0) << endl;

}


Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, C, D;
  
  cin >> A >> B >> C >> D;
  
  if ( (A + B)  > ( C + D ) ){
    cout << "Left" << endl;
  }
  else if ((A + B)  < ( C + D )){
    cout << "Right" << endl;
  }
  else{
    cout << "Balanced" << endl;
  }
}

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

#define MAX_W 1000
#define MAX_N 10000
typedef vector<pair<int, int> > vec;

int main(){
	int W, N, c = 1;
	while( cin >> W, W ){
		cin >> N;
		vector<vec> dp(N+1, vec(W+1));
		vector<int> w(N), v(N);
		for( int i = 0; i < N; i++ ){
			scanf("%d,%d", &v[i], &w[i]);
		}
		dp[0][0] = make_pair(0, 0);
		for( int i = 0; i < N; i++ ){
			for( int j = 0; j <= W; j++ ){
				if( j-w[i] >= 0 ){
					if( dp[i][j].first < dp[i][j-w[i]].first+v[i] ){
						dp[i+1][j].first = dp[i][j-w[i]].first+v[i];
						dp[i+1][j].second = dp[i][j-w[i]].second+w[i];
					}else if( dp[i][j].first == dp[i][j-w[i]].first+v[i] ){
						if( dp[i][j].second < dp[i][j-w[i]].second+w[i] ){
							dp[i+1][j].first = dp[i][j].first;
							dp[i+1][j].second = dp[i][j].second;
						}else{
							dp[i+1][j].first = dp[i][j-w[i]].first+v[i];
							dp[i+1][j].second = dp[i][j-w[i]].second+w[i];
						}
					}else{
						dp[i+1][j].first = dp[i][j].first;
						dp[i+1][j].second = dp[i][j].second;
					}
				}else{
					dp[i+1][j] = make_pair(dp[i][j].first, dp[i][j].second);
				}
			}
		}
		/*for( int i = 0; i <= N; i++ ){
			printf("%d: ", i);
			for( int j = 0; j <= W; j++ ){
				printf("%d ", dp[i][j].second);
			}
			printf("\n");
		}*/
		printf("Case %d:\n%d\n%d\n", c, dp[N][W].first, dp[N][W].second);
		c++;
	}
}

Measured memory_bytes: 9000
#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
struct node
{
    string x;
    int y;
}a[3];
int main()
{
    cin>>a[1].x>>a[2].x;
    scanf("%d%d",&a[1].y,&a[2].y);
    string p;
    cin>>p;
    if(p==a[1].x)
    {
        printf("%d %d",a[1].y-1,a[2].y);
    }
    if(p==a[2].x)
    {
         printf("%d %d",a[1].y,a[2].y-1);
    }
    return 0;
    
}


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

bool n, w, s, e;

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

  for(int i = 0; i < S.size(); i++){
    if(S[i] == 'N'){
      n = true;
    }else if(S[i] == 'W'){
      w = true;
    }else if(S[i] == 'S'){
      s = true;
    }else if(S[i] == 'E'){
      e = true;
    }
  }

  if((n and !s) or (!n and s) or (!w and e) or (w and !e)) cout << "No" << endl;
  else cout << "Yes" << endl;

  return 0;
}


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

using namespace std;

int main()
{
    int N;
    cin >> N;
    if((N%10 == 2)||(N%10 == 4)||(N%10 == 5)||(N%10 == 7)||(N%10 == 9)) cout << "hon" << endl;
    else if((N%10 == 0)||(N%10 == 1)||(N%10 == 6)||(N%10 == 8)) cout << "pon" << endl;
    else cout << "bon" << endl;
}

Measured memory_bytes: 3636
function Main(input) {
    input = input.trim().split('\n');
    const hwk = input[0].split(' ');
    const h = parseInt(hwk[0], 10), w = parseInt(hwk[1], 10), k = parseInt(hwk[2], 10);
    const hw = [];
    for(let i=0; i<h; i++){
        hw[i] = input[i+1].split('');
    }

    let count = 0, ret = 0;
    for(let i=0; i<=2**h-1; i++){
        for(let j=0; j<=2**w-1; j++){
            let hc = i.toString(2).padStart(h,'0').split('');
            let wc = j.toString(2).padStart(w,'0').split('');
            hc.forEach((hcel, hcid) => {
                wc.forEach((wcel, wcid) => {
                    if(hcel == 0 && wcel == 0){
                        if(hw[hcid][wcid] === '#') count += 1;
                    }
                });
            });
            if(count === k) ret++;
            count = 0;
        }
    }
    console.log(ret);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 32716
#include <iostream>
#include <vector>
#include <map>
#include <functional>
#include <cmath>
#include <algorithm>
#include <iomanip>

using namespace std;

int main(){
    int N, Q;

    cin >> N >> Q;
    vector<vector<int>> nei(N);

    for (size_t i = 0; i < N-1; i++)
    {
        int ai,bi;
        cin >> ai >> bi;
        ai--;
        bi--;
        nei[ai].push_back(bi);
        nei[bi].push_back(ai);        
    }

    vector<long long> pc(N);
    for (size_t i = 0; i < Q; i++)
    {
        int pj,xj;
        cin >> pj >> xj;
        pj--;
        pc[pj]+= xj;
    }

    vector<long long> c(N);
    

    function<int(int,int,int)> dfs = [&](int cur,int par,int pcnt){
        c[cur] = pcnt + pc[cur];
        for (auto n : nei[cur])
        {
            if(n == cur) continue;
            if(n == par) continue;
            dfs(n,cur,c[cur]);
        }
        return 0;
    };

    dfs(0,-1,0);

    for (size_t i = 0; i < N; i++)
    {
        cout << c[i] << " ";
    }

    cout << endl;
    return 0;
}


Measured memory_bytes: 32128
#include <bits/stdc++.h>
using namespace std;
 
int main() {

  int N, K, i;
  cin >> N >> K;
  
  int x, sum=0;
  
  for(i=0;i<N;i++){
    cin >> x;
    if(x > K-x){
      sum += 2*(K-x);}
    else{sum += 2*x;}
  }
  
  cout << sum << endl;
}

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

#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define MODN2 998244353
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)

using namespace std;
typedef long long ll;

int main(){

    int n;
    cin >> n;

    n = n % 10;

    if(n == 0 || n == 1 || n == 6 || n == 8){
        cout << "pon" << endl;
    }else if(n == 3){
        cout << "bon" << endl;
    }else{
        cout << "hon" << endl;
    }

    return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cstdlib>
#include <algorithm>
#define WMAX 10000
#define HMAX 10000

//コメントアウトするとdebug()を実行しない
#define DEBUG

using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef pair<int ,int > P;

int A,B,C,N,W,H,ans,dp[HMAX][WMAX];
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){
	for (int i = 0; i < S.size(); ++i)
	{
		if(S[i] == ','){
			S[i] = ' ';
		}
	}
}

void debug(){

}

void answer(){
	cout << S << "\n";
}

int main(){
	ios::sync_with_stdio(false);
	cin >> S;
	solve();
	#ifdef DEBUG
	debug();
	#endif
	answer();

	return 0;
}

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

int main() {
    int k;
    int a, b;
    cin>>k;
    cin>>a>>b;
    for (int i = a; i<=b; i++) {
        if (i%k==0) {
        cout<<"OK"<<endl;
        return 0;
        }
    }
    cout<<"NG"<<endl;
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

int Digit_Sum(int n){
    int res = 0;
    while(n != 0){
        res += n%10;
        n /= 10;
    }
    return res;
}

int main(){
    int N, A, B; cin >> N >> A >> B;
    int ans = 0;

    for(int i=1; i<=N; i++){
        int check = Digit_Sum(i);
        if(A <= check && check <= B) ans += i;
    }

    cout << ans << endl;
}

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

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main(){
    int k;
    cin >> k;
    string s;
    cin >> s;
    int fin = MIN(k,s.size());
    rep(i,fin){
        cout << s[i];
    }
    int size = s.size();
    if(k < size){
        cout << "..." ;
    }
    cout << endl;

    return 0;
}

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

int main() {
  ll a;
  double b;
  cin >> a >> b;
  b = round(b*100);
  int b100 = b;
  ll ans = (a*b100)/100;
  cout << ans << endl;
}

Measured memory_bytes: 3776
#include <stdio.h>

int main() {
	int W,H,x,y,r;
	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if (x+r<=W && x-r>=0 && y+r<=H && y-r>=0) {
		printf("Yes\n");	
	} else {
		printf("No\n");
	}
	return 0;
}



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

int main() {
  int n;
  cin >> n;
  int j[4];
  for (int i = 0; i < 4; i++) {
    j[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s=="AC") j[0]++;
    if (s=="WA") j[1]++;
    if (s=="TLE") j[2]++;
    if (s=="RE") j[3]++;
  }
  cout << "AC" << " x " << j[0] << endl;
  cout << "WA" << " x " << j[1] << endl;
  cout << "TLE" << " x " << j[2] << endl;
  cout << "RE" << " x " << j[3] << endl;
}

Measured memory_bytes: 3628
#include<stdio.h>

int main(){
	int a,b,c,d;
	scanf("%d %d",&a,&b);
	c=a/b;
	d=a%b;
	double e,f,g;
	f=a;
	g=b;
	e=f/g;
	printf("%d %d %lf\n",c,d,e);
		
    
return 0;	
}

Measured memory_bytes: 2756
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}


int main(){
    int n,m;
    double p;
    cin >>n >>m >>p;

    vector<int> u(m),v(m);
    rep(i,m){
        cin >>u[i] >>v[i];
        --u[i];
        --v[i];
    }

    p /= 100.0;

    vector<double> pw(m+1);
    pw[0] = 1;
    rep(i,m) pw[i+1] = pw[i]*p;

    vector<double> dp(1<<n);
    rep(mask,1<<n){
        dp[mask] = 1;

        int sub = mask;
        while(1){
            sub = (sub-1)&mask;
            if(sub == 0) break;
            if(sub%2!=1) continue;

            int o_mask = mask^sub;

            int ct = 0;
            rep(i,m){
                if(sub>>u[i]&1){
                    if(o_mask>>v[i]&1) ++ct;
                }
                if(sub>>v[i]&1){
                    if(o_mask>>u[i]&1) ++ct;
                }
            }

            dp[mask] -= dp[sub]*pw[ct];
        }
    }

    cout << fixed << setprecision(15) << dp[(1<<n)-1] << endl;
    return 0;
}



Measured memory_bytes: 3408
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

#define LL long long
#define fgx cerr<<"--------------"<<endl;
#define dgx cerr<<"=============="<<endl;

inline int read(){
	int x=0,f=1;char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*f;
}
const int MAXN = 100010;
const int INF = 2147483600;

int N; char s[MAXN+1]; 
int vis[MAXN+1]; int pos[MAXN+1]; int p[MAXN+1];

inline void prt(vector<int> &x){
	cout<<"Prt:";
	for(int i=x.size()-1;i>=0;i--){
		cout<<(char)('a'+x[i]);
	} cout<<endl;
}
inline int Link(int x){ x=p[x]; return pos[(x>N/2?x-N/2:x+N/2)]; }
inline int Cmp(vector<int> &A1,vector<int> &A2){
	int flag=-1;
	int sz1=A1.size(),sz2=A2.size();
	for(int l=1;l<=min(sz1,sz2);l++){
		if(A1[sz1-l]>A2[sz2-l]) {flag=0; break;}
		if(A1[sz1-l]<A2[sz2-l]) {flag=1; break;}
	} return flag;
}vector<int> Ans,Ans2;
inline void Update(int &l1,int &r1,vector<int>& A1,int l2,int r2,vector<int>& A2,bool opr){
	if(!A1.size()){ A1.clear(); for(int l=0;l<(int)A2.size();l++) A1.push_back(A2[l]); l1=l2; r1=r2; return ; } 
	int flag=Cmp(A1,A2);
	if(flag==-1){
		if(opr) flag=1;
		else{
			vector<int> n; n.clear();
			if(A2.size()<A1.size()) fgx;
			for(int i=0;i<A2.size()-A1.size();i++){
				n.push_back(A2[i]);
			} flag=Cmp(Ans,n);
			if(flag) flag=1;
		}
	} 
	if(flag==1){
		l1=l2; r1=r2;
		if(!opr) A1.clear();
		for(int l=0;l<(int)A2.size();l++)	
			A1.push_back(A2[l]);
	} return ;
} 

int main(){
	//freopen("a.in","r",stdin);
	//freopen(".out","w",stdout);
	N=read()*2; scanf("%s",s+1); int nowa=0,nowb=0;
	for(int i=1;i<=N;i++){
		if(s[i]=='a') p[i]=nowa+1,++nowa;
		else p[i]=nowb+N/2+1,++nowb;
		pos[p[i]]=i;
	} int l1=INF,r1=INF,l2=0,r2=0; int tim=0,lastk=0;
	for(int i=N;i>=1;i--){
		int k=Link(i);
		if(k<i) continue;
		vector<int> n;n.clear();
		if(s[i]=='b'){  ++tim;
			int j=i; n.push_back((int)s[i]-'a'); vis[k]=tim;
			while(j<k){
				++j; if(vis[j]==tim) n.push_back(0); int to=Link(j);
				if(s[j]=='b'&&to>j) k=to,vis[to]=tim,n.push_back(1);
			}
		}
		if(k!=lastk&&lastk){
			if(r2>l1) fgx;
			if(r2<l1&&Ans2.size()) Update(l1,r1,Ans,l2,r2,Ans2,1);
			Ans2.clear(); l2=0,r2=0;
		} if(n.size()){
			reverse(n.begin(),n.end());
			Update(l2,r2,Ans2,i,k,n,0);
		} else{
			n.push_back(1); n.push_back(0);
			if(k<l1) Update(l1,r1,Ans,i,k,n,1);
		}lastk=k;
	} 
	if(r2<l1&&Ans2.size()) Update(l1,r1,Ans,l2,r2,Ans2,1);
	for(int i=Ans.size()-1;i>=0;i--) printf("%c",(char)(Ans[i]+'a'));
	return 0;
}




Measured memory_bytes: 384
#include<bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define inlld(x) scanf("%lld", &x)
#define ind(x) scanf("%d", &x)
#define inlld2(x, y) scanf("%lld%lld", &x, &y)
#define inlld3(x, y, z) scanf("%lld%lld%lld", &x, &y, &z)
#define ind2(x, y) scanf("%d%d", &x, &y)
#define ind3(x, y, z) scanf("%d%d%d", &x, &y, &z)

const int N=1e5+5;
const int MOD=1e9+7;

typedef long long ll;
typedef long double ld;

using namespace std;

int n, arr[25][25], dp[(1<<23)];

void prmask(int mask)
{
    for(int a=0; a<n; a++)
        if(mask&(1<<a))printf("1");
        else printf("0");
    printf("\n");
}

int solve(int mask, int i)
{
    if(mask==(1<<n)-1)
        return 1;
    if(dp[mask]!=-1)
        return dp[mask];
    int ret=0;
    for(int a=0; a<n; a++)
        if(arr[i][a] && !((1<<a)&mask))
            ret=(ret+solve(mask+(1<<a), i+1))%MOD;
    // prmask(mask);
    return dp[mask]=ret;
}

int main()
{
    ind(n);
    for(int a=0; a<n; a++)
        for(int b=0; b<n; b++)
            ind(arr[a][b]);
    memset(dp, -1, sizeof(dp));
    printf("%d\n", solve(0, 0));
    return 0;
}

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

long long gcd(long long a,long long b)
{
	long long r=max(abs(a),abs(b));
	long long l=min(abs(a),abs(b));
	if (l==0LL)
	{
		return r;
	}
	return gcd(l,r%l);
}

long long lcm(long long a,long long b)
{
	return abs(a)*abs(b)/gcd(a,b);	
}

int main(int argc, char const *argv[])
{
	long long a,b,c,d;
	cin>>a>>b>>c>>d;
	--a;
	long long ans=b-a;
	ans-=b/c-a/c;
	ans-=b/d-a/d;
	ans+=b/lcm(c,d)-a/lcm(c,d);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args) {
#if DEBUG
        //MyDebugger.MakeTestCase("../TextFile2.txt");
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static List<int>[] bars1;
    static List<int>[] bars2;
    static long[] counts;

    static object process(TextReader input) {
        var s     = input.ReadLine();
        var spl   = s.Split(' ');
        int n     = int.Parse(spl[0]);
        int q     = int.Parse(spl[1]);
        
        counts = new long[n];
        bars1 = new List<int>[n];

        for (int i = 0; i < n; i++) {
            bars1[i] = new List<int>();
        }

        for(int i=0; i<n-1; i++) {
            s = input.ReadLine();
            spl = s.Split(' ');
            int a = int.Parse(spl[0])-1;
            int b = int.Parse(spl[1])-1;
            bars1[a].Add(b);
            bars1[b].Add(a);
        }
        
        for (int i = 0; i < q; i++) {
            s = input.ReadLine();
            spl = s.Split(' ');
            int p = int.Parse(spl[0])-1;
            int x = int.Parse(spl[1]);

            counts[p] += x;
        }

        walk(0, -1);

        var buil = new StringBuilder(1000);
        foreach(var x in counts) {
            buil.Append(x);
            buil.Append(' ');
        }
        return buil.ToString();
    }

    static void walk(int target, int root) {
        foreach (var z in bars1[target]) {
            if (z != root) {
                counts[z] += counts[target];
                walk(z, target);
            }
        }
    }
}

Measured memory_bytes: 73348
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
void fast()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
int main()
{
	fast();
	ll x;
	cin >> x;
	ll* arr = new ll[x];
	for (int i = 0; i < x; i++)
	{
		cin >> arr[i];
	}
	ll z = 0;
	for (int i = 0; i < x - 1; i++)
	{
		if (arr[i] > arr[i + 1])
		{
			z += arr[i] - arr[i + 1];
			arr[i + 1] = arr[i];
		}
	}
	cout << z << endl;
}

Measured memory_bytes: 5164
#include<stdio.h>
typedef long long ll;
const int mod=998244353;
int mul(int a,int b){return a*(ll)b%mod;}
int ad(int a,int b){return(a+b)%mod;}
int pow(int a,int b){
	int s=1;
	while(b){
		if(b&1)s=mul(s,a);
		a=mul(a,a);
		b>>=1;
	}
	return s;
}
int fac[300010],rfac[300010];
int C(int n,int k){return mul(fac[n],mul(rfac[k],rfac[n-k]));}
int main(){
	int n,i,ans;
	ll a,b,k;
	scanf("%d%lld%lld%lld",&n,&a,&b,&k);
	fac[0]=1;
	for(i=1;i<=n;i++)fac[i]=mul(fac[i-1],i);
	rfac[n]=pow(fac[n],mod-2);
	for(i=n;i>0;i--)rfac[i-1]=mul(rfac[i],i);
	ans=0;
	for(i=0;i<=n&&i*a<=k;i++){
		if((k-i*a)%b==0&&(k-i*a)/b<=(ll)n)ans=ad(ans,mul(C(n,i),C(n,(k-i*a)/b)));
	}
	printf("%d",ans);
}

Measured memory_bytes: 2560