akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;
int main(){
int m,f,r;
for(int i=0; i<50; i++){
cin >> m >> f >> r;
if(m==-1 && f==-1 && r==-1)break;
if(m==-1 || f==-1) cout<< "F" <<endl;
else if(m+f>=80) cout << "A" <<endl;
else if(65<=m+f && m+f<80) cout << "B" <<endl;
else if(50<=m+f && m+f<65) cout << "C" <<endl;
else if(r>=50) cout << "C" <<endl;
else if(30<=m+f && m+f<50) cout << "D" <<endl;
else if(m+f<30) cout << "F" <<endl;
}
return 0;
}


Measured memory_bytes: 3100
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if((a[0]==a[1]&&a[1]!=a[2])||(a[0]!=a[1]&&a[1]==a[2]))
        cout<<"Yes\n";
    else
        cout<<"No\n";

}


Measured memory_bytes: 256
def iig(vn, en):
    res = [[] for _ in range(vn)]
    for _ in range(en):
        ai, bi = map(lambda x: int(x) - 1, input().split())
        res[ai].append(bi)
    return res

n, m = map(int, input().split())
v = iig(n, m)

nxtsum = [0] * n
e = [0] * n
for i, adjl in reversed(list(enumerate(v))):
	count = len(adjl)
	if count == 0:
		continue
	nxtsum[i] = sum(e[nxt] for nxt in adjl)
	e[i] = 1 + nxtsum[i] / len(adjl)

v_prob = [0] * n
v_prob[0] = 1
for i, adjl in enumerate(v):
	count = len(adjl)
	for nxt in adjl:
		v_prob[nxt] += v_prob[i] / count

loss_max = 0
for i, adjl in enumerate(v):
	count = len(adjl)
	if count <= 1:
		continue
	for j in adjl:
		loss = e[i] - (1 + (nxtsum[i] - e[j]) / (count - 1))
		loss *= v_prob[i]
		if loss > loss_max:
			loss_max = loss

print(e[0] - loss_max)

Measured memory_bytes: 9460
#include <iostream>
#include <string>

using namespace std;

int main(){
  int N, i, j, ans=0, A=0, B=0, W=0;
  cin >> N;
  string s[N];
  for(i=0; i<N; i++) cin >> s[i];
  for(i=0; i<N; i++){
    for(j=0; j<s[i].size(); j++){
      if(s[i][j] == 'A' && s[i][j+1] == 'B') ans++;
    }
  }
  for(i=0; i<N; i++){
    if(s[i][0] == 'B' && s[i][s[i].size()-1] == 'A') W++;
    else{
      if(s[i][0] == 'B') B++;
      if(s[i][s[i].size()-1] == 'A') A++;
    }
  }
  if(W == N || (A == 0 && B == 0 && W != 0)) ans += W-1;
  else ans += W;
  if(A > B) ans += B;
  else ans += A;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 768
import java.util.Scanner
import scala.collection.Searching._

import scala.annotation.tailrec

class IUnionFind(val size: Int) {

  private case class Node(var parent: Option[Int], var treeSize: Int)

  private val nodes = Array.fill[Node](size)(new Node(None, 1))

  def union(t1: Int, t2: Int): IUnionFind = {
    if (t1 == t2) return this

    val root1 = root(t1)
    val root2 = root(t2)
    if (root1 == root2) return this

    val node1 = nodes(root1)
    val node2 = nodes(root2)

    if (node1.treeSize < node2.treeSize) {
      node1.parent = Some(t2)
      node2.treeSize += node1.treeSize
    } else {
      node2.parent = Some(t1)
      node1.treeSize += node2.treeSize
    }
    this
  }

  def connected(t1: Int, t2: Int): Boolean = t1 == t2 || root(t1) == root(t2)

  @tailrec
  private def root(t: Int): Int = nodes(t).parent match {
    case None => t
    case Some(p) => root(p)
  }
}


object Main {
  def solve(sc: => Scanner): Unit = {
    println((sc.nextInt + sc.nextInt) / 2)
  }

  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)

    solve(sc)
  }
}

Measured memory_bytes: 45036
//
//AtCoder Beginner Contest 139
//B - Power Socket
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <functional>
#include <cassert>

using namespace std;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SIZE(x) (int)(x).size()
#define SIZEL(x) (ll)(x).size()
#define MSG(a) cout << #a << " " << a << endl;

using ll = long long;
using ld = long double;

const double PI = 3.14159265358979323846;

ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }            //最小公倍数

int main()
{
    int a, b;
    cin >> a >> b;

    if (b==1) {
        cout << 0 << endl;
    }else{
        int sk = a;
        int ans = 1;
        while(sk<b){
            ans++;
            sk--;
            sk+=a;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 256
s = int(input())
d = set()

ans = -1
for i in range(1, 10 ** 6 + 1):
    if s in d:
        ans = i
        break
    else:
        d.add(s)
        if s % 2 == 0:
            s //= 2
        else:
            s = 3 * s + 1

print(ans)


Measured memory_bytes: 2940
a, b, x = gets.chomp.split(" ").map(&:to_f)
theta = 0.0
capacity = a*a*b
if (capacity / 2.0) < x then
    theta = Math.atan(2.0 * (capacity-x) / (a*a*a))
else
    theta = Math.atan((a*b*b) / (2.0*x))
end

puts theta * 180.0 / Math::PI

Measured memory_bytes: 1916
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    void run() {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            long index = scan.nextLong();
            a[i] = index;
        }
        Arrays.sort(a);
        long max = 0;
        for (int i = n - 1; i > 0; i--) {
            if (a[i] == a[i - 1]) {
                if (max == 0) {
                    max = a[i];
                    i--;
                } else {
                    System.out.println(max * a[i]);
                    return;
                }
            }
        }
        System.out.println(0);
    }
    public static void main(String[] args) {
        new Main().run();
    }
}


Measured memory_bytes: 49256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>

using namespace std;

int main()
{
    long long n,i=0,sum=0,s=0;
    scanf("%lld",&n);
    long long a[n];
    for(i=0;i<n;i++)
    {
    	scanf("%lld",&a[i]);
    	if(a[i]<0)
    	sum++;
	}
	for(i=0;i<n;i++)
		{
			if(a[i]<0)
		{
			a[i]=-a[i];
		}
		s=s+a[i];
	}
	sort(a,a+n);
	if(sum%2==0)
	{
		printf("%lld",s);
	}
	else
	{
		s=s-2*a[0];
		printf("%lld",s);
	}
	
    return 0;
}

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

int main() {
	int a, b;
	cin>>a>>b;
	if(a>b) cout<<"a > b" <<'\n';
	if(a<b) cout<<"a < b" <<'\n';
	if(a==b) cout<<"a == b" <<'\n';
	return 0;
}


Measured memory_bytes: 3100
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    n,m=map(int,input().split())
    AB=[]
    for i in range(m):
        a,b=map(int,input().split())
        AB.append(a)
        AB.append(b)
    abc=list(Counter(AB).values())
    print("YES" if all(x%2==0 for x in abc) else "NO")


if __name__=='__main__':
    main()

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

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

	int in_cnt[100005];
	vector<int> v[100005];

	for (int i = 0;i < n+m-1;i++){
		int a,b; cin >> a >> b;
		in_cnt[b]++;
		v[a].push_back(b);
	}

	queue<int> que;

	for (int i = 1;i <= n;i++){
		if(in_cnt[i] == 0) que.push(i);
	}

	int ans[100005]; memset(ans, 0, n);

	while(que.size()){
		int now = que.front(); que.pop();
		for (int i = 0;i < v[now].size();i++){
			int to = v[now][i];
			in_cnt[to]--;
			if(in_cnt[to] == 0){
				ans[to] = now;
				que.push(to);
			}
		}
	}

	for (int i = 1;i <= n;i++){
		cout << ans[i] << endl;
	}

	return 0;

}


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


#define f(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define char_f(i,a) for(int i=(int)(a);(char)s[i]!='\0';i++)
#define rf(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define llf(i,a,b) for(long long int i=(long long int)(a);i<=(long long int)(b);i++)
#define llrf(i,a,b) for(long long int i=(long long int)(a);i>=(long long int)(b);i--)



#define ll long long
#define fi first
#define se second
#define pb push_back
#define pop pop_back
#define mem(ara) memset((ara),0,sizeof(ara))
#define memn(ara) memset((ara),-1,sizeof(ara))
#define bb begin()
#define ee end()
#define em emplace
#define eb emplace_back





#define si set<int>
#define sd set<double>
#define sll set<long long int>
#define ss set<string>
#define sc set<char>

#define pii pair<int,int>
#define pli pair<long long int,int>
#define pil pair<int,long long int>
#define pll pair<long long int,long long int>
#define pci pair<char,int>
#define pic pair<int,char>
#define pcl pair<char,long long int>
#define plc pair<long long int,char>

#define pss pair<string,string>
#define pcc pair<char,char>

#define pis pair<int,string>
#define psi pair<string,int>
#define pls pair<long long int,string>
#define psl pair<string,long long int>
#define pdd pair<double,double>
#define pcs pair<char,string>
#define psc pair<string,char>



#define vi  vector<int>
#define vll vector<long long int>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vii vector<pii>



#define mod 1000000007
#define mx (1<<30)-1
#define llmx (1ll<<62)
#define n_size 100005
#define g_size 10000005
double PI=acos(-1);



///unsigned int uMAX=4294967295;
///unsigned ll int ullMAX=18446744073709551615;





int arr[g_size];



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

	int n,m,T,res;

	int maxi=-mx,mini=mx,count=0,sum;

	int i,j,k;

	bool flag;

	string s1,s2;

	char s[100000];

	int ara[n_size],ara2[n_size];

	cin>>n;

	f(i,0,n-1){
	    cin>>m;

	    arr[m]++;

	}

	f(i,1,n_size-1){
        sum=arr[i-1]+arr[i]+arr[i+1];

        maxi=max(maxi,sum);

	}

	cout<<maxi<<endl;

}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, c, k;
  cin >> n >> c >> k;
  vector<int> t(n);
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  sort(t.begin(), t.end());
  int ans = 1;
  for (int i = 1, beg = t[0], num = 1; i < n; i++) {
    if (t[i] - beg <= k && num < c) {
      num++;
    } else {
      ans++;
      beg = t[i];
      num = 1;
    }
  }
  cout << ans << '\n';
  return 0;
}

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

int main()
{
  string s, t;
  cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  reverse(t.begin(), t.end());
  
  
  
  cout << (s < t ? "Yes" : "No") << endl;

  return 0;
}

Measured memory_bytes: 3612
package main

import "fmt"

var (
	N, W   int
	ws, vs []int
)

const (
	MAXV = 100010
	INF  = 1 << 60
)

func main() {
	fmt.Scan(&N, &W)
	ws = make([]int, N)
	vs = make([]int, N)
	for i := range ws {
		fmt.Scan(&ws[i], &vs[i])
	}
	dp := make([][]int, N+1)
	for i := range dp {
		dp[i] = make([]int, MAXV)
		for j := range dp[i] {
			dp[i][j] = INF
		}
	}
	dp[0][0] = 0
	for i := range ws {
		for v := 0; v < MAXV; v++ {
			if v-vs[i] >= 0 {
				chmin(&dp[i+1][v], dp[i][v-vs[i]]+ws[i])
			}
			chmin(&dp[i+1][v], dp[i][v])
		}
	}
	ans := 0
	for v := 0; v < MAXV; v++ {
		if dp[N][v] <= W {
			ans = v
		}
	}
	fmt.Println(ans)
}

func chmin(a *int, b int) {
	if *a > b {
		*a = b
	}
}
func chmax(a *int, b int) {
	if *a < b {
		*a = b
	}
}


Measured memory_bytes: 82304
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=100000+100;
const db pi=acos(-1.0);
#define lowbit(x) ((x)&(-x))
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u],v=sq[i].to;i;i=sq[i].nxt,v=sq[i].to)
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
#define maxd 998244353
#define eps 1e-8
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

inline ll readll()
{
    ll x=0;int f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int n;
multiset<int> s;
multiset<int>::iterator it;

int main()
{
    n=read();
    rep(i,1,n) {int x=read();s.insert(x);}
    int ans=0;
    while (!s.empty())
    {
        int x=*s.rbegin();it=s.end();it--;
        s.erase(it);
        int lim=1;
        while (lim<=x) lim<<=1;
        it=s.lower_bound(lim-x);
        if ((it!=s.end()) && ((*it)+x==lim)) 
        {
            s.erase(it);ans++;
        }
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 13140
#include <stdio.h>

int main(void){

	int a,b;

    scanf("%d %d", &a, &b);

    if(a < b){
    	printf("a < b\n");
    }else if(b < a){
    	printf("a > b\n");
    }else{
    	printf("a == b\n");
    }

    return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    int combo = 0;

    cin >> n;

    vector<pair<int, int>> d(n);

    for (int i = 0; i < n; i++) {
        cin >> d[i].first >> d[i].second;

        if (d[i].first == d[i].second) combo++;
        else combo = 0;

        if (combo == 3) {
            cout << "Yes" << endl;
            
            return 0;
        }
    }

    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3132
#include"bits/stdc++.h"
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
	int a, b;
  	cin >> a >> b;
  	if(a%2 == b%2) {
    	cout << (a+b)/2 << endl;
      	return;
    }
  	cout << "IMPOSSIBLE" << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

Measured memory_bytes: 256
#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 all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	int ans = inf;
	for (int i = 0; i <= 200000; i += 2) {
		int now = i * c;
		int res = i / 2;
		int tmpx = x - res, tmpy = y - res;
		now += max(0, tmpx) * a;
		now += max(0, tmpy) * b;
		ans = min(ans, now);
	}
	cout << ans << endl;
	return 0;
}


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


int main() {
    int N;
    cin >> N;
    vector<int> R(N);
    rep(i, N) {
        cin >> R[i];
    }
    int maxv = -1001001000;
    int minv = R[0];

    xrep(i, 1, N) {
        maxv = max(maxv, R[i]-minv);
        minv = min(minv, R[i]);
    }

    cout << maxv << endl;
    return 0;
}


Measured memory_bytes: 3620
from sys import exit

N = int(input())
A = sorted([int(n) for n in input().split()], key=lambda x:abs(x))
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()
minus = False
for i in range(N):
    if(A[i] < 0):
        minus = not minus
        A[i]*=-1
# print(A)
if(minus):
    print(sum(A) - A[0]*2)
else:
    print(sum(A))


Measured memory_bytes: 14412
#include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<ctime>

#define ld  long double
#define ll  long long int
#define ull unsigned long long int
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,s,n) for(int i=s;i<n;i++)

const int    INF = 1e11;
const double EPS = 1e-11;

//切り上げ整数除算
int divRoundUp(const int& a, const int& b) { return (a + b - 1) / b; }
//四捨五入
int roundOff(const double& a) { return (int)(a + 0.5); }
// r の(誤差付きの)符号に従って, -1, 0, 1 を返す.
int sgn(const ld& r) { return (r > EPS) - (r < -EPS); }
// a, b の(誤差付きの)大小比較の結果に従って, -1, 0, 1 を返す.
int sgn(const ld& a, const ld& b) { return sgn(a - b); }

using namespace std;

inline void Main() {
	int n, k; cin >> n >> k;
	string s; cin >> s;
	s[k - 1] += 32;
	cout << s << endl;
}

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

	Main();

	return 0;
}

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

using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1LL<<60;

ll N;
ll a[1111], b[1111];

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

  ll n = 1;
  ll x = 1, y = 1;
  for (int i = 0; i < N; i++) {
    if (i > 0) {
      n = max((a[i - 1] * n + a[i] - 1) / a[i], (b[i - 1] * n + b[i] - 1) / b[i]);
    }
    x = a[i] * n;
    y = b[i] * n;
  }
  cout << x + y << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <bitset>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repm(i, a, n) for (int i = a; i >= n; i--)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vs vector<string>
#define vii vector<vector<int>>
#define vll vector<ll>
#define vllll vector<vector<ll>>
#define vd vector<double>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define reverse_v(a) reverse(a.begin(), a.end())
#define fi first
#define se second

void print(bool c)
{
    (c) ? (cout << "Yes" << endl) : (cout << "No" << endl);
}

void Print(bool c)
{
    (c) ? (cout << "YES" << endl) : (cout << "NO" << endl);
}

//最小公倍数
template <typename T>
T gcd(T a, T b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

//最大公約数
template <typename T>
T lcm(T a, T b)
{
    return a * b / gcd(a, b);
}
//セカンドキー->ファーストキーの順ソート
bool cmp(const pii &a, const pii &b)
{
    if (a.second != b.second)
        return a.second < b.second;
    return a.first < b.first;
}

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int eve(int x)
{
    if (x % 400 == 0)
        return 1;
    if (x % 100 == 0)
        return 0;
    if (x % 4 == 0)
        return 1;
    return 0;
}

int main(void)
{
    ll n, p, ans = 1;
    cin >> n >> p;

    if (n == 1)
        return cout << p << endl, 0;
    rep(i, 2, sqrt(p) + 1)
    {
        ll cnt = 0;
        while (p % i == 0)
        {
            if (p == 0)
                break;
            p /= i;
            cnt++;
        }
        //cout << i << " " << cnt << endl;
        ans *= pow(i, floor(cnt / n));
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int A,B,C,X,Y;
  cin >> A >> B >> C >> X >> Y;
  
  int cost = 0;
  if(X<Y){
    int cost1 = A*X +B*X;
    int cost2 = C*2*X;
    
    cost = min(cost1,cost2);
    int rest = Y-X;
    cost1 = rest * B;
    cost2 = rest * 2 * C;
    cost += min(cost1,cost2);
  } else {
    int cost1 = A*Y +B*Y;
    int cost2 = C*2*Y;
    
    cost = min(cost1,cost2);
    int rest = X-Y;
    cost1 = rest * A;
    cost2 = rest * 2 * C;
    cost += min(cost1,cost2);
  }
  
  cout << cost << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

ll inf = 1e15;
ll mod = 1e9 + 7;

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

    ll n, q;
    cin >> n >> q;
    ll a, b;
    vvll g(n);
    REP(i, n - 1){
        cin >> a >> b;
        a--;
        b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vll w(n), res(n);
    ll p, x;
    while(q){
        cin >> p >> x;
        w[p - 1] += x;
        q--;
    }
    vll used(n);
    queue<ll> que;
    que.push(0);
    used[0] = 1;
    res[0] = w[0];
    while(!que.empty()){
        ll cur = que.front();
        que.pop();
        for(auto v : g[cur]){
            if(used[v]) continue;
            used[v] = 1;
            que.push(v);
            w[v] += w[cur];
            res[v] = w[v];
        }
    }
    REP(i, n){
        cout << res[i] << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 21104
#include<iostream>
#include<algorithm>
#define int long long
using namespace std;

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

    cin >> arr[i];
}
sort(arr,arr+n);
int ans=0;
ans+=arr[n-1];
int remain=n-2;
int cnt=0;
int j=2;
for(int i=1; i<=remain; i++)
{ if(cnt==2)
{ cnt=0;
j++;
}
ans+=arr[n-j];
cnt++;
}
cout << ans << endl;

    }























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

using namespace std;

#define F first
#define S second
#define modulo ll (1e9 + 7)
const long double PI = 3.141592653589793238L;

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

void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
//    freopen("in.in", "r", stdin);
//    freopen("out.out", "w", stdout);
}

const int N = 1e5 + 9, M = 2e5 + 9, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;


int main(){
    init();

    int k, a, b;    cin >> k >> a >> b;

    int mults = b / k - (a - 1) / k;

    if(mults)   cout << "OK";
    else cout << "NG";
}

Measured memory_bytes: 3612
H, W = map(int, input().split())
T = [[] for i in range(H)]
for i in range(H):
    a = list(input())
    T[i] = a

S = [[-1] * W for i in range(H)]

rec = 0
ans = [[0] * (H * W + 5) for i in range(2)]
for i in range(H):
    for j in range(W):
        if T[i][j] == "#" and S[i][j] == -1:
            rec += 1
            S[i][j] = rec
            ans[1][rec] += 1
            pre = "#"
            que = [(i, j, pre)]
            while que:
                x, y, pre = que.pop()
                for dx, dy in [(0, 1), (1, 0), (-1, 0), (0, -1)]:
                    nx, ny = x + dx, y + dy
                    if pre == "#":
                        if 0 <= nx < H and 0 <= ny < W and S[nx][ny] == -1 and T[nx][ny] == ".":
                            S[nx][ny] = rec
                            ans[0][rec] += 1
                            que.append((nx, ny, "."))
                    else:
                        if 0 <= nx < H and 0 <= ny < W and S[nx][ny] == -1 and T[nx][ny] == "#":
                            S[nx][ny] = rec
                            ans[1][rec] += 1
                            que.append((nx, ny, "#"))


num1 = 0
for i in range(H * W + 5):
    num1 += ans[0][i] * ans[1][i]

print(num1)

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

int main(){
  int N,ans = 0;
  string S;
  bool CharLeft,CharRight;
  cin >> N >> S;
  for (int i = 0; i < N; i++){
    int count = 0;
    for (char c = 'a'; c <= 'z'; c++){
      CharLeft = false;
      CharRight = false;
      for (int j = 0; j < i; j++){
        if (S.at(j) == c){
          CharLeft = true;
        }
      }
      for (int j = i; j < N; j++){
        if (S.at(j) == c){
          CharRight = true;
        }
      }
      if (CharLeft && CharRight){
        count++;
      }
    }
    ans = max(count,ans);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <deque>
#include <queue>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <iomanip>
#include <utility>
#include <functional>
using namespace std;
//orz jzm
#define ll long long
#define ull unsigned ll
const ll PR=19260817;
int main() {
	int x;
	cin>>x;
	int i=1, s=0;
	while (s<x) s+=i, i++;
	cout<<i-1<<endl;
	return 0;
}

Measured memory_bytes: 256
n, k = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
INF = 10 ** 9

ans = INF
for li in range(n - k + 1):
    ri = k + li - 1
    t = min(abs(x[li]) + abs(x[ri] - x[li]), abs(x[ri]) + abs(x[li] - x[ri]))
    ans = min(t, ans)

print(ans)

Measured memory_bytes: 14224
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#define MOD 1000000007
using namespace std;

int main()
{
	int n;
	cin >> n;
	long long int ans;
	ans = 1;
	int i;
	for (i = 0; i < n; i++){
		ans = ans*(i + 1) % MOD;
	}
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;

int main() {
  string s;
  cin >> s;
  int n = s.length();

  for (int i = 1; i < n+1; i++) {
    if(i%2==0 && s[i-1] == 'R'){
      cout << "No" << endl;
      return 0;
    }
    if(i%2!=0 && s[i-1] == 'L'){
      cout << "No" << endl;
      return 0;
    }

  }
  cout << "Yes" << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define MAX 132000
#define ll long long
#define pi pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fr first
#define sd second
#define vp vector<pi>
inline int read()
{
	int x=0;bool t=false;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')t=true,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return t?-x:x;
}
struct Line{int v,next,w;}e[MAX];
int h[MAX],cnt=1;
inline void Add(int u,int v,int w){e[cnt]=(Line){v,h[u],w};h[u]=cnt++;}
int n;ll mid,mn[MAX];
vp f[MAX];
bool cmpx(pi a,pi b){return a.fr<b.fr;}
bool cmpy(pi a,pi b){return a.sd<b.sd;}
void Merge(vp &u,vp ls,vp rs)
{
	if(ls.size()>rs.size())swap(ls,rs);
	int t1=ls.size(),t2=rs.size();
	if(!t1||!t2)return;
	sort(ls.begin(),ls.end(),cmpy);
	sort(rs.begin(),rs.end(),cmpx);
	mn[0]=rs[0].sd;for(int i=1;i<t2;++i)mn[i]=min(mn[i-1],rs[i].sd);
	for(int i=0,j=t2-1;i<t1;++i)
	{
		while(j>=0&&ls[i].sd+rs[j].fr>mid)--j;
		if(j>=0)u.pb(mp(ls[i].fr,mn[j]));
	}
	sort(ls.begin(),ls.end(),cmpx);
	sort(rs.begin(),rs.end(),cmpy);
	mn[0]=rs[0].fr;for(int i=1;i<t2;++i)mn[i]=min(mn[i-1],rs[i].fr);
	for(int i=0,j=t2-1;i<t1;++i)
	{
		while(j>=0&&ls[i].fr+rs[j].sd>mid)--j;
		if(j>=0)u.pb(mp(mn[j],ls[i].sd));
	}
}
void dfs(int u)
{
	f[u].clear();if(!h[u]){f[u].pb(mp(0,0));return;}
	for(int i=h[u];i;i=e[i].next)dfs(e[i].v);
	for(int i=h[u];i;i=e[i].next)
		for(int j=0,l=f[e[i].v].size();j<l;++j)
			f[e[i].v][j].fr+=e[i].w,f[e[i].v][j].sd+=e[i].w;
	if(h[u])Merge(f[u],f[e[h[u]].v],f[e[e[h[u]].next].v]);
}
int main()
{
	n=read();
	for(int i=2,a,v;i<=n;++i)a=read(),v=read(),Add(a,i,v);
	ll l=0,r=1e9,ret=1e9;
	while(l<=r)
	{
		mid=(l+r)>>1;dfs(1);
		if(f[1].empty())l=mid+1;
		else ret=mid,r=mid-1;
	}
	cout<<ret<<endl;
	return 0;
}


Measured memory_bytes: 28640
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    ll a,b; cin>>a>>b;
    cout << a*b << '\n';
    return 0;
}

Measured memory_bytes: 3600
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int T = (int) Math.ceil(c / (b * 1.0));
        int A = (int) Math.ceil(a / (d * 1.0));
        if (T <= A) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 35800
#include <iostream>
#include <vector>

int insertionSort(int* a, const int n, const int g) {
    int cnt{};
    for(auto i=0; i<n; i++) {
        int v{a[i]}, j{i-g};
        while(j>=0 && a[j]>v) {
            a[j+g] = a[j];
            j= j-g;
            cnt++;
        }
        a[j+g] = v;
    }
    return cnt;
}

void shellSort(int* a, const int n) {
    std::vector<int> g{};
    int h{};
    while(h<n/3) {
        h = 3*h+1;
        g.push_back(h);
    }
    if(!g.size()) g.push_back(1);
    const size_t m{g.size()};
    std::cout << m << std::endl;
    for(auto i=m; i>0; i--) std::cout << g[i-1] << ((i>1) ? " " : "\n");
    int cnt{};
    for(auto i=m; i>0; i--) {
        cnt += insertionSort(a, n, g[i-1]);
    }
    std::cout << cnt << std::endl;
}

int main() {
    int n{}; std::cin >> n;
    int a[n]{}; for(auto i=0; i<n; i++) std::cin >> a[i];
    shellSort(a, n);
    for(auto i=0; i<n; i++) {
        std::cout << a[i] << std::endl;
    }
}



Measured memory_bytes: 7076
N=int(input())
AC=0;WA=0;TLE=0;RE=0

for i in range(N):
    S=str(input())
    if S=='AC':
        AC += 1
    if S=='WA':
        WA += 1
    if S=='TLE':
        TLE += 1
    if S=='RE':
        RE += 1

print('AC x',AC)
print('WA x',WA)
print('TLE x',TLE)
print('RE x',RE)


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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }
template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	os << v[0];
	for (int i = 1; i < v.size(); i++) os << " " << v[i];
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u; return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	ll N, K; cin >> N >> K;
	vll V(N); cin >> V;

	ll maxv = 0;	
	for (int A = 1; A <= min(K, N); A++) {
		int B = K-A;
		for (int l = 0; l <= A; l++) {
			int r = A-l;
			vll dats;
			for (int i = 0; i < l; i++) dats.push_back(V[i]);
			for (int i = N-1; i >= N-r; i--) dats.push_back(V[i]);
			sort(begin(dats), end(dats));
			ll up = 0;
			for (int i = 0; i < B && i < dats.size(); i++) {
				if (dats[i] < 0) up += -dats[i];
			}
			chmax(maxv, accumulate(begin(dats), end(dats), 0ll) + up);
		}
	}
	cout << maxv << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>

using namespace std;

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

    vector<int> count(26, 0);
    for (int i = 0; i < w.length(); i++) count[w[i] - 'a']++;

    bool even = true;
    for (int i = 0; i < 26; i++) {
        if (count[i] % 2 == 1) {
            even = false;
            break;
        }
    }

    cout << (even ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
import math

a, b, x = map(int, input().split())

if a * a * b / 2 <= x:
    p = 2 * x / (a ** 2) - b
    tanx = (b - p) / a
else:
    p = a - 2 * x / a / b
    tanx = b / (a - p)

print(math.degrees(math.atan(tanx)))


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

int main(){
    int r;
    cin >> r;
    if(r<1200){
        cout << "ABC" << endl;
    }else if(r<2800){
        cout << "ARC" << endl;
    }else{
        cout << "AGC" << endl;
    }
}

Measured memory_bytes: 3540
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define eb(k,v) emplace_back(k,v)
#define ct(res) cout << res << "\n";
#define vi vector<int>
#define vl vector<ll>
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const ll MOD = 1000000007;

int main() {
    int a,b;cin>>a>>b;
    int s = a*b;
    int l = 2*a+2*b;
    cout << s << " " << l << "\n"; 
}



Measured memory_bytes: 3096
n,*a=map(int,open(0).read().split())

left=a[0]
right=sum(a)-a[0]
ans=abs(left-right)
for i in range(1,n-1):
    left+=a[i]
    right-=a[i]

    ans=min(ans,abs(left-right))

print(ans)
    

Measured memory_bytes: 103312
#include<iostream>
using namespace std;
int main(){

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

if(power>=h){
    cout<<"Yes"<<endl;
}
else{
    cout<<"No"<<endl;
}


return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define ios ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0)
#define so sizeof
#define pb push_back
#define cl clear() ;
#define vl vector<ll>
#define sz size()
#define len length()
#define emp empty()
#define el endl;cout.flush()
#define be begin()
#define fi first
#define se second
#define br break
#define en end()
#define ro return 0
#define eb emplace_back
#define con continue
#define ms(x) memset(x , 0, so x)
#define all(x) (x).be , (x).en
#define acc(x) accumulate((x).be , (x).en , 0ll)
#define forn(i,a,b) for(ll i=a;i<=b;++i)
#define rng_58 mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define plll pair<ll,pair<ll,ll>>
#define plvl pair<pair<ll,ll> ,ll>
#define mp make_pair
#define trace3(a,b,c) cerr <<"a is " << a << " b is " << b << " c is " << c << el;
#define trace4(a,b,c,d) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << el ;
#define trace5(a,b,c,d,e) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << el;
#define trace6(a,b,c,d,e,f) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << " f is " << f << el ;
int main()
{
    ios;
    ll flag = -1 ;
    pll prev = {0 , 0 } ;
    ll prevtime = 0 ;
    ll n ;
    cin >> n ;
    forn(i , 1 , n ) {
       ll xi , yi , ti;
       cin >> ti >> xi >> yi ;
       pll curr = {xi , yi} ;
       ll dis = abs(curr.fi - prev.fi ) + abs(curr.se - prev.se) ;
       if(dis > (ti - prevtime)){
        ++flag;
       }
       else {
        if(dis == (ti - prevtime)){
            prev = curr ;
            prevtime = ti ;
            con ;
        }
        else if(dis < (ti - prevtime)){
            ll rem = ti - prevtime - dis ;
            if(rem % 2 == 0 ){
                con ;
            }
            else {
                ++flag ;
            }
        }
       }
    }
    if(flag != -1){
        cout << "No\n" ;
        ro;
    }
    else {
        cout << "Yes\n" ;
        ro ;
    }
    ro ;
}































Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int a,maxx,h;
char s1;
int main()
{
    cin>>a;
    for(int i=0;i<a;i++)
    {
        cin>>s1;
        if(s1=='I')maxx++;
        else
        maxx--;
        h=max(h,maxx);
    }
    cout<<h<<endl;
    return 0;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



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

	double T, X; cin >> T >> X;
	double ans = T / X;
	cout << fixed << setprecision(10) << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
	long long int a[3];
	for(int i=0;i<3;i++){
		cin>>a[i];
	}
	if(a[0]%2==0||a[1]%2==0||a[2]%2==0)  //有一个是偶数 
		cout<<0;
	else{//全是奇数 
		sort(a,a+3);
		cout<<a[0]*a[1];
	}
	return 0;
} 

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

using namespace std;

int main(){
  int h,w; cin >> h >> w;
  int c[10][10];
  for(int i = 0; i < 10; i++){
    for(int j = 0; j < 10; j++){
      cin >> c[i][j];
    }
  }
  vector< vector<int> > a;
  for(int i = 0 ; i < h ; i++){
    vector<int> v;
    a.push_back(v);
    for(int j = 0; j < w ; j++){
      int tmp;
      cin >> tmp;
      a[i].push_back(tmp);
    }
  }
  for(int k = 0; k < 10; k++){
    for(int i = 0; i < 10 ; i++){
      for(int j = 0; j < 10 ; j++){
        if(c[i][j] > c[i][k] + c[k][j]) c[i][j] = c[i][k] + c[k][j];
      }
    }
  }
  int ans = 0;
  for(int i = 0; i < h ; i++){
    for(int j = 0; j < w; j++){
      if(a[i][j] != -1) ans += c[a[i][j]][1];
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007

#define access(i) a[i/3][i%3]

 int gcd(int a,int b){

   if(a%b == 0)
    return b;
   else
    return gcd(b,a%b);
 }

 long long numbers[500005];


 int main(){

 int a[3][3];
  int n,b;

  bool flag = 0;

  for(int i=0;i<9;i++){
        cin>>access(i);
  }

 long long Q; cin>>Q;

 while(Q--)
 {

  long long x;
   cin>>x;

   for(int j=0;j<9;j++){
     if(access(j) == x)
        access(j) = 0;
   }
 }

 for(int i=0;i<3;i++){

    if(a[i][0] == 0 && a[i][1] == 0 && a[i][2] == 0)
        flag = true;

    if(a[0][i] == 0 && a[1][i] == 0 && a[2][i] == 0)
        flag = true;
 }

 if(a[0][0] == 0 && a[1][1] == 0 && a[2][2] == 0)
    flag = true;
 if(a[0][2] == 0 && a[1][1] == 0 && a[2][0] == 0)
    flag = true;

 if(flag)
    cout<<"Yes"<<endl;
 else
    cout<<"No"<<endl;

 return 0;
 }


Measured memory_bytes: 3632
#include<stdio.h>
int main(void)
{
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if(a<c){
    if(b>c){
      printf("Yes");
    }else{
      printf("No");
    }
  }else if(a>c){
      if(b<c){
        printf("Yes");
      }else{
        printf("No");
      }
  }
  return 0;
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define log_2(a) (log((a)) / log(2))
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int L, R;
    cin >> L >> R;
    if(R - L >= 2019) {
        cout << 0 << endl;
    } else {
        LL res = INF;
        for(LL i = L; i <= R; ++i) {
            for(LL j = L; j <= R; ++j) {
                if(i == j) continue;
                res = min(res, i * j % 2019);
            }
        }
        cout << res << endl;
    }
    return 0;
}



Measured memory_bytes: 3584
N, P = map(int, input().split())

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

Measured memory_bytes: 9428
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <numeric>

using namespace std;
int d[110];
int k[110];

int main(){
   int n,y;
   cin>>n>>y;
   for(int i=0;i<=y/1000;i++){
      int yy=y-1000*i;
      for(int j=0;j<=yy/5000;j++){
         int yyy=yy-5000*j;
         int k=n-i-j;
         if(yyy==10000*k){
            cout<<k<<" "<<j<<" "<<i<<endl;
            return 0;
         }
      }
   }
   cout<<-1<<" "<<-1<<" "<<-1<<endl;
   

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define INF (INT32_MAX / 2)
using namespace std;

constexpr int maxn = 1e5 + 1;
int v[1001];
int w[maxn];
int dp[maxn];

int main()
{
    fill(dp + 1, dp + maxn, INF);
    int n, W, i, sum = 0;
    cin >> n >> W;
    for (i = 1; i <= n; i++)
    {
        cin >> w[i] >> v[i];
        sum += v[i];
    }
    
    for ( i = 1; i <= n; i++)
        for (int j = sum; j >= 0; j--)
            if (dp[j] < W)
                dp[j + v[i]] = min(dp[j + v[i]], dp[j] + w[i]);

    for (i = sum; i >= 0; i--)
        if (dp[i] <= W)
            break;
 
    cout << i << "\n";
}

Measured memory_bytes: 640
#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<cmath>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  int i,j;
  int n,m;
  while(cin>>n>>m,n||m){
    int a[20];
    for(i=0;i<m;++i)
      cin>>a[i];
    int kd=n;
    long long sm=(long long)n*(n+1)/2;
    for(i=1;i<(1<<m);++i){
      int b=1;
      int ct=0;
      for(j=0;j<m;++j){
	if(i&(1<<j)){
	  b*=a[j]/__gcd(a[j],b);
	  ++ct;
	}
      }
      if(ct%2){
	kd-=n/b;
	sm-=(long long)(n/b)*(n/b+1)/2*b;
      }else{
	kd+=n/b;
	sm+=(long long)(n/b)*(n/b+1)/2*b;
      }
    }
    if(kd)
      printf("%.10lf\n",(double)sm/kd);
    else
      puts("0.0000000000");
  }
  return 0;
}

Measured memory_bytes: 0
using System;
using System.Linq;

namespace CSharp
{
    class Program
    {
        static void Main()
        {
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var N = input[0];
            var Q = input[1];

            var S = Console.ReadLine();

            var lr = new int[Q][];
            for (int i = 0; i < Q; i++)
            {
                lr[i] = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            }

            var t = new int[N + 1];
            for (int i = 1; i < N; i++)
            {
                if (S[i - 1] == 'A' && S[i] == 'C')
                {
                    t[i + 1] = t[i] + 1;
                }
                else
                {
                    t[i + 1] = t[i];
                }
            }

            for (int i = 0; i < Q; i++)
            {
                Console.WriteLine(t[lr[i][1]] - t[lr[i][0]]);
            }
        }
    }
}


Measured memory_bytes: 25268