akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#define INF 1000000007
#define pi 3.141592653589793
using namespace std;
int sdkys(int a,int b){
    if(b==0) return a;
    return sdkys(b,a%b);
}
int sskbs(int a,int b){
    return a*b/sdkys(a,b);
}
int sosu(int a){
    if(a==2){
        return 1;
    }
    for(int i=2;i<sqrt(a)+1;i++){
        if(a%i==0){
            return 0;
        }
    }
    return 1;
}
vector<int> v;
int n,m,cnt=0,ans=INF,aa[220000],o=0;
pair<int,int> pp[220000];
string s,ss[220000];
char ch;
queue<int> que;
signed main(){
    cin>>n>>s;
    rep(i,n-1){
        if(s[i+1]=='E'){
            cnt++;
        }
    }
    rep(i,n){
        ans=min(ans,cnt);
        if(s[i]=='W'){
            cnt++;
        }
        if(s[i+1]=='E'){
            cnt--;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 10856
//
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P>IP;
typedef vector<ll> V;
typedef vector<V> V2;
typedef vector<vector<P> > G;
void g_dir(G &graph, ll a, ll b, ll w = 1){graph[a].push_back(P(b, w));}
void g_undir(G &graph, ll a, ll b, ll w = 1){g_dir(graph, a, b, w);g_dir(graph, b, a, w);}
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}
const ll INF = 1145141919;
const ll MOD = 1000000007;
const ll NUM = 101010;

void inc(string &s, ll pos){
    s[pos]++;
    if(pos == 0)return;
    rep(i, pos)if(s[i] + 1 >= s[pos])return;
    s[pos] = 'a';
    inc(s, pos - 1);
}

int main(){

    ll N;
    cin >> N;
    string ans(N, 'a');
    while(ans[0] == 'a'){
        cout << ans << endl;
        inc(ans, N - 1);
    }

    return 0;
}

Measured memory_bytes: 1536
#include<bits/stdc++.h>
using namespace std;
int main()
{
   string s1,s2;
   cin>>s1>>s2;
   int m,n,i,j;
   m=s1.length(),n=s2.length();
    int dp[m+1][n+1];
    for(i=0;i<=m;i++)
    {
       
        for(j=0;j<=n;j++)
        {
            if(i==0||j==0)
            dp[i][j]=0;
            else if(s1[i-1]==s2[j-1])
            {
                dp[i][j]=1+dp[i-1][j-1];
                
            }
            else dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
        }
    }
    if(dp[m][n]==0)
    {
        cout<<"";
        return 0;
        }string lcs="";
    i=m;j=n;
    while(i>0&&j>0)
    {
        if(s1[i-1]==s2[j-1])
        {
            lcs+=s1[i-1];i--;j--;
        }
        else
        {
            if(dp[i-1][j]>=dp[i][j-1])
            {
                i--;
            }
            else
            {
                j--;
            }
        }
        
    }reverse(lcs.begin(),lcs.end());cout<<lcs;
}

Measured memory_bytes: 35456
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<time.h>
#include<map>
#include<queue>
#include<set>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
int x,a,b;
int main(){
	scanf("%d%d%d",&x,&a,&b);
	if (abs(x-a)<abs(x-b)) printf("A\n");else printf("B\n");
	return 0;
}

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

using namespace std;

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

	int sx, sy, tx, ty;
	cin >> sx >> sy >> tx >> ty;
	int dx = tx - sx;
	int dy = ty - sy;
	for (int i = 0; i < dx; i++) {
		cout << 'R';
	}
	for (int i = 0; i < dy; i++) {
		cout << 'U';
	}
	for (int i = 0; i < dx; i++) {
		cout << 'L';
	}
	for (int i = 0; i < dy; i++) {
		cout << 'D';
	}
	cout << 'L';
	for (int i = 0; i <= dy; i++) {
		cout << 'U';
	}
	for (int i = 0; i <= dx; i++) {
		cout << 'R';
	}
	cout << 'D';
	cout << 'R';
	for (int i = 0; i <= dy; i++) {
		cout << 'D';
	}
	for (int i = 0; i <= dx; i++) {
		cout << 'L';
	}
	cout << "U\n";

	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>

#define min(a,b) ((a)<(b)?(a):(b))
#define INF 2000000000

int main(){
		int n,i,j,a[100];
		long ans=INF;
		scanf("%d",&n);
		for(i=0;i<n;i++)scanf("%d",&a[i]);
		for(i=-100;i<=100;i++){
				long tmp=0;
				for(j=0;j<n;j++)tmp+=(a[j]-i)*(a[j]-i);
				ans=min(ans,tmp);
		}
		printf("%ld\n",ans);
		return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX (1LL<<60);
const ll MOD (1000000007);

#define rep(i,s,e) for(ll i=(s); i<(e); i++) 

using namespace std;

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

    string s;
    cin >> s;
    //rep(i,0,s.size())
    //    s[i] = 'x';

    rep(i,0,s.size())
        cout << 'x' ;
    cout << endl;
    
    return 0;
}


Measured memory_bytes: 256
/*
   Author: Shivam Shukla
*/
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pair<ll,ll> > vpll;
 
const int MOD=1e9+7;
const int MAX=1e5+5;
const double PI= acos(-1.0);
const long double EPS=1e-10;
const int64_t INF=1e18+10;
 
#define fastio() ios_base::sync_with_stdio(false);cin.tie(0), cout.tie(0)
#define trace(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vi vector<int>
#define vl vector<ll>
#define vs vector<str>
#define vc(x) vector<x>
#define mapll map<ll,ll>
#define mapib map<int,bool>
#define mapiv map<int,vector>
#define mapsi map<string,int>
#define rep(i,j,k) for(ll i=j;i<k;i++)
#define down(i,j,k) for(ll i=j;i>=k;i--)
#define repa(i,n) for(ll i=0;i<n;i++)
#define dowa(i,n) for(ll i=n;i>=0;i--)
#define reps(i,j,k,s) for(ll i=j;i<k;i+=s)
#define downs(i,j,k,s) for(ll i=j;i>=k;i-=s)
#define trv(i,x) for(auto i:x)
#define pb push_back
#define eb emplace_back
#define sz(x) (int)x.size()
#define ff first
#define ss second
#define str string 
#define dub double
#define pqmax priority_queue<ll>
#define pqmin priority_queue<ll,vl,greater<ll> >
 
template<typename t> t lcm(t a, t b) {return (a*b)/__gcd(a,b);}
template<typename t> t gcd(t a, t b) {return __gcd(a,b);}
template<typename t> t mul_mod(t a, t b, t m){t res=((a%m)*(b%m)%m); return res;}
template<typename t> t add_mod(t a, t b, t m){t res=((a%m)+(b%m))%m; return res;}
template<typename t> t pow_mod(t a,t b,t m) {t res=1;while(b){if(b&1) res=mul_mod(res,a,m);a=mul_mod(a,a,m), b>>=1;} return res%m;}
template<typename t> vc(t) num_vec(t num) {t res; while (num) res.pb(num%10), num/=10; return res;}
template<typename t> t vec_num(t vec) {t res=0; ll mul=1; repa(i,sz(vec)) res=vec[i]*mul, mul*=10; return res;}
 

int32_t main(int argc,char** argv){
	fastio();
	auto tstart= clock();

    int n, m, x; cin >> n >> m;
    ll s = 0;
    repa(i, m) cin >> x, s += (ll) x;

    if (s > n)
       return cout << -1 << endl, 0;
    else
       cout << (n - s) << endl;        

    cerr<<setprecision(2)<<fixed<<"Time elapsed: "<<(double)(clock() - tstart)/CLOCKS_PER_SEC<<endl; 
    return 0; 
}

Measured memory_bytes: 3804
import java.util.*;
public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        if(4 * x >= y && (4 * x - y) % 2 == 0 && (4 * x - y) / 2 <= x) {
            System.out.println("Yes");
        }
        else
            System.out.println("No");
    }
}

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

#define int long
int mxmn(int x, int y, int z) {
    int mx = max(x, max(y, z));
    int mn = min(x, min(y, z));
    return mx - mn;
}

pair<int,int> a2(int h, int w) {
    return pair<int,int>((h/2) * w, (h-h/2) * w);
}
pair<int,int> b2(int h, int w) {
    return pair<int,int>((w/2) * h, (w-w/2) * h);
}

int a(int h, int w) {
    int res = 1e18;
    for(int i=1; i<=h-1; i++) {
        auto a = a2(h-i, w);
        auto b = b2(h-i, w);
        res = min(mxmn(a.first, a.second, i*w), res);
        res = min(mxmn(b.first, b.second, i*w), res);
    }
    for(int i=1; i<=w-1; i++) {
        auto a = a2(h, w-i);
        auto b = b2(h, w-i);
        res = min(mxmn(a.first, a.second, i*h), res);
        res = min(mxmn(b.first, b.second, i*h), res);
    }
    return res;
}

#undef int
int main(void) {
    long h, w;
    cin >> h >> w;
    cout << a(h, w) << endl;
}


Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#include<queue>
#include <sstream>
#include <set>

const long long INF = 1000000007;
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//Insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//c_str()変換
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

//大文字から小文字へんかん
//w[i] = w[i]-'A'+'a';

//vector
//assignメソッド　引数：サイズ、値
//与えられたサイズと値でvectorを初期化する

//queueクラス
//find()次に取り出す値の表示をする。
//pop()値を取り出す。戻り値はなし
//push()キューに値をプッシュする

//priority_queueクラス

//切り上げ
//ceil
//floor

int main(){
    string ans="ABC";
    string N;
    cin >> N;
    cout << ans+N << endl;
    return 0;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define debug(a, n) rep(hoge, n) printf("%d%c", a[hoge], hoge == n - 1? '\n' : ' ');
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define ln(a) cout << (a) << endl
#define INF 1000000000

using namespace std;
using P = pair<int, int>;

struct segtree {
    int n;
    int* dat;

    segtree(int _n) {
        n = 1;
        while(n < _n) n *= 2;
        dat = new int[n * 2 - 1];
        fill(dat, dat + n * 2 - 1, INT_MAX);
    }

    void update(int i, int x) {
        i += n - 1;
        dat[i] = x;
        while(i > 0) {
            i = (i - 1) / 2;
            dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }

    int find(int s, int t, int i, int l, int r) {
        if(t <= l || r <= s) return INT_MAX;
        if(s <= l && r <= t) return dat[i];
        int lv = find(s, t, i * 2 + 1, l, (l + r) / 2);
        int rv = find(s, t, i * 2 + 2, (l + r) / 2, r);
        return min(lv, rv);
    }
};

signed main() {
    int n, q;
    cin >> n >> q;

    segtree seg(n);
    rep(i, q) {
        int com, x, y;
        cin >> com >> x >> y;
        if(com) ln(seg.find(x, y + 1, 0, 0, seg.n));
        else seg.update(x, y);
    }
}



Measured memory_bytes: 4136
def main():
    S = input()
    N = len(S)
    K = int(input())

    tank = set()
    for k in range(1, K + 1):
        for i in range(N - k + 1):
            t = S[i:i + k]
            tank.add(t)

    ans = sorted(tank)[K - 1]
    print(ans)


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok


Measured memory_bytes: 4464
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

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

#define int long long
#define double long double
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
#define ceil(a,b) (a+b-1)/b
#define endl "\n"
const int N=100005;
const int inf=1e18;
const double eps=1e-9;

#define oa(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define o1(a) cout<<" "<<#a<<" : "<<a<<"\n"
#define o2(a,b) cout<<" "<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<"\n"
#define o3(a,b,c) cout<<" "<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<"\n"
#define o4(a,b,c,d) cout<<" "<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<"\n"

int pow(int a,int b){
    int res=1;
    while(b>0){
        if(b&1){
        	res=res*a;
		}
        a=a*a;
        b>>=1;
    }
    return res;
}
int pow1(int a,int b){
    int res=1;
    while(b>0){
        if(b&1){
            res=res*a;
            res%=mod;
        }
        a=a*a;
        a%+mod;
        b>>=1;
    }
    return res;
}
signed main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	
	int n,k;
    cin>>n>>k;
    int a[n];
    for(int x=0;x<n;x++){
        cin>>a[x];
    }
    sort(a,a+n);
    int s=0;
    for(int x=0;x<k;x++){
        s+=a[x];
    }
    cout<<s;







	
return 0;
}


Measured memory_bytes: 3660
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;
 
#define  GODSPEED       ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define  f              first                 
#define  s              second
#define  newl           cout<<"\n";
#define  pb             push_back  
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" ";newl;
#define  deb1(a)        cout<<a<<"\n";
#define  deb2(a,b)      cout<<a<<" "<<b<<"\n";
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<"\n";
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n";
#define  uniq(a)        a.resize(unique(a.begin(), a.end()) - a.begin());
#define  all(a)         a.begin(),a.end()           
 
typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   N     =  2e5+5;
const ll   mod   =  1e9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   LEVEL =  log2(N)+1;

ll n;

void solve(){
	cin >> n;
	ll ans = 1, res = 1, res1 = 1;
	for(int i = 0; i < n; i++) ans = (ans * 10)%mod;
	for(int i = 0; i < n; i++) res = (res * 9)%mod;
	for(int i = 0; i < n; i++) res1 = (res1 * 8)%mod;
	deb1((ans + 2*mod - 2*res + res1) % mod) 
}

int main(){
	GODSPEED;
	int test = 1;
	//cin>>test;
	for(int i = 1; i <= test; i++){
		solve();
	}
	#ifndef ONLINE_JUDGE
	cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	#endif
}

Measured memory_bytes: 3648
using System;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        string input = Console.ReadLine();
        string a, b, c;
        a = input.Substring(0,(input.Length - 1) / 2);
        b = input.Substring(((input.Length + 1)/ 2) - 1, 1);
        c = input.Substring(((input.Length + 3) / 2) - 1, (input.Length - 1) / 2);
        string inputRev = new string(input.Reverse().ToArray());
        string aRev = new string(a.Reverse().ToArray());
        string cRev = new string(c.Reverse().ToArray());
        if (input == inputRev && a == aRev)
        {
            Console.WriteLine("Yes");
        } else
        {
            Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 13268
s = input()
ans = []
for op in s:
    if op == '0':
        ans.append(op)
    elif op == '1':
        ans.append(op)
    else:
        if len(ans) > 0:
            ans.pop()
ss = ""
i = 0
for i in ans:
    ss += i
print(ss)


Measured memory_bytes: 2940
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;

int f[10010];
int n;

void init() {
	int curNum = 0;
	for (int x = 1 ; x <= 100 ; x++) {
		curNum = x * x;
		if (curNum > 10000) continue;
		
		for (int y = 1 ; y <= 100 ; y++) {
			curNum = x * x + y * y + x * y;
			if (curNum > 10000) continue;
			
			for (int z = 1 ; z <= 100 ; z++) {
				curNum = x * x + y * y + x * y + z * z + x * z + y * z;
				if (curNum > 10000) continue;
				f[curNum]++;
			}
		}
	}
}

int main()
{
	init();
	
	scanf("%d", &n);
	for (int i = 1 ; i <= n ; i++) {
		printf("%d\n", f[i]);
	}
	
	
	return 0;
}


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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main(){
  int n; cin >> n;
  vector<int> sum(1000);
  rep(i, 1000) sum[i] = i*(i+1)/2;
  if(!binary_search(ALL(sum), n)) {
    cout << "No" << endl;
    return 0;
  }

  int k = distance(sum.begin(), lower_bound(ALL(sum), n)) + 1;
  vector<vector<int>> ans(k);
  int start = 1;
  rep(i, k) {
    int count = k-1-i;
    rep(j, count) {
      ans[i].push_back(start+j);
      ans[i+1+j].push_back(start+j);
    }
    start += count;
  }
  cout << "Yes" << endl << k << endl;
  rep(i, k) {
    cout << k-1 << " ";
    line_out(ans[i]);
  }
}


Measured memory_bytes: 4552
using System;
using System.Collections.Generic;
/*using System.Linq;
using System.Text;
using System.Threading.Tasks;*/

namespace ITP1_2B
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());

            Console.WriteLine(x * x * x);

        }
    }
}

Measured memory_bytes: 9096
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL << 60;

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

uintmax_t combination(unsigned int n, unsigned int r) {
  if ( r * 2 > n ) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}

int modPow(long long a, long long n, long long p) {
  if (n == 1) return a % p;
  if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
  long long t = modPow(a, n / 2, p);
  return (t * t) % p;
}
int main()
{
    double n,m;
    int a,b;
    cin >> a >> b >> n >> m;
    double pi = 3.14159265358979323;

    if(n >= 12) n-=12;

    double lo,sh;

    sh = 6 * m;
    lo = 30*n + m/2;
    double ans = abs(sh - lo);

    if(ans > 180) ans = 360 - ans;

    double ans1 = ans * pi / 180;

    double x = sqrt(a*a + b*b - 2*a*b*cos(ans1));

    cout << fixed << setprecision(20) << x << endl;
    return 0;
}

Measured memory_bytes: 4192
/**
 * ?????§?????????
FX????????§????????°?????????????????¨????????????????????¨??§????????????????????????????????¨?????§????????????????????°????????????100????????????
1000???????????????????????????????????? 1?????? 108???????????£??????????£??????¨???(108??? ??? 100???) ??
1000?????? = 8000??????????????????????????¨?????§????????????

???????????¨????????????????????? t ?????????????????? Rt
(t=0,1,2,,,n???1)?????\?????¨??????????????????????????§??????????????? Rj???Ri (????????????j>i ??¨??????)
????????§???????±??????????????????????

??\???
?????????????????´??° n ?????????????????????????¶???? n ????????´??° Rt (t=0,1,2,,,n???1)
?????????????????????????????????

??????
?????§??????????????????????????????????????????

??¶?´?
2???n???200,000
1???Rt???10^9
??\?????? 1
6
5
3
1
3
4
3
??\?????? 1 ??????????????????
3
??\?????? 2
3
4
3
2
??\?????? 2 ??????????????????
-1
 */

#include <algorithm>
#include <iostream>
#include <sstream>
#include <vector>

int main(int argc, char const *argv[]) {
  unsigned int n;
  std::istringstream iss;
  std::string Param;

  while (true) {
    getline(std::cin, Param);
    iss.str(Param);
    iss >> n;
    iss.clear();
    if (n < 2 || n > 200000) {
      std::cout << "Error: 2 <= n <= 200,000" << std::endl;
    } else {
      break;
    }
  }

  size_t i = 0;
  std::vector<int> R(n, 0);

  while (i < n) {
    unsigned int Rt;
    getline(std::cin, Param);
    iss.str(Param);
    iss >> Rt;
    iss.clear();
    if (Rt < 1 || Rt > 1000000000) {
      std::cout << "Error: 1 <= Rt <= 1000000000" << std::endl;
    } else {
      R[i] = Rt;
      i++;
    }
  }

  int MinValue = R[0];
  int MaxValue = R[1] - R[0];

  for (size_t j = 1; j < n; j++) {
    MaxValue = std::max(MaxValue, R[j] - MinValue);
    MinValue = std::min(MinValue, R[j]);
  }

  std::cout << MaxValue << std::endl;

  return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i, s, e) for (int i = s; i < e; i++)
#define endl '\n'
int main()
{
    int n;
    lli y;
    cin >> n >> y;
    rep(i, 0, n+1)
    {
        rep(j, 0, n+1)
        {
            int k = n - i - j;
            if (k < 0)
                continue;
            if (10000 * i + 5000 * j + 1000 * k == y)
            {
                int ans[3] = {i, j, k};
                cout << ans[0] << " " << ans[1] << " " << ans[2] << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long 
#define pb push_back
#define bg begin()
#define en end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll gcd(ll a,ll b){
    if(a==0)
    return b;
    else
    return gcd(b%a,a);
}
ll sod(ll x){
    ll r,sum=0;
    while(x>0){
        r=x%10;
        x/=10;
        sum+=r;
    }
    return sum;
}
using namespace std;
int main()
{
    ll k;
    cin>>k;
    ll i,p=1;
    set<ll> s;
    ll x=7,c=1;
    while(x%k!=0){
        c++;
        x=((x%k)*10+7)%k;
        if(s.count(x)==1){
            p=0;
            break;
        }
        s.insert(x);
    }
    if(p==0){
        cout<<"-1";
    }
    else
    cout<<c;
}

Measured memory_bytes: 50468
n,m = map(int,input().split())
pref_ls = [[0] for _ in range(n+1)]
keys_ls = [0] * m
for i in range(m):
    p, y = map(int,input().split())
    pref_ls[p].append(y)
    keys_ls[i] = [p,y]
for i in range(n+1):
    pref_ls[i].sort()

# 含まれてるならそのインデックス 、含まれてないなら-1を返す
def binary_search(l, item):
    left = 0
    right = len(l) - 1
    while left <= right:
        mid  = (left + right) // 2
        if l[mid] == item:
            return mid
        elif l[mid] < item:
            left = mid + 1
        else:
            right = mid - 1
    return -1
for i in range(m):
    p,y = keys_ls[i]
    rank = binary_search(pref_ls[p], y)
    ans = str(p).zfill(6) + str(rank).zfill(6)
    print(ans)

Measured memory_bytes: 32760
l = [int(i) for i in input().split()]

result = 0

if l[0] < l[1]:
    result += l[0]

    if l[1] < l[2]:
        result += l[1]

    else:
        result += l[2]

else:
    result += l[1]

    if l[0] < l[2]:
        result += l[0]

    else:
        result += l[2]

print(result)

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

int main() {
  int n; cin>>n;
  graph v(n,vector<int>(3));
  rep(i,n){
    cin>>v[i][0]>>v[i][1]>>v[i][2];
  }
  int t;
  rep(i,n-1){
    t=v[i][1];
    
    for(int j=i; j<n-2; j++){
      t+=v[j][0];  
      t=max(t,v[j+1][1]);
      if(t % v[j+1][2]!=0){
        t+=v[j+1][2]-t % v[j+1][2];
      }       
    }
    t+=v[n-2][0];
    cout<<t<<endl;
  }
  cout<<0<<endl;
}



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

int main() {
    std::string s;
    std::cin >> s;

    int year = stoi(s.substr(0, 3));
    int month = stoi(s.substr(5, 6));
    int day = stoi(s.substr(8, 9));

    bool flag = true;

    if(year > 2019) {
        flag = false;
    } else {
        if(month > 4) {
            flag = false;
        }
    }

    if(flag) {
        std::cout << "Heisei" << std::endl;
    } else {
        std::cout << "TBD" << std::endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(ll i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(ll i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)
 
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007





int main(){
	int n,m;
	//cout<<"a"<<endl;
	while(cin>>n>>m){
		//cout<<n<<m<<endl;
		if(n == 0 && m == 0) break;
		vector<pii> v(m,pii(0,0));
		rep(i, m) v[i].se = i + 1;
		int a;
		rep(i, n){
			rep(j, m){
				cin>>a;
				if(a) v[j].fi--;
			}
		}
		sort(all(v));
		//reverse(all(v));
		rep(i,m){
			if(i != 0) cout<<" ";
			cout<<v[i].se;
		}
		cout<<endl;
	}
	
}

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

int a[60][200005];
 
int main(){
  long long int n, k;
  cin >> n >> k;
  for(int i=0; i<n; i++){
    cin >> a[0][i];
    a[0][i]--;
  }
  for(int i=1; i<60; i++){
    for(int j=0; j<n; j++){
      a[i][j] = a[i-1][a[i-1][j]];
    }
  }
  int s = 0;
  
  for(int i=59; i>=0; i--){
    if (k & (1ll<<i)){
      s = a[i][s];
    }
  }
  cout << ++s << endl;
  return 0;
  
}


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

	int n , m; cin >> n >> m;
	vector <int >v(m, 0);
	for(int i = 0; i < n; i++){
		int k; cin >> k;
		for(int j = 0; j < k; j++){
			int temp; cin >> temp;
			temp--;
			v[temp]++;
		}
	}
	int ans = 0;
	for(int i = 0; i < m; i++){
		if(v[i] == n)
			ans++;
	}
	cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl    "\n"
#define int		long long
#define mp		make_pair
#define pb		push_back
#define fi		first
#define se 		second
#define sz(x)	((int)(x).size())
#define dbg(x) cerr<<#x<<" :: "<<x<<endl;
#define dbg2(x,y) cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
const int INF = 1e9;
const int MOD = 1e9 + 7; 
const double pi = acos(-1);

void solve (){
	int n; cin>>n;
	int a[n];
	cin>>a[0];
	int xor1 = a[0];
	for(int i = 1; i < n; i++){
		cin>>a[i];
		xor1 = xor1 ^ a[i];
	}
	for(int  i = 0; i < n; i++){
		int temp = xor1 ^ a[i];
		cout<<temp<<" ";
	}
}

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0);
	solve();
	return 0;
}
//g++ -std=c++17 -Wshadow -Wall -o "%e" "%f" -g -D_GLIBCXX_DEBUG

Measured memory_bytes: 5148
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long n = sc.nextLong();
        long answer = b/n-a/n;
        if(a%n == 0){
            answer++;
        }
        System.out.println(answer);
    }
}

Measured memory_bytes: 21972
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const ll mod = 1000000007;
int main() {
	ll A, B, N, x = 1, M = 0, c = 1;
	scanf("%lld%lld%lld", &A, &B, &N);

	if (B == 1) {
		puts("0");
		return 0;
	}
	if (N < 100000) {
		while (x <= N) {
			M = max(M, A * x / B - A * (x / B));
			x++;
		}
	}
	else {
		c = max((N - 10000000) / B, 0ll);
		while ((x = B * c - 1) <= N) {
			M = max(M, A * x / B - A * (x / B));
			c++;
		}
		x = max(N - 100000, 0ll);
		while (x <= N) {
			M = max(M, A * x / B - A * (x / B));
			x++;
		}
	}
	printf("%lld\n", M);
	return 0;
}


Measured memory_bytes: 3728
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b,c,d,e;
	cin >> a >> b >> c;
	c = a / 100 ;
	d = a % 100 / 10;
 	e = a % 100 % 10 / 1;
	cout << c+d+e << endl;  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define INF (ll)1e18+4
#define md (ll)1e9+7
#define mx 10000000
#define mk make_pair
#define __builtin_popcountll(x) one(x)
#define pi pair<int,int>
#define ss second
#define ff first
#define pb emplace_back 
#define all(s) s.begin(),s.end()
#define rall(x) (x).rbegin(), (x).rend()
#define trav(x, a) for (auto& x: a)
#define fr(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define rf(i,a,b) for(int i=a;i>=b;i--)
#define sz(x) ((long long)x.size())
#define mez(s) memset(s,0,sizeof s)
#define mex(s) memset(s,-1,sizeof s)
#define metr(s) memset(s,true, sizeof s)
typedef vector<int> vi; 
typedef vector<ll>vl;
typedef map<int,int> mp;
typedef queue<int> que;
typedef vector<pi> vp;


void solve(){
	int n,x,y,z,m,k;
	cin>>n;
	if(n>=30)cout<<"Yes\n";
	else cout<<"No";
	
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t=1;
   //cin>>t;
  while(t--){
  	solve();
  }
  return 0;
}

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

int main(void)
{
  const double PI=3.14159265358979323846;
  int X, K;
  double x, y, sk, st;
  cin >> X;
  
//  KK = 360 / X;
//  if (abs(KK - round(KK)) > 0.000001)
//    K = 360;
//  else
//    K = 360 / X;
  
//なんか答えが合わないので、実際に高橋君を走らせてみる
    x = 1.0;
    y = 0.0;
    st = double(X) * PI / 180.0;
    sk = st;
    K = 1;
    while (abs(x)+abs(y) >= 0.0001) {
      x += cos(sk);
      y += sin(sk);
      sk += st;
      K++;
    }

  cout << K << endl;
  return 0;
}


Measured memory_bytes: 3936
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <queue>
#include <math.h>
#include <assert.h>
#include <set>
#include <map>
#include <bitset>
#include <ctime>
#include <time.h>
#include <algorithm>
#include <cstdio>
#include <fstream>

int main(){
	// freopen("/Users/deepsajeda/Projects/input.txt","r", stdin);
	// freopen("/Users/deepsajeda/Projects/output","w",stdout);

	std::ios::sync_with_stdio(0);
	std::cin.tie(0);
	
	int n, k;
	scanf("%d%d", &n, &k);
	int x = 1;
	while(n--){
		if(2*x < x+k) x *= 2;
		else x += k;
	}
	printf("%d\n", x);
}


Measured memory_bytes: 256
#include<cstdio>
//dp[i]=(1,2,...,i番目の列の塗り方の個数)
//     =sum_{j<i|j番目の色 \neq j+1番目の色 = i番目の色}(1,2,...,j番目の塗り方の個数)
//     =sum_{j<i|j番目の色 \neq j+1番目の色 = i番目の色} dp[j]
//     （このときj番目までの色がj+1番目とつながらないのでダブりがなく、
//       任意の塗り方はもとの列のどこかの端点を端点とするのでもれもない）
//col[c]=sum_{j<i|j番目の色 \neq j+1番目の色 = i番目の色 = c} dp[j]とおき、同時に更新する
long long dp[200001],col[200001];
long long const mod=1e9+7;
int c[200001];
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&c[i]);
    dp[0]=1;
    c[0]=0;
    for(int i=1;i<=n;i++){
        if(c[i-1]!=c[i])col[c[i]]=(col[c[i]]+dp[i-1])%mod; //col[c[i]]に新たに増えるのは直前（j=i-1のとき）だけ
        dp[i]=col[c[i]]%mod;
    }
    printf("%lld\n",dp[n]);
    return 0;
}

Measured memory_bytes: 4096
n = int(input())
g = [[] * n for i in range(n)]
for i in range(n-1):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)
    
da = [0]*n
dn = [0]*n
from collections import deque

def bfs(s,d):
  que = deque()
  que.append((s,1))
  chk = [False]*n
  chk[s] = True
  cnt = 1
  while que:
      now,p = que.popleft()
      if cnt == n:
        break
      for i in g[now]:
          if not chk[i]:
            d[i] = p
            chk[i] = True
            cnt += 1
            que.append((i,p+1))
            
bfs(0,da)
bfs(n-1,dn)

f = 0
s = 0
for i in range(n):
  if da[i] <= dn[i]:
    f += 1
  else:
    s += 1
if f > s:
  print('Fennec')
else:
  print('Snuke')

Measured memory_bytes: 91544
use std::io::*;

fn show(x: u32) {
  println!("{:032b}", x);
  println!("{:032b}", !x);
  println!("{:032b}", x << 1);
  println!("{:032b}", x >> 1);
}

fn main() {
  let stdin = stdin();
  let line = stdin.lock().lines().next().unwrap().unwrap();

  let x: u32 = line.parse().unwrap();
  show(x);
}



Measured memory_bytes: 5016
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> x(n);
  for(int i=0;i<n;i++)
    cin>>x.at(i);
  int p=1000000007;
  int k=0;
  vector<int> c(n,0);
  for(int i=0;i<n;i++){
    if(i+1-k>(x.at(i)+1)/2){
      c.at(k)=i+1-k;
      k++;
    }
  }
  for(int i=k;i<n;i++)
    c.at(i)=n-i;
  int64_t a=1;
  for(int i=0;i<n;i++)
    a=a*c.at(i)%p;
  cout<<a<<endl;
}

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

int main(){
    int N;
    int ans[100001];
    cin >> N;
    for(int i=1; i<=N; i++){
        int a;
        cin >> a;
        ans[a] = i;
    }
    for(int i=1; i<=N; i++) cout << ans[i] << " \n"[i==N];
    return 0;
}


Measured memory_bytes: 1152
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <deque>

using namespace std;

int f(int k,
      const vector<int>& h,
      vector<int>& res) {
  if (k == 0) return 0;

  if (res[k] == -1) {
    res[k] = f(k - 1, h, res) + abs(h[k] - h[k - 1]);
    if (k >= 2) {
      res[k] = min(res[k], f(k - 2, h, res) + abs(h[k] - h[k - 2]));
    }
  }
  
  return res[k];
}

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

  // lets start from 0, to n-1
  vector<int> h(n);
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  
  vector<int> res(n, -1);
  
  cout << f(n - 1, h, res);

  return 0;
}


Measured memory_bytes: 7296
#include <iostream>
#include <cmath>
#include <map>
#include <queue>
#include <string>
#include <string>
#include <algorithm>
using namespace std;

int main(){
    string s,t; cin >> s >> t;
    int a,b; cin >> a >> b;
    string u; cin >> u;
    if(u == s)--a;
    else --b;
    cout << a << ' ' << b << endl; return 0;
}

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

int main(void){

    long N = 0;
    long K = 0;
    long tmp = 0;
    int flag = 0;
    scanf("%ld %ld", &N, &K);

    N = N % K;

    while (flag == 0){
        tmp = N;
        N = labs(N - K);
        if (tmp <= N){
            N = tmp;
            flag = 1;
        }
    }

    printf("%ld", N);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
using namespace std;
int main(void) {
	int n, m;
	cin >> n >> m;
	vector<int>k;
	vector<int>cnt;
	vector<vector<int>>a;
	for (int i(0); i < m; i++) {
		cnt.push_back(0);
	}
	for (int i(0); i < n; i++) {
		int num;
		cin >> num;
		k.push_back(num);
		vector<int>tmp;
		for (int j(0); j < k[i]; j++) {
			int num;
			cin >> num;
			tmp.push_back(num);
		}
		a.push_back(tmp);
	}
	for (int i(0); i < n; i++) {
		for (int j(0); j < k[i]; j++) {
			cnt[a[i][j] - 1]++;
		}
	}
	int total(0);
	for (int i(0); i < m; i++) {
		if (cnt[i] == n)total++;
	}
	cout << total << endl;
	return 0;
}


Measured memory_bytes: 256
<?php
     
    $stdin = trim(fgets(STDIN));
     
    for($i = 0;$i < $stdin;$i++) {
        $line = fgets(STDIN);
        $inputs = array();
        $inputs[] = explode(' ', trim($line));
        sort($inputs[0]);
        if(($inputs[0][0]*$inputs[0][0]+$inputs[0][1]*$inputs[0][1])==$inputs[0][2]*$inputs[0][2]){
            echo("YES\n");
        }else{
            echo("NO\n");
        }
    }

Measured memory_bytes: 15256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;


int main() {
    int h, w;
    cin >> h >> w;
    string s[h];
    for (int i = 0; i < h; i++) {
        cin >> s[i];
    }

    for (int i = 0; i < w + 2; i++) {
        cout << '#';
    }
    cout << endl;
    for (int i = 0; i < h; i++) {
        cout << '#' << s[i] << '#' << endl;
    }
    for (int i = 0; i < w + 2; i++) {
        cout << '#';
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
N, X, T = map(int, input().split())
if int(N) % int(X) != 0 :
	print( ( int(N) // int(X) + 1) * int(T) )
if int(N) % int(X) == 0 :
	print( (int(N) // int(X) ) * int(T) )


Measured memory_bytes: 9044
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vt vector
#define pb push_back
#define pob pop_back
#define vi vt<int>
#define vvi vt<vi>
#define vii vt<ii>
#define vvii vt<vii>
typedef long long ll;
#define For(i,a,b) for(int i = a; i < b; i++)
#define foR(i,a,b) for(int i = a; i <= b; i++)
#define roF(i,a,b) for(int i = a - 1; i >= b; i--)
#define Rof(i,a,b) for(int i = a; i >= b; i--)

int dp[5001];
int gt[25000001];
int a[3], b[3];
signed main (){
	/*
	freopen(".inp","r",stdin);
	freopen(".out","w",stdout);
	*/
	int n;
	cin >> n;
	cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];
	foR(i,1,n){
		For(j,0,3){
			if(i - a[j] >= 0){
				dp[i] = max(dp[i],dp[i-a[j]]+b[j]-a[j]);
			}
		}
	}
	n = n+dp[n];
	foR(i,1,n){
		For(j,0,3){
			if(i - b[j] >= 0){
				gt[i] = max(gt[i],gt[i-b[j]]+a[j]-b[j]);
			}
		}
	}
	n = n+gt[n];
	cout << n;
}



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

using namespace std;

void Dfs(int prev, int v, const vector<vector<int>> &g, vector<int> &d) {
    for (auto u : g[v]) {
        if (u != prev) {
            d[u] = d[v] + 1;
            Dfs(v, u, g, d);
        }
    }
}

int Even(int n, int k, vector<vector<int>> &tree) {
    int min_remove = n;
    for (int v = 0; v < n; ++v) {
        vector<int> d(n, 0);
        Dfs(-1, v, tree, d);

        int remove = 0;
        for (int u = 0; u < n; ++u)
            if (d[u] > k / 2)
                ++remove;

        min_remove = min(min_remove, remove);
    }

    return min_remove;
}

int Odd(int n, int k, vector<vector<int>> &tree) {
    int min_remove = n;
    for (int v = 0; v < n; ++v) {
        for (auto u : tree[v]) {
            vector<int> d(n, 0);
            Dfs(u, v, tree, d);
            Dfs(v, u, tree, d);

            int remove = 0;
            for (int i = 0; i < n; ++i)
                if (d[i] > (k - 1) / 2)
                    ++remove;

            min_remove = min(min_remove, remove);
        }
    }

    return min_remove;
}

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

    int n, k, a, b;

    cin >> n >> k;
    vector<vector<int>> tree(n);
    for (int i = 0; i < n - 1; ++i) {
        cin >> a >> b;
        tree[a - 1].push_back(b - 1);
        tree[b - 1].push_back(a - 1);
    }

    if (k % 2 == 0)
        cout << Even(n, k, tree) << endl;
    else
        cout << Odd(n, k, tree) << endl;

    return 0;
}


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

using namespace std;

int main(void){

  int Enemy, SkillNum;
  cin >> Enemy >> SkillNum;
  vector<long long > EnemyHitpoint;

  for (long long i = 0; i < Enemy; i++)
  {
    long long X; cin >> X;
    EnemyHitpoint.push_back(X);
  }
  std::sort(EnemyHitpoint.begin(), EnemyHitpoint.end());
  long long Ans = 0;
  for (int i = 0; i < Enemy - SkillNum; i++)
  {
    Ans += EnemyHitpoint[i]; 
  }
  
  cout << Ans << endl;
  
  return 0;
}

Measured memory_bytes: 3052
#include <iostream>
#include<algorithm>

using namespace std;

int main()
{
  int a[3];
  int n,i;
  int sum=0;
  cin>>a[0]>>a[1]>>a[2]>>n;
  sort(a,a+3);
  for(i=0;i<n;i++)
  {
  	a[2]*=2;
  }
  sum+=a[0]+a[1]+a[2];
  cout<<sum<<endl;
  return 0;
}


Measured memory_bytes: 256
use std::cmp::max;
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident) => {
        $it.next().unwrap().parse().unwrap()
    };
    ($it: ident,2) => {
        (parse!($it), parse!($it))
    };
    ($it: ident,3) => {
        (parse!($it), parse!($it), parse!($it))
    };
    ($it: ident,4) => {
        (parse!($it), parse!($it), parse!($it), parse!($it))
    };
    ($it: ident, $n: expr) => {
        (&mut $it).take($n).map(|e| e.parse().unwrap()).collect();
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    let (n, w) = parse!(it, 2);
    let mut wv = vec![];
    let mut w0 = 0usize;
    for i in 0..n {
        let (w, v): (usize, usize) = parse!(it, 2);
        if i == 0 {
            w0 = w;
        }
        wv.push((w - w0, v));
    }
    let maxw = 3 * n;
    let mut dp = vec![vec![vec![0usize; maxw + 1]; n + 1]; n + 1];
    for i in 1..(n + 1) {
        if i * w0 > w {
            break;
        }
        for j in 1..(n + 1) {
            for k in 0..(std::cmp::min(maxw, w - i * w0) + 1) {
                let (wi, vi) = wv[j - 1];
                dp[i][j][k] = if k >= wi {
                    *[dp[i][j - 1][k], dp[i - 1][j - 1][k - wi] + vi]
                        .into_iter()
                        .max()
                        .unwrap()
                } else {
                    dp[i][j - 1][k]
                };
            }
        }
    }
    let mut ret = 0;
    for i in 1..(n + 1) {
        if i * w0 > w {
            break;
        }
        for k in 0..(std::cmp::min(maxw, w - i * w0) + 1) {
            ret = std::cmp::max(ret, dp[i][n][k]);
        }
    }
    println!("{}", ret);
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        4 6
2 1
3 4
4 10
3 4
        ";
        solve(s);
    }
}


Measured memory_bytes: 30972
n = int(input())
a = [int(x) for x in input().split()]
count = 0
judge = False

#奇数
odd = []
#偶数
even = []

# 奇数と偶数に分ける
for i_a in range(len(a)):
    if(a[i_a] % 2 == 0):
        even.append(a[i_a])
    else:
        odd.append(a[i_a])
# もし偶数がいない場合は操作不可能
if(even == []):
    print(0)
    exit()

# 偶数を一つ取り出し、2で割る。次で割れなくなるなら削除
while True:
    count += 1
    even[0] /= 2
    if(even[0] % 2 != 0):
        even.pop(0)
    if(even == []):
        break
        

print(count)


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             count += 1
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         print(a)
#         exit()


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         exit()
#     else:
#         count += 1

Measured memory_bytes: 4148
from itertools import groupby


s = input()
k = int(input())
s_sub = [[h, len(list(g))] for h, g in groupby(s)]
cnt_s = 0
if s[0] == s[-1]:
    if len(s_sub) == 1:
        ans = s_sub[0][1] * k // 2
    else:
        for i in range(1, len(s_sub)-1):
            cnt_s += s_sub[i][1] // 2
        ans = cnt_s * k + s_sub[0][1] // 2 + s_sub[-1][1] // 2 + ((s_sub[0][1] + s_sub[-1][1]) // 2) * (k - 1)
else:
    for i in range(len(s_sub)):
        cnt_s += s_sub[i][1] // 2
    ans = cnt_s * k
print(ans)


Measured memory_bytes: 3064