akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main() {
	int A, B, C, D, E, F;
	bool dp[30];
	cin >> A >> B >> C >> D >> E >> F;
	for(int i = 0; i < 30; i++) {
		dp[i] = false;
	}
	double d = 0;
	int water = 0, sugar = 0;
	int WATER = 0, SUGAR = 0;
	for(int w = 0; w < 30; w++) {
		for(int x = 0; x < 30; x++) {
			water = A * w + B * x;
			if(water > 30) break;
			if(w + x == 0 || dp[water]) continue;
			for(int y = 0; 1; y++) {
				if( water * 100 + C * y > 3000) break;
				for(int z = 0; 1; z++) {
					sugar = C * y + D * z;
					if(100 * water + sugar > F) break;
					double value = (double)(sugar) / (double)(water);
					if( value <= E && value > d) {
						d = value;
						WATER = water, SUGAR = sugar;
					}
					dp[w * A + x * B] = true;
				}
			}
		}
	}
	if(WATER == 0) WATER = A;
	cout << (WATER * 100 + SUGAR) << " " << SUGAR << endl;
	return 0;
}

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

using namespace std;

int main()
{
    int n,x;

    while(cin>>n>>x&&!(!n&&!x))
    {
        int ans=0;
        for(int i=1;i<n-1;i++)
        {
            for(int j=i+1;j<n;j++)
            {
                for(int k=j+1;k<=n;k++)
                {
                    if(i+j+k==x)
                    {
                        ans++;
                    }
                }
            }
        }
        cout<<ans<<endl;

    }



    return 0;
}



Measured memory_bytes: 3096
n=int(input())
p=list(map(int, input().split()))
ans=0
for i in range(1,n-1):
    if p[i-1]<p[i] and p[i]<p[i+1]:
        ans+=1
    elif p[i-1]>p[i] and p[i]>p[i+1]:
        ans+=1
print(ans)

Measured memory_bytes: 3064
a,b=map(int, input().split())
c,d=map(int, input().split())    
e = int(input())
if d-b>=0 :
    print('NO')
elif b-d>0:
    if c-a>0:
      if e*(b-d)>=(c-a):
        print('YES')
      else:
        print('NO')
    elif a-c>0:
      if e*(b-d)>=(a-c):
        print('YES')
      else:
        print('NO')

Measured memory_bytes: 9196
package main

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

type S []string

func (s *S) Pop2() (int, int) {
	return s.Pop(), s.Pop()
}

func (s *S) Pop() int {
	l := len(*s) - 1

	p := (*s)[l]

	n, err := strconv.Atoi(p)
	if err != nil {
		panic(err)
	}

	*s = (*s)[0:l]
	return n
}

func (s *S) Push(tok int) {
	(*s) = append((*s), strconv.Itoa(tok))
}

func scan() []string {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	return strings.Split(sc.Text(), " ")
}

func main() {
	expr := scan()

	stack := make(S, 0, len(expr))

	for _, t := range expr {
		switch t {
		case "+":
			n1, n2 := stack.Pop2()
			stack.Push(n1 + n2)
		case "-":
			n1, n2 := stack.Pop2()
			stack.Push(n2 - n1)
		case "*":
			n1, n2 := stack.Pop2()
			stack.Push(n1 * n2)
		default:
			n, err := strconv.Atoi(t)
			if err != nil {
				panic(err)
			}
			stack.Push(n)
		}
	}

	fmt.Println(stack.Pop())
}


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

struct student{
	int a;
	int b;
}v[1000000];

int cmp(student l,student r){
	if(l.b==r.b){
		return l.a<r.a;
	}
	return l.b<r.b;
}

int main(){
	int n,m;
	
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cin>>v[i].a>>v[i].b;
	}
	sort(v+1,v+1+m,cmp);
	int ans=1;
	int w=v[1].b;
	for(int i=1;i<=m;i++){
		w=min(v[i].b,w);
	}
	for(int i=1;i<=m;i++){
		if(v[i].a>=w){
			w=v[i].b;
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
} 

Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int main(){
  int a;
  int b;
  int ans;
  int i;
  while(cin >> a >> b){
    ans = a + b;
    for(i=1;;i++){
      ans/=10;
      if(ans==0) break;
    }
    cout << i <<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
def main():
    import sys
    input = sys.stdin.readline
    S = list(input().rstrip())
    K = int(input().strip())
    q = ["zzzzzz"] * K
    for i in range(len(S)):
        s = S[i]
        if s < q[-1] and s not in q:
            q[-1] = s
            q.sort()
        for j in range(1, K):
            if i+j < len(S):
                s += S[i+j]
                if s < q[-1] and s not in q:
                    q[-1] = s
                    q.sort()
    print(q[-1])

if __name__ == '__main__':
    main()

Measured memory_bytes: 39536
fun main(args: Array<String>) {
    val s = readLine()!!
    val w = readInteger()

    println(s.filterIndexed { index, c -> index % w == 0 })
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


Measured memory_bytes: 33484
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

pair<pair<double, double>, double> circumcircle(double a, double b, double c, double d, double e, double f) {
	double aa = a * a, bb = b * b, cc = c * c, dd = d * d, ee = e * e, ff = f * f;
	double cx, cy = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee - ff)) / (2 * (e - a) * (b - d) - 2 * (c - a) * (b - f));
	if (c == a){
		cx = (2 * (b - f) * cy - aa - bb + ee + ff) / (2 * (e - a));
	}else{
		cx = (2 * (b - d) * cy - aa - bb + cc + dd) / (2 * (c - a));
	}
	double R = sqrt(fabs(cx - a) * fabs(cx - a) + fabs(cy - b) * fabs(cy - b));
	return {{cx, cy}, R};
}

double dist(double x, double y, double nx, double ny) {
	return sqrt(fabs(x - nx) * fabs(x - nx) + fabs(y - ny) * fabs(y - ny));
}

int main() {
	const double eps = 1e-9;
	int n; cin >> n;
	int x[n], y[n]; rep(i,n) cin >> x[i] >> y[i];
	if(n == 2) {
		printf("%.10f\n", dist(x[0], y[0], x[1], y[1]) / 2.0);
		return 0;
	}
	double ans = INF;
	for(int i = 0; i < n; ++i) {
		for(int j = i + 1; j < n; ++j) {
			double cx, cy;
			double r;
			int Mx , mx, My, my;
			Mx = max(x[i], x[j]);
			mx = min(x[i], x[j]);
			My = max(y[i], y[j]);
			my = min(y[i], y[j]);
			cx = (Mx + mx) / 2.0;
			cy = (My + my) / 2.0;
			r = dist(Mx, My, mx, my) / 2.0;
			bool flg = true;
			for(int l = 0; l < n; ++l) {
				if(dist(cx, cy, x[l], y[l]) > r + eps) {
					flg = false;
				}
			}
			if(flg) {
				ans = min(ans, r);
			}
		}
	}
	for(int i = 0; i < n; ++i) {
		for(int j = i + 1; j < n; ++j) {
			for(int k = j + 1; k < n; ++k) {
				double cx, cy;
				double r;
				if(abs(x[i] - x[j]) * abs(y[j] - y[k]) == abs(x[j] - x[k]) * abs(y[i] - y[j])) {
					int Mx , mx, My, my;
					Mx = max({x[i], x[j], x[k]});
					mx = min({x[i], x[j], x[k]});
					My = max({y[i], y[j], y[k]});
					my = min({y[i], y[j], y[k]});
					cx = (Mx + mx) / 2.0;
					cy = (My + my) / 2.0;
					r = dist(Mx, My, mx, my) / 2.0;
				} else {
					pair<double, double> c;
					tie(c, r) = circumcircle(x[i], y[i], x[j], y[j], x[k], y[k]);
					tie(cx, cy) = c;
					// fprintf(stderr, "(%d, %d, %d) : %.10f\n", i, j, k, r);
				}
				bool flg = true;
				for(int l = 0; l < n; ++l) {
					if(dist(cx, cy, x[l], y[l]) > r + eps) {
						flg = false;
					}
				}
				if(flg) {
					ans = min(ans, r);
				}
			}
		}
	}
	printf("%.15f\n", ans);
	return 0;
}

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

const int maxn = 1e5 + 5;
const long long mod = 1e9 + 7;
std::vector<int> mp[maxn];

long long dfs(int from, int cur, int k) {
    long long tm = (from == 0 ? k - 1 : k - 2);
    //std::cout << tm << " " << cur << " " << std::endl;
    long long ret = 1;
    if (mp[cur].size() > k ) return 0;
    for (auto it : mp[cur]) {
        if (it == from) continue;
        ret = ret * tm % mod;
      //  std::cout << tm << std::endl;
        tm --;
        ret = ret * dfs(cur,it,k) % mod;
    }
    return ret % mod;
}

int main() {
    int n, k;
    std::cin >> n >> k;
    for (int i = 1; i <= n - 1; ++i) {
        int u, v;
        std::cin >> u >> v;
        mp[u].push_back(v);
        mp[v].push_back(u);
    }
  //  mp[0].push_back(1);
  //  mp[1].push_back(0);
    long long ret = dfs(0,1,k);
    std::cout << ret * k % mod << std::endl;

}

Measured memory_bytes: 11520
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
 
using namespace std;
int main()
{
    long long X;
    long long N;

    cin >> X;
	N = 100;
 
	for(long i = 0; 1; i++) {
		if(N >= X){
		    cout << i << endl;
			return 0;
		}
	N = N*1.01;
	}
    return 0;
}


Measured memory_bytes: 3624
#include <iostream>
using namespace std;
typedef long long ll;
ll n;
int main(void){
    // Your code here!
    bool ans = false;
    cin >> n;
    for (ll i = 0; i <= n; i++) {
        if (i % 7 == 0 && (n - i) % 4 == 0) ans = true;
    }
    cout << (ans ? "Yes" : "No") << endl;
}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int main() {
  int N, M, X; cin >> N >> M >> X;
  int a = 0, b = 0;
  for (int i = 0; i < M; i++) {
    int A; cin >> A;
    if (A < X) a++; else b++;
  }
  cout << min(a, b) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//using Graph = vector<vector<int>>;
using P = pair<int,int>;
//int dy[4] = {-1,0,1,0};
//int dx[4] = {0,-1,0,1};

int main()
{
    string S;
    cin >> S;
    
    if (S=="ABC")
    {
        cout << "ARC" << endl;
    }
    else
    {
        cout << "ABC" << endl;

    }
    
    
    return 0;
}



/*
int main()
{
    int N;
    cin >> N;
    
    
    return 0;
}
*/

Measured memory_bytes: 3624
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>

using namespace std;

int main() {

	int x, y, h;

	while(cin >> x >> y >> h) {
		if(!x&&!y&&!h) {
			break;
		}
		deque<int> c;
		c.push_back(x);
		c.push_back(y);
		c.push_back(h);
		sort(c.begin(), c.end());
		double R=sqrt(pow((double)c[0], 2)+pow((double)c[1], 2));

		int n;
		cin >> n;
		while(n) {
			int r;
			cin >> r;
			cout << (2*r>R ? "OK" : "NA") << endl;
			n--;
		}
	}

	return 0;

}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
const int maxn=1e5+10;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
int n,m,v,p;
ll book[maxn];
int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    cin>>n>>m>>v>>p;
    rep(i,1,n) cin>>book[i];
    sort(book+1,book+1+n,greater<int>());
    ll ans=p;
    ll sum=book[p],renshu=1;
    rep(i,p+1,n)
    {
       ll num=p-1+n-i;
       //cout<<num<<'\n';
       ll x=v-num-1;
       ll Last=book[i]+m;
       if(Last<book[p]) break;
       //cout<<x<<' '<<Last<<'\n';
       if(x<=0)
       {
            if(Last>=book[p]) ans++;
       }
       else
       {
           ll xx=Last*renshu-sum;
       //    cout<<renshu<<' '<<sum<<'\n';
        //   cout<<"xx "<<xx<<'\n';
           if(xx>=x*m) ans++;
       }
       renshu++;
       sum+=book[i];
    }
    cout<<ans<<'\n';
    return 0;
}



Measured memory_bytes: 1024
fun main(arg: Array<String>) {
    val (H, W) = listOfInt()
    val C = Array(10) { listOfInt().toIntArray() }
    val A = Array(H) { listOfInt().toIntArray() }
    for (k in 0 .. 9) for (h in 0 .. 9) for (w in 0 .. 9)
        if (C[h][w] > C[h][k] + C[k][w]) C[h][w] = C[h][k] + C[k][w]
    val ans = A.sumBy { it.sumBy { if (it != -1) C[it][1] else 0 } }
    println(ans)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
fun listOfLong() = listOfString().map(String::toLong)


Measured memory_bytes: 42588
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int h, w, k;
string a[1010];

int sx, sy, gx, gy;

int d[1001][1001];
void bfs() {
	queue<pair<int, int>> que;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			d[i][j] = HINF;
		}
	}
	que.push(pair<int, int>(sx, sy));
	d[sy][sx] = 0;
	while (que.size()) {
		pair<int, int> p = que.front();
		que.pop();
		for (int i = 0; i < 4; i++) {
			int nx = p.first + dx[i], ny = p.second + dy[i];
			if (0 <= nx&&nx < w && 0 <= ny&&ny < h &a[ny][nx] != '#'&&d[ny][nx] == HINF) {
				que.push(pair<int, int>(nx, ny));
				d[ny][nx] = d[p.second][p.first] + 1;
			}
		}
	}
}


int main() {
	cin >> h >> w >> k;
	REP(i, h)cin >> a[i];
	REP(i, h)REP(j, w) {
		if (a[i][j] == 'S') {
			sx = j, sy = i;
		}
	}
	bfs();
	int ans = INF;
	REP(i, h) {
		REP(j, w) {
			if (d[i][j] <= k) {
				int d2 = min({ i, w - j - 1, j , h - i - 1 });
				ans = min(d2 / k + (d2%k != 0? 1 : 0), ans);
			}
			//cout << d[i][j] << " ";
		}
		//cout << endl;
	}
	cout << ans+1 << endl;
	//system("pause");
}

Measured memory_bytes: 4352
#include <stdio.h>
#define N 100
#define INF 100000

int arr[N],m[N+1][N+1];

int min(int a,int b){
  int res;
  if(a>b) res = b;
  else res = a;
  return res;
}

void matrixChain(int n){
  /*int len;
  len = n-1;*/
  int i,j,k,l;
  for (i = 1;i<=n;i++) m[i][i] = 0;
    for (l = 2;l<=n;l++){
      for (i = 1;i<=n-l+1;i++){
        j = i+l-1;
        m[i][j] = INF;
        for (k = i;k<=j-1;k++){
          m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + arr[i-1] * arr[k] * arr[j]);
        }
      }
    }
}

int main(){
  int i,j,n;

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d %d",&arr[i-1],&arr[i]);
  }
  matrixChain(n);
  printf("%d\n",m[1][n]);

  return 0;
}

Measured memory_bytes: 636
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    if(n==3)cout<<2<<" "<<5<<" "<<63<<" ";
    else{
        cout<<3<<" "<<9<<" ";
        if(n<=15002){
            if(n%3==0){
                int i;
                for(i=1;i<n-2;i++) cout<<2*i<<" ";
                cout<<2*(i+2)<<" ";
            }
            else{
                for(int i=1;i<n-1;i++) cout<<2*i<<" ";
            }
        }
        else{
          if(n%2==0){
            for(int i=1;i<=15000;i++) cout<<2*i<<" ";
            for(int i=1;i<=n-15002;i++) cout<<6*(i+2)-3<<" ";
          }
          else{
            for(int i=1;i<15000;i++) cout<<2*i<<" ";
            for(int i=1;i<=n-15001;i++) cout<<6*(i+2)-3<<" ";
          }
        }
    }
}

Measured memory_bytes: 384
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  ll a,b;
  ll t0,t1;
  cin >> a >> b;
  for(int i=0;i<1000000;i++){
    t0 = (i*8)/100;
    t1 = (i*10)/100;
    if(a==t0&&b==t1){
      cout << i << endl;
      return 0;
    }
  }
  cout <<"-1\n";
}


Measured memory_bytes: 256
/******************************************
* AUTHOR : SOMU KUMAR *
* INSTITUTION : IIT BHUBANESWAR *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN 1000001
ll gcd(ll a,ll b){
	return (long)__gcd(a,b);
}
int spf[MAXN];
void sieve() 
{ 
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++) 
        spf[i] = i; 
  
    for (int i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (int i=3; i*i<MAXN; i++) 
    { 
        if (spf[i] == i) 
        { 
            for (int j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//code here...............//
sieve();
int n;
cin>>n;
ll arr[n];
ll x=1;
for(int i=0;i<n;i++){
	cin>>arr[i];
	if(i==0){
		x=gcd(arr[i],arr[i]);
		continue;
	}
	x=gcd(x,arr[i]);
}
if(x!=1){
	cout<<"not coprime"<<endl;
	return 0;
}
int h[1000001];
memset(h,0,sizeof(h));
for(int i=0;i<n;i++){
	int tmp=arr[i];
	vector<int>v;
	 while (tmp != 1) 
    {   
    	v.pb(spf[tmp]);
    	if(h[spf[tmp]]>0&&spf[tmp]!=1){
    		cout<<"setwise coprime"<<endl;
    		return 0;
    	}
        tmp = tmp / spf[tmp]; 
    } 
    for(int i=0;i<v.size();i++){
    	h[v[i]]++;
    }
}
cout<<"pairwise coprime"<<endl;
return 0;
}

Measured memory_bytes: 19224
#include<bits/stdc++.h>
#define rep(i,j,k) for(int i=j;i<=k;i++)
#define mo 200003
using namespace std;
template<typename T> void read(T &num){
	char c=getchar();T f=1;num=0;
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){num=(num<<3)+(num<<1)+(c^48);c=getchar();}
	num*=f;
}
template<typename T> void qwq(T x){
	if(x>9)qwq(x/10);
	putchar(x%10+'0');
}
template<typename T> void write(T x){
	if(x<0){x=-x;putchar('-');}
	qwq(x);putchar('\n');
}
int id[200010];int poww[200010];

const double Pi=acos(-1);
struct wzy{
	double real,imag;	
}a[600010];;
wzy operator +(wzy a,wzy b){
	wzy c;c.real=a.real+b.real;c.imag=a.imag+b.imag;
	return c;
}
wzy operator -(wzy a,wzy b){
	wzy c;c.real=a.real-b.real;c.imag=a.imag-b.imag;
	return c;
}
wzy operator *(wzy a,wzy b){
	wzy c;c.real=a.real*b.real-a.imag*b.imag;c.imag=a.real*b.imag+a.imag*b.real;
	return c;
}
inline void DFT(wzy *f,int len,int rev){
	if(len==1)return;
	wzy s1[len/2];wzy s2[len/2];
	for(int i=0;i<len;i+=2){s1[i/2]=f[i];s2[i/2]=f[i+1];}
	DFT(s1,len/2,rev);DFT(s2,len/2,rev);
	
	wzy tmp={1,0};wzy yy={cos(2.0*Pi/len),rev*sin(2.0*Pi/len)};
	rep(i,0,len/2-1){
		f[i]=s1[i]+(tmp*s2[i]);f[i+len/2]=s1[i]-(tmp*s2[i]);
		tmp=tmp*yy;
	}
	return;
}

int main(){
	id[1]=0;poww[0]=1;int tmp=2;int pos=1;
	while(tmp!=1){id[tmp]=pos;poww[pos]=tmp;tmp=(1ll*tmp*2)%mo;pos++;}
	
	int n;read(n);long long ans=0;
	rep(i,1,n){
		int x;read(x);
		if(!x)continue;
		a[id[x]].real+=1;ans-=(1ll*x*x)%mo;
	}
	
	int t=1;
	while(t<=2*mo-4)t*=2;
	DFT(a,t,1);
	rep(i,0,t-1)a[i]=a[i]*a[i];
	DFT(a,t,-1);
	
	rep(i,0,mo-2){
		long long n1=a[i].real*1.0/t+0.5;
		long long n2=a[i+mo-1].real*1.0/t+0.5;
		ans+=(n1+n2)*poww[i];
	}
	ans/=2;write(ans);
	return 0;
}

Measured memory_bytes: 30072
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <stdlib.h>
#include <algorithm>
#include <functional>
 
using namespace std;
 
int main(void) {
    unsigned long int n = 0, r = 0;
    
    cin >> n >> r;
    if(n < 10){
        cout << r + 100 * (10 - n) << endl;
    }else{
        cout << r << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define For(i,start,end) for(i64 i = start; i < end; i++)
#define newline std::cout<<'\n';
#define newlinedx(num) for(int i=0;i<num;i++)std::cout<<'\n';
using namespace std;
typedef long long ll;
typedef unsigned long ul;

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ui = uint64_t;

//----------------library in this time--------------------------------
template <class T>
T gcd(const T a,const T b) {
    return (b == 0) ? a : gcd (b, a % b);
}
template <class T>
T lcm(const T a, const T b) {
    return a * b / gcd(a,b);
}
template <class T>
inline T ave(const T a, const T b) {
    return (a + b) / 2.0f;
}

long long squareTwo(const long long a,const long long b) {
    return (b == 1) ? a : squareTwo(a * 2, b - 1);
}

template <class T>
inline T Max(const T a,const T b) {
    return (a >= b) ? a : b;
}

template <class T>
inline T Min(const T a,const T b) {
    return (a <= b) ? a : b;
}

template <class T>
inline void show(T a) {
    cout << a << endl;
}

typedef struct{
    ll x;
    ll y;
}idx;


//------------------------main function-------------------------------
void Main(){
    string s; cin >> s;
    int n = (int)s.size();
    rep(i, n) cout << "x";
    cout << endl;
}
//--------------------------------------------------------------------
int main(){
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(10);
     
    Main();
    return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[101];
int s;
int z,y,m,x,n;
int main()
{
	cin>>a;
	n=strlen(a);
	for(int i=0;i<n;i++)
	{
		if(a[i]=='C')
		{
		z=1;
		s=i;
	    }
		if(a[i]=='F')
		{
		y=1;
		x=i;
		}
		if(z==1&&y==1&&x>s)
		{
		cout<<"Yes";
		return 0;
	    }
	}
	cout<<"No";
	return 0;
}

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

int main(void){
  int N, K, X, Y, ans;
  cin >> N >> K >> X >> Y;
  if(N >= K)
    ans = K * X + (N - K) * Y;
  else
    ans = N * X;
  cout << ans << "\n";
  return 0;
}


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

int main(){
    double a,b,h,m,rad,ans;
    cin >> a >> b >> h >> m;
    h = 30 * h + m * 0.5;
    m = m * 6;
    rad = abs(h - m);
  	if(rad > 180) rad = 360 - rad;
  rad = rad / 180 * M_PI;
    ans = pow(a,2) + pow(b,2) - 2 * a * b * cos(rad);
  ans = sqrt(ans);
    cout << fixed << setprecision(15) << ans << endl;
    return 0;
}


Measured memory_bytes: 4224
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    k = ri()
    if k % 2 == 0 or k % 5 == 0:
        print (-1)
        return
    else:
        rem = 7 % k
        power = 1
        while rem != 0:
            rem = (10 * rem + 7) % k
            power += 1
        print (power)






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()


Measured memory_bytes: 67516
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 25 18:20:35 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

#N = int(input())
N, K = map(int,input().split())
A = list(map(int,input().split()))

dp = [i <= K for i in range(K + A[-1]+1)]
for i in range(K, -1, -1):
    for a in A:
        if dp[a+i]:
            dp[i] = False
            break

#    print(i, dp[i],A+i,dp[A+i])
#print(dp)

if dp[0]:
    ans = 'Second'
else:
    ans = 'First'
print(ans)

Measured memory_bytes: 4632
#include <iostream>
#include <vector>
#include <map>

using namespace std;

vector<int> res;
vector< vector< pair<int,int> > > el;

void dfs(int id) {
	for (int i = 0; i < el[id].size(); ++i) {
		if (res[el[id][i].first] == 0) {
			if (el[id][i].second%2 == 0) {
				res[el[id][i].first] = res[id];
			}
			else {
				res[el[id][i].first] = -res[id];
			}
			dfs(el[id][i].first);
		}
	}
	return;
}

int main(void) {
	int N;
	cin >> N;
	el = vector< vector< pair<int,int> > >(N);
	for (int i = 0; i < N-1; ++i) {
		int u,v,w;
		cin >> u >> v >> w;
		el[u-1].push_back({v-1,w});
		el[v-1].push_back({u-1,w});
	}
	res = vector<int>(N,0);
	res[0] = -1;
	dfs(0);
	for (int i = 0; i < N; ++i) {
		cout << max(0,res[i]) << endl;
	}
	return 0;
}


Measured memory_bytes: 7424
#include <iostream>
#include <cstdio>

using namespace std;

int n, s;
string a;
int main()
{
	int i;
	cin >> n;
	cin >> a;
	for (i = 1; i < n; i++) {
		if (a[i] != a[i - 1]) s++;
	}
	cout << s + 1;
    return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define ll long long
#define db double
using namespace std;
int n,m,cnt;
bool flag;
int main()
{
	int i,s,a,b,c,j,k;
	while(cin>>n)
	{
		flag=true;
		a=n%10;b=(n%100)/10;c=n/100;
		if(a!=c)flag=false;
		if(flag)printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>

using namespace std;

const int nmax = 1e9 + 7;
const long long INF = 1e18;
const double PI = 2 * asin(1);
typedef long long ll;

ll AN(ll A, ll N){
  if (N == 0){
    return 1;
  }else{
    if (N % 2 == 0){
      return AN((A*A)%nmax, N/2) % nmax;
    }else{
      return AN((A*A)%nmax, N/2) * A % nmax;
    }
  }
}


int main(){
  int N, M; cin >> N >> M;
  vector <int> S(N), T(M);
  for (int i = 0; i < N; i++) cin >> S[i];
  for (int i = 0; i < M; i++) cin >> T[i];

  ll DP[N + 1][M + 1];
  for (int i = 0; i < N + 1; i++){
    for (int j = 0; j < M + 1; j++){
      DP[i][j] = 0;
      if (i == 0 || j == 0) DP[i][j] = 1;
    }
  }

  
  for (int i = 1; i < N + 1; i++){
    for (int j = 1; j < M + 1; j++){
      if (S[i - 1] == T[j - 1]){
        DP[i][j] = DP[i - 1][j] + DP[i][j - 1];
      }else{
        DP[i][j] = DP[i - 1][j] + DP[i][j - 1] - DP[i - 1][j - 1];
      }
      while (DP[i][j] < 0){
        DP[i][j] += nmax;
      }
      
      DP[i][j] %= nmax;
    }
  }

  cout << DP[N][M] << endl;
  
  return 0;
}


Measured memory_bytes: 31488
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#define ll long long
#define pll pair<ll,ll>
using namespace std;
const int maxn=200010;
const int mod=1000000007;
int n,id[maxn],d[maxn],num;
ll mor[maxn];
vector<pll > f[maxn];
struct edge
{
	int t;
	edge *next;
}*con[maxn];
void ins(int x,int y)
{
	edge *p=new edge;
	p->t=y;
	p->next=con[x];
	con[x]=p;
}
void dp(int v,int fa)
{
	
	int mx=n+1;
	for(edge *p=con[v];p;p=p->next)
		if(p->t!=fa)
		{
			dp(p->t,v);
			if(d[p->t]>d[mx]) mx=p->t;
		}
	//cout<<"dfs:"<<v<<' '<<mx<<endl;
	if(mx<=n) id[v]=id[mx],d[v]=d[mx]+1;
	else id[v]=++num;
	f[id[v]].push_back(make_pair(1,1));
	//cout<<id[v]<<' '<<d[v]<<endl;
	bool flag=0;
	//cout<<"dfs:"<<v<<' '<<mx<<' '<<id[v]<<' '<<d[v]<<endl;
	for(edge *p=con[v];p;p=p->next)
		if(p->t!=fa&&p->t!=mx)
		{
			flag=1;
			//cout<<"dp:"<<d[v]<<' '<<p->t<<' '<<d[p->t]<<endl;
			for(int i=d[v]-d[p->t]-1;i<d[v];i++)
			{
				pll t=f[id[p->t]][i-d[v]+d[p->t]+1];
				mor[i]=(mor[i]*(t.first+t.second)%mod+f[id[v]][i].second*t.second%mod)%mod;
				f[id[v]][i].second=(f[id[v]][i].second*t.first%mod+f[id[v]][i].first*t.second%mod)%mod;
				f[id[v]][i].first=f[id[v]][i].first*t.first%mod;
			}
		}
	if(flag) 
		for(int i=0;i<d[v];i++)
	       	f[id[v]][i].first=(f[id[v]][i].first+mor[i])%mod,mor[i]=0;
		
		
//	for(int i=0;i<=d[v];i++)
//		cout<<i<<' '<<f[id[v]][i].first<<' '<<f[id[v]][i].second<<endl;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		ins(i,x);
		ins(x,i);
	}
	d[n+1]=-1;
	dp(0,-1);
	ll tot=1,sum=0;
	for(int i=0;i<=d[0];i++)
	{
		//cout<<i<<' '<<f[id[0]][i].first<<' '<<f[id[0]][i].second<<endl;
		int sz=(f[id[0]][i].first+f[id[0]][i].second)%mod;
		sum=(sum*sz%mod+f[id[0]][i].second*tot%mod)%mod;
		tot=tot*sz%mod;
	}
//	for(int i=1;i<=n+1;i++)
//	{
//		dp(0,-1,i);
//		if(f[0]==0) break;
//		sum=(sum*sz[0]%mod+f[0]*tot%mod)%mod;
//		tot=tot*sz[0]%mod;
//	}
	printf("%lld",sum);
 	return 0;
}

Measured memory_bytes: 45168
A,B=map(int,input().split())
S=list(input())

if S[A]!='-':
  print("No")
else:
  S.sort()
  #print(S)
  for i in range(1,len(S)):
    if S[i]=="-":
      print("No")
      break
  else:
    print("Yes")

Measured memory_bytes: 3060
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(int i = 0; i < n; i++)
using namespace std;
ll MOD = 1000000007;

int main() {
    int n;
    cin >> n;
    if (n >= 1000) {
        cout << "ABD" << endl;
    }
    else {
        cout << "ABC" << endl;
    }
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define dbgmint(n,arr) rep(i,n){cerr<<arr[i].x<<" ";}cerr<<endl;
#define out(a) cout<<a<<endl
#define out2(a,b) cout<<a<<" "<<b<<endl
#define vout(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,v.size())i>>v[j];return i;}

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

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n,k;
    cin>>n>>k;
    Vec cnt(1e5+4);
    rep(i,n){
        ll a,b;
        cin>>a>>b;
        cnt[a] += b;
    }
    ll cur = 0;
    ll ans = 0;
    REP(i,1,1e5+2){
        cur += cnt[i];
        if(cur>=k){
            ans = i;
            break;
        }
    }
    cout<<ans<<endl;
    return  0;
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <string.h>
typedef long long ll;


int main(int argc, char *argv[])
{
	ll A,B;

	cin>>A>>B;
	
	ll a,b;

	if (B>A) {a=B;b=A;} else {a=A;b=B;}
	
	while (b>0)
	{
		ll r=a%b;
		a=b;
		b=r;
	}
	cout << (A/a)*B << endl;
	return 0;
}



Measured memory_bytes: 256
def rank(n):
    n = int(n)
    if n < 400:
        return 'a'
    if n < 800:
        return 'b'
    if n < 1200:
        return 'c'
    if n < 1600:
        return 'd'
    if n < 2000:
        return 'e'
    if n < 2400:
        return 'f'
    if n < 2800:
        return 'g'
    if n < 3200:
        return 'h'
    else:
        return 'x'


N = int(input())
a = list(map(rank, input().split()))

normal = [i for i in a if i != 'x']
ans_max = len(set(normal)) + a.count('x')
if len(normal) == 0:
    ans_min = 1
else:
    ans_min = len(set(normal))
print(ans_min, ans_max)


Measured memory_bytes: 3064
N = int(input())
numbers_r = tuple(map(int, input().split(' ')))
numbers_s = sorted(numbers_r)

med_high = numbers_s[N // 2]
med_low = numbers_s[N // 2 - 1]

for number in numbers_r:
    if number <= med_low:
        print(med_high)
    else:
        print(med_low)


Measured memory_bytes: 25812
<?php
fscanf(STDIN, "%d %d", $a, $b);

$c = 0;
$m = 0;

If($a > $b) {
  $c = $b;
  $m = $a;
} else {
  $c = $a;
  $m = $b;
}

echo str_repeat($c, $m);

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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

//実行部
void Main()
{
  ll n; cin >> n;
  vs s(n); 
  rep(i, n)
  {
    cin >> s[i];
    sort(all(s[i]));
  }
  map<str, ll> ans;
  rep(i, n)
  {
    if(ans.count(s[i])) ans[s[i]]++;
    else ans[s[i]] = 0;
  }
  ll ana = 0;
  rep(i, n)
  {
    if(ans.count(s[i]))
    {
      ana += (ans[s[i]]) * (1 + ans[s[i]]) / 2;
      ans.erase(s[i]);
    }
  }
  fin(ana);
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}

/*
//test時
  g++ test.cpp -o test;./test
*/


Measured memory_bytes: 16640
S = input()

pn = ['-', '+']
for i in range(2 ** (len(S) - 1)):
#    print(bin(i))
    tmp = int(S[0])
    for j in range(len(S) - 1):
        if i >> j & 1 == 1:
            tmp += int(S[j+1])
        else:
            tmp -= int(S[j+1])
#    print(tmp)
    if tmp == 7:
        ans = S[0]
        for j in range(len(S)-1):
            ans += pn[i>>j&1] + S[j+1]
        print(ans + '=7')
        quit()


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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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; }

const ll INF = 1e9+10;
const ll MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  ll k; cin>>k;
  ll x=k/2;
  cout<<x*(k-x)<<endl;
  
}

Measured memory_bytes: 3576
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
template<typename T> void SSS(T& t) { cin >> t; }
#define SS(T, ...)      T __VA_ARGS__; SSS(__VA_ARGS__);
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

const int MOD = 1000000007;

int main() {
   ll a,b;cin>>a>>b;
   if(a==b)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
}


Measured memory_bytes: 256
N=int(input())
point=[]
merge=0
for num in range(0,N):
    x,y=map(int,input().split())
    point.append([x,y])
p=0
q=0
point.sort()
ans=0
for i in range(0,N-1):
    for j in range(i+1,N):
        p=point[j][0]-point[i][0]
        q=point[j][1]-point[i][1]
        merge=0
        for k in range(0,N):
            if([point[k][0]+p,point[k][1]+q] in point):
                merge+=1
        ans=max(ans,merge)
print(N-ans)


Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

vector<P> ans;

int main(void){
	ll x,y,k,n,p,q,r,i;
	bool xm=false,ym=false,rv=false;
	cin >> k;
	cin >> x >> y;
	if(x<0){
		xm = true;
		x = -x;
	}
	if(y<0){
		ym = true;
		y = -y;
	}
	if(x<y){
		swap(x,y);
		rv = true;
	}
	if((!(k%2)) && ((x+y)%2)){
		cout << "-1" << endl;
		return 0;
	}
	if(x+y<k){
		if((x+y)%2){
			n = 3;
			cout << 3 << endl;
			ans.push_back(P(x,x-k));
			ans.push_back(P((k+x-y)/2,(k-x+y)/2));
			ans.push_back(P(-(k+x-y)/2,(k-x+y)/2));
		}else{
			n = 2;
			cout << 2 << endl;
			ans.push_back(P((x+y)/2,-(2*k-x-y)/2));
			ans.push_back(P((x-y)/2,(2*k-x+y)/2));
		}
	}else{
		n = (x+y+k-1)/k + (((k-((x+y)%k))%k)%2);
		cout << n << endl;
		p = (k*n-x-y)/2; q = x; r = (k*n-x+y)/2;
		while(p>=k){
			ans.push_back(P(0,-k));
			p -= k;
		}
		if(p>0){
			ans.push_back(P(k-p,-p));
			q -= (k-p);
		}
		while(q>=k){
			ans.push_back(P(k,0));
			q -= k;
		}
		if(q){
			ans.push_back(P(q,k-q));
			r -= (k-q);
		}
		while(r>0){
			ans.push_back(P(0,k));
			r -= k;
		}
	}
	x = 0; y = 0;
	for(i=0; i<n; ++i){
		if(rv){
			swap(ans[i].first,ans[i].second);
		}
		if(xm){
			ans[i].first *= (-1);
		}
		if(ym){
			ans[i].second *= (-1);
		}
		x += ans[i].first; y += ans[i].second;
		cout << x << " " << y << endl;
	}
	return 0;
}


Measured memory_bytes: 5484
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
long long n,m,a[500050],s[500050],suf[500050],jc[500050],ans,c[500050];
long long lowbit(int x){ return x&(-x); }
void add(long long x){
	while(x<=n){
		c[x]++;
		x+=lowbit(x);
	}
}
long long que(long long x){
	long long ret=0;
	while(x){
		ret=(ret+c[x])%mod;
		x-=lowbit(x);
	}
	return ret;
}
int main(){
	cin>>n;
	jc[0]=1;
	for(int i=1;i<=n;i++){
		jc[i]=(jc[i-1]*i)%mod;
		cin>>a[i];
		if(a[i]) s[a[i]]=1;
		m+=(a[i]==0);
	}
	for(int i=1;i<=n;i++){
		suf[i]=s[i]=1-s[i],s[i]+=s[i-1];
	}
	for(int i=n;i>=1;i--) suf[i]+=suf[i+1];
	long long cnt=0,sum=0;
	//cout<<ans<<endl;
	for(int i=n;i>=1;i--){
		if(a[i]){
			sum=que(a[i])*jc[m]%mod;
			sum=(sum+cnt*s[a[i]]%mod*jc[m-1]%mod)%mod;
			ans=(ans+sum*jc[n-i]%mod)%mod;
			add(a[i]);
		}
		else cnt++;
	}
	cnt=sum=0;
	//cout<<ans<<endl;
	for(int i=1;i<=n;i++){
		if(a[i]) ans=(ans+sum*suf[a[i]]%mod*jc[m-1]%mod)%mod;
		else sum=(sum+jc[n-i])%mod,cnt++;
	}
	if(m<2){
		cout<<(ans+jc[m])%mod<<endl;
		return 0;
	}
	sum=m*(m-1)/2,cnt=0;
	for(int i=1;i<=n;i++){
		if(!a[i]) cnt++,ans=(ans+sum*(m-cnt)%mod*jc[m-2]%mod*jc[n-i]%mod)%mod;
	}
	cout<<(ans+jc[m])%mod<<endl;
	return 0;
}

Measured memory_bytes: 19840
while True:
    mid_score, final_score, re_score = map(float, input().split())
    
    if mid_score == final_score == re_score == -1:
        break
    
    sum_score = mid_score + final_score
    
    if mid_score == -1 or final_score == -1 or sum_score < 30:
        print("F")
    elif 30 <= sum_score < 50:
        if re_score < 50:
            print("D")
        else:
            print("C")
    elif 50 <= sum_score < 65:
        print("C")
    elif 65 <= sum_score < 80:
        print("B")
    elif 80 <= sum_score:
        print("A")


Measured memory_bytes: 5580
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long 

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int H, W; cin >> H >> W;
	if (W % 3 == 0 || H % 3 == 0) {
		cout << 0 << endl;
		return 0;
	}
	int ans = INF;
	rep(i, 2) {
		REP(i, 1, H - 1) {
			int S1,S2_1, S2_2, S3_1, S3_2;
			S1 = i * W;
			S2_1 = (H - i) * ((W + 1) / 2);
			S3_1 = (H - i) * (W / 2);
			S2_2 = ((H - i) + 1) / 2 * W;
			S3_2 = (H - i) / 2 * W;
			ans = min(ans, max({ S1, S2_1, S3_1 }) - min({ S1, S2_1, S3_1 }));
			if (S2_2 <= 0 || S3_2 <= 0) continue;
			ans = min(ans, max({ S1, S2_2, S3_2 }) - min({ S1, S2_2, S3_2 }));
		}
		swap(H, W);
	}
	cout << ans << endl;
	

    return 0;
}


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

int main()
{
    int n; cin >> n;

    vector<int> ans(n);

    int max = sqrt(n);
    // bool over_x, over_y, over_z;
    int tmp = 0;

    for(int i = 6; i <= n ; i++) {

        for(int x = 1; x <= max; x++) {

            for(int y = 1; y <= max; y++) {

                for(int z = 1; z <= max; z++) {
                    tmp = x*x + y*y + z*z + x*y + y*z + z*x;
                    if(tmp > i) break;
                    if(tmp == i) ans.at(i-1)++;

                }

            }

        }

    }

    arep(x, ans) cout << x << endl;
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
using namespace std;
const int MXN = 100005;
int a[MXN], pre[MXN], pos[MXN];

int main(){
    int n;
    cin >> n;
    for(int i = 1; i <= n; ++i)
    {
        cin >> a[i];
    }
    pre[1] = a[1];
    pos[n] = a[n];
    for(int i = 2; i <= n; ++i)
    {
        pre[i] = __gcd(pre[i - 1], a[i]);
    }
    for(int i =n - 1; i > 1; --i)
    {
        pos[i] = __gcd(pos[i + 1], a[i]);
    }
    int ans = max(pre[n - 1], pos[2]);
    for(int i = 2; i != n; ++i)
    {
        ans = max(ans, __gcd(pre[i - 1], pos[i + 1]));
    }
    cout << ans << '\n';
}

Measured memory_bytes: 1408
N, A, B, C, D = map(int, input().split())
S = "#{}#".format(input())


def reachable(start, end):
    now = start
    while now <= end:
        nex = now
        while nex <= end and S[now] == S[nex]:
            nex += 1
        if S[now] == '#' and nex - now >= 2:
            return False
        now = nex
    return True


if not reachable(A, C) or not reachable(B, D):
    print("No")
    quit()

if C > D:
    can_over = False
    for i in range(B, D+1):
        if S[i-1] == S[i] == S[i+1] == ".":
            can_over = True
    if not can_over:
        print("No")
        quit()

print("Yes")


Measured memory_bytes: 3636
A = []
a1 = []
a2 = []
a3 = []
for i in range(3):
    a = list(map(int,input().split()))
    for K in range(3):
        A.append(a[K])


N = int(input())
for i in range(N):
    b = int(input())
    for k in range(9):
        if b == A[k]:
            A[k] = 0




for i in range(9):
    if 0 <= i <= 2:
        a1.append(A[i])
    elif 3 <= i <= 5:
        a2.append(A[i])
    else:
        a3.append(A[i])

x = 0
y = 0
z = 0
for i in range(3):
    if a1[i] == 0:
        x += 1
    if a2[i] == 0:
        y += 1
    if a3[i] == 0:
        z += 1

if x == 3 or y == 3 or z == 3:
    print('Yes')
    exit()

for i in range(3):
    if a1[i] == 0 and a2[i] == 0 and a3[i] == 0:
        print('Yes')
        exit()

if a2[1] == 0:
    if a1[0] == 0 and a3[2] == 0 or a1[2] == 0 and a3[0] == 0:
        print('Yes')
        exit()

print('No')


Measured memory_bytes: 9256
require "set"

N = gets.to_i
Ls = gets.split.map(&:to_i)

def tri?(a, b, c)
  a + b > c && b + c > a && c + a > b
end

count = 0

(0..Ls.length - 3).each do |i|
  a = Ls[i]
  (i + 1..Ls.length - 2).each do |j|
    b = Ls[j]
    (j + 1..Ls.length - 1).each do |k|
      c = Ls[k]
      if tri?(a, b, c) && a != b && b != c && c != a
        # puts "#{i + 1}, #{j + 1}, #{k + 1}"
        count += 1
      end
    end
  end
end

puts count


Measured memory_bytes: 14436
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 10000000000
using namespace std;
using ll = long long;
int main()
{
    int a,b;
    cin >> a >> b;
    cout << max(a + b, max(a - b, a * b)) << endl;
}


Measured memory_bytes: 256