akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44

/*
const int MOD = ;

inline void mod(int &x) {
    if(x >= MOD)
        x -= MOD;
}

inline void add(int &x, int y) {
    x += y;
    mod(x);
}

inline void sub(int &x, int y) {
    x += MOD - y;
    mod(x);
}


inline void mul(int &x, int y) {
    x = (1LL * x * y) % MOD;
}
*/

using namespace std;



int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int i, n;
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    string str;
    cin >> str;

    vector <int> fr(26);
    for(auto it : str) {
        fr[it - 'A']++;
    }

    for(i = 0; i < 26; i++) {
        if(fr[i] > 0) {
            if(fr[i] != 2) {
                cout << "No";
                return 0;
            }
        }
    }

    cout << "Yes";

    //cin.close();
    //cout.close();
    return 0;
}


Measured memory_bytes: 256
a = gets.to_i
problem_sort = gets.split(" ").map(&:to_i)
count = 0

num_sort = problem_sort.sort
a.times do |target|
  if problem_sort[target] != num_sort[target]
   count += 1
  end
end

if count <= 2
  puts "YES"
else
  puts "NO"
end

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

using namespace std;

int main(int argc, char* argv[])
{
    int N(0), R(0), G(0), B(0);
    cin >> N;
    
    string s("");
    long long result(0);
    cin >> s;
    
    
    for(int i(0); i < N; ++i){
        if(s[i] == 'R')
            ++R;
        if(s[i] == 'G')
            ++G;
        if(s[i] == 'B')
            ++B;
    }
   
    result = R*G*B;
    
    for(int j(0); j < N; ++j){
        for(int i(0); i <= j; ++i){
            int k(2*j -i);
            if(k < N){
                if(s[i] == s[j])continue;
                if(s[j] == s[k])continue;
                if(s[k] == s[i])continue;
                --result;
            }
        }
    }
    cout << result << endl;
    return 0;
}


Measured memory_bytes: 3196
#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>

intmax_t opt(
    const std::vector<intmax_t> &x, const std::vector<intmax_t> &v,
    intmax_t c) {

  size_t n=v.size();
  std::vector<intmax_t> vv(n);
  intmax_t sv=v[n-1];
  vv[n-1] = std::max<intmax_t>(0, sv-(c-x[n-1]));
  for (size_t i=n-1; i--;) {
    sv += v[i];
    vv[i] = std::max(vv[i+1], sv-(c-x[i]));
  }

  intmax_t res=std::max<intmax_t>(0, sv-x[n-1]);
  sv = 0;
  for (size_t i=0; i+1<n; ++i) {
    sv += v[i];
    res = std::max({res, sv-x[i], sv-x[i]-x[i]+vv[i+1]});
  }

  return res;
}

int main() {
  size_t N;
  intmax_t C;
  scanf("%zu %jd", &N, &C);

  std::vector<intmax_t> x1(N), v1(N);
  for (size_t i=0; i<N; ++i)
    scanf("%jd %jd", &x1[i], &v1[i]);

  std::vector<intmax_t> x2(N), v2(N);
  for (size_t i=0; i<N; ++i) {
    x2[i] = C-x1[N-i-1];
    v2[i] = v1[N-i-1];
  }

  printf("%jd\n", std::max(opt(x1, v1, C), opt(x2, v2, C)));
}


Measured memory_bytes: 4208
#include <bits/stdc++.h>
    #define REP(i, n) for(int i = 0;i < n;i++)
    #define REPR(i, n) for(int i = n;i >= 0;i--)
    #define FOR(i, m, n) for(int i = m;i < n;i++)
    #define FORR(i, m, n) for(int i = m;i >= n;i--)
    #define SORT(v, n) sort(v, v+n);
    #define VSORT(v) sort(v.begin(), v.end());
    #define llong long long
    #define pb(a) push_back(a)
    #define INF 999999999
    using namespace std;
    typedef pair<int, int> P;
    typedef pair<llong, llong> LP;
    typedef pair<int, P> PP;
    typedef pair<llong, LP> LPP;
    llong mod = 1000000007;

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

    int main()
    {
    int k,s;
    cin>>k>>s;
    int cnt=0;
    for(int i=0; i<=k; i++)
    {
        for(int j=0; j<=k; j++)
        {
            if(s-i-j>=0&&s-i-j<=k) {++cnt;}
        }
    }
    cout<<cnt<<endl;
    }

Measured memory_bytes: 256
N,K = map(int,input().split())
masks = [K]

bs = str(bin(K))[2:]
for i in range(len(bs) - 1):
    if bs[i] == '1':
        a = len(bs) - 1 - i
        mask = K - (1 << a)
        mask |= ((1 << a) - 1)
        masks.append(mask)

anss = [0 for i in range(len(masks))]
for i in range(N):
    a,b = map(int,input().split())
    for i,m in enumerate(masks):
        if (m | a) == m:
            anss[i] += b

print(max(anss))


Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,n) for(lli i=0;i<n;i++)
#define repb(i,n) for(lli i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
#define all(X) X.begin(),X.end()
#define iterate(X) for(it=X.begin();it!=X.end();it++)
lli combi(lli n,lli k)
{
    lli ans=1;
    k=k>n-k?n-k:k;
    lli j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli findlcm(vector <lli> arr, lli n)
{
    lli ans = arr[0];
    for (lli i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    set <string> st;
    lli n;
    cin>>n;
    rep(i,n){
    	string s;
    	cin>>s;
    	st.insert(s);
	}
	cout<<st.size();
    return 0;
}


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

#define ll long long
#define ull unsigned long long 
#define endl '\n'
//const int MOD = 1e9+7;

int main(){
    ll n, m;
    cin >> n >> m;

    if(n==1 && m==1){
        cout << 1;
        return 0;
    }

    if(n==1){
        cout << m-2;
        return 0;
    }
    if(m==1){
        cout << n-2;
        return 0;
    }
    cout << (n-2)*(m-2);

}


Measured memory_bytes: 3616
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

a,b=MI()
def kaibunn(n):
    u=str(n)
    if u[0]==u[4] and u[1]==u[3]:
        return 1
    else:
        return 0
ans=0
for i in range(a,b+1):
    ans+=kaibunn(i)
print(ans)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
template <long long mod>
class Combination
{
    std::vector<long long> fact, finv, inv;
public:
    Combination() {}
    Combination(int sz)
    {
        fact.resize(sz);
        finv.resize(sz);
        inv.resize(sz);
        fact[0] = 1;
        for (int i = 1; i < sz; ++i)
        {
            fact[i] = fact[i - 1] * i % mod;
        }
        inv[0] = 0;
        inv[1] = 1;
        for (int i = 2; i < sz; ++i)
        {
            inv[i] = mod - inv[mod % i] * (mod / i) % mod;
        }
        finv[0] = 1;
        for (int i = 1; i < sz; ++i)
        {
            finv[i] = finv[i - 1] * inv[i] % mod;
        }
    }
    long long C(long long n, long long k)
    {
        if (n < k)
            return 0;
        if (n < 0 || k < 0)
            return 0;
        return (fact[n] * finv[k] % mod) * finv[n - k] % mod;
    }
    long long P(long long n, long long k)
    {
        if (n < k)
            return 0;
        if (n < 0 || k < 0)
            return 0;
        return fact[n] * finv[n - k] % mod;
    }
    long long H(long long n, long long k)
    {
        return this->C(n + k - 1, k);
    }
    long long getfact(int i)
    {
        return fact[i];
    }
    long long getinv(int i)
    {
        return inv[i];
    }
    long long getfinv(int i)
    {
        return finv[i];
    }
};
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;
const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}
template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}
template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}
template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for(int i=0;i<((int)(v.size()));++i) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}
vll perf;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int ma = 1000000;
  Combination<MOD> comb(ma);
  perf.resize(ma);
  perf[2] = 1;
  for(int i=(3);i<(ma);++i) {
    perf[i] = (i-1) * ((perf[i-1] + perf[i-2]) % MOD) % MOD;
  }
  ll n, m; cin >> n >> m;
  ll ans = comb.P(m, n);
  ll su = 0;
  ll sig = 1;
  for(int i=0;i<(n+1);++i) {
    ll tmp = comb.C(n, i);
    tmp *= (sig + MOD) % MOD;
    tmp %= MOD;
    sig = -sig;
    tmp *= comb.C(m-i, n-i);
    tmp %= MOD;
    tmp *= comb.getfact(n-i);
    tmp %= MOD;
    su += tmp;
    su %= MOD;
  }
  ans *= su;
  ans %= MOD;
  cout << ans << endl;
}


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

namespace testes
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();
            int slimes = S.Length;
            int ans = 0;
            int count = 0;
            
            for(int i = 0; i < slimes - 1; i++)
            {
                if(S[i] == S[i + 1])
                {
                    count++;
                }  
            }

            Console.WriteLine(slimes - count);

           
        }

        static bool AAABBB(long target, long N,long K, long[] F, long[] A)
        {
            long count = 0, need;
            for (long i = 0; i < N; i++)
            {
                need = target / F[i];
                count += Math.Max(0, A[i] - need);
            }
            return count <= K;
        }
        public static long LIS(long[] c)
        {
            // 部分数列和
            long count = 1;
            long N = c.Length;
            long[] array = new long[N];
            array[0] = c[0];

            for (long i = 1; i < N; i++)
            {
                //for (long p = 0; p < N; p++) Console.Write($"{array[p]},");
                // Console.WriteLine("");
                if (array[count - 1] < c[i])
                {
                    array[count] = c[i];
                    count++;
                    continue;
                }
                for (long j = count - 2; j >= 0; j--)
                {
                    if (array[j] < c[i])
                    {
                        array[j + 1] = c[i];
                        break;
                    }
                }
                if(array[0] > c[i])array[0] = c[i];
            }
            return count;
        }
        public static void Rotation(char[] array, long l, long r)
        {          
        }      
    }   
}

/*
long a, b, c;
a = long.Parse(Console.ReadLine()); //標準入力
string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
b = long.Parse(str[0]);  //数値で受け取りたい場合は変換する
c = long.Parse(str[1]);
string S = Console.ReadLine();
char[] C = new char[N];
C = S.ToCharArray();
Console.Write("改行なし a = {0} b = {1} c = {2}", a, b, c)//改行なし出力
Console.WriteLine("改行あり a = {0} b = {1} c = {2}", a, b, c);//改行付き出力
Member = ReadLine().Split(' ').Select(long.Parse).ToArray();

string[] str = Console.ReadLine().Split(' ');
long[] a = new long[N];
for(long i = 0; i < N; i++) a[i] = long.Parse(str[i]);
 */


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

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

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

	bool check = false;
	for(int i = 0; i <= 100; i++)
		if((N-i*4 >= 0 && (N-i*4)%7 == 0) || (N-i*7 >= 0 && (N-i*7)%4 == 0))
			check = true;

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

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
#define double long double
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
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(a>b){a=b; return true;} return false;}
template<class T> T div_floor(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>=0 ? a/b : (a+1)/b-1;
}
template<class T> T div_ceil(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>0 ? (a-1)/b+1 : a/b;
}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod * mod;
constexpr int MAX = 100010;

int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    char c[m][n];
    rep(i, m)rep(j, n) scanf(" %c", &c[i][j]);
    int wsum[n+1], esum[n+1];
    wsum[n] = esum[0] = 0;
    rep(i, n){
        int w = 0;
        rep(j, m) w += (c[j][i] == 'W');
        wsum[i] = w;
        esum[i+1] = m-w;
    }
    rrep(i, n) wsum[i] += wsum[i+1];
    rep(i, n) esum[i+1] += esum[i];
    int tmp = mod, id = -1;
    rep(i, n+1)if(chmin(tmp, wsum[i] + esum[i])) id = i;
    printf("%d %d\n", id, id+1);
}


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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair

int main() {
  int n, a, b;
  cin >> n >> a >> b;
  if ((b - a) % 2 == 0) {
    cout << "Alice" << endl;
  }
  else {
    cout << "Borys" << endl;
  }
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <string.h>
#include <string>
#include <complex>
using namespace std;

#define INT_max 2147483647


typedef long long ll;
typedef long double ld;


int main(){
	double t;
	cin>>t;
	double ans = (t/3)*(t/3)*(t/3);
	printf("%.6lf",ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;



int main(){
  int N, M, Q; cin >> N >> M >> Q;
  vector<vector<int>> train(N, vector<int>(N, 0));
  int l, r;
  rep(i,M){
    cin >> l >> r;
    l--; r--;
    train[l][r]++;
  }
  vector<vector<int>>sums = train;
  rep(y,N){
    rep(x,N){
      if(x==0) continue;
      sums[y][x] += sums[y][x-1];
    }
  }
  rep(x,N){
    rep(y,N){
      if(y==0) continue;
      sums[y][x] += sums[y-1][x];
    }
  }
  int p, q;
  rep(i,Q){
    cin >> p >> q;
    p--; q--;
    int ans = sums[q][q];
    if(p!=0) ans = ans - sums[p-1][q] - sums[q][p-1] + sums[p-1][p-1];
    cout << ans << endl;
  }

  return 0;
}


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

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C& _a4, C _b4) { _a4 = min(_a4, _b4); }
template<class C> void maxi(C& _a4, C _b4) { _a4 = max(_a4, _b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream& operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto& vv : V) os << vv << ","; os << "]";
  return os;
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

string x = "CODEFESTIVAL2016",y;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> y;
  int res = 0;
  R(i,SZ(y)){
    if(x[i] != y[i]){
      res ++;
    }
  }
  cout << res << "\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
 	int N;
	cin >> N;
	int S, M;
	S = 0;
	M = N;
	for (int i=0; i<10; i++){
		S += M %10;
		M /= 10;
	}
	if (N%S == 0){
		cout << "Yes" << endl;
	}
	if (N%S != 0){
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);



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

  int odd = k/2;
  int ans = odd * (k-odd);
  cout << ans << endl; 
  return 0;
}


Measured memory_bytes: 3624
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(s: str):
    start = s.find("A")
    end = s.rfind("Z")
    print(end-start+1)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    solve(s)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3508
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <fstream>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    cout << 6 - a - b;
}


Measured memory_bytes: 3608
#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
const double eps=1e-10;
double adj[21][21];
bool visited[20]={false};
#define MAOU 20

bool backTrack(int last,double r,int now,int n,
	   bool *visited){
  rep(i,n){
    if ( visited[i]==false && adj[MAOU][i]<=r)return false;
    if ( visited[i]==false &&  adj[MAOU][i]<=r+adj[last][i])return false;
  }
  if ( now == n)return true;
  
  rep(i,n){
    if ( visited[i]==true)continue;
    visited[i]=true;
    if ( backTrack(i,r+adj[last][i],now+1,n,visited))return true;
    visited[i]=false;
  }
  return false;
}

double dist(int x,int y){
  return sqrt(x*x+y*y);
}

int solve(int n,int *x,int *y,int rx,int ry,int mx,int my){
  rep(i,n){
    adj[i][i]=0;
    adj[MAOU][i]=adj[i][MAOU]=dist(x[i]-rx,y[i]-ry);
    REP(j,i+1,n){
      adj[i][j]=adj[j][i]=dist(x[i]-x[j],y[i]-y[j]);
    }
    if ( dist(mx-x[i],my-y[i])+eps>dist(rx-x[i],ry-y[i]))return false;
    visited[i]=false;
  }
  
  rep(i,n){
    visited[i]=true;
    if ( backTrack(i,dist(mx-x[i],my-y[i]),1,n,visited))return true;
    visited[i]=false;
  }
  return false;
}

main(){
  int n,mx,my,rx,ry;
  while(scanf("%d%d%d%d%d",&n,&mx,&my,&rx,&ry) && n){
    int x[n],y[n];
    rep(i,n)scanf("%d%d",&x[i],&y[i]);
    if ( solve(n,x,y,rx,ry,mx,my))puts("YES");
    else puts("NO");
  }
}

Measured memory_bytes: 844
#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)
template<class T>bool chmin(T&a,const T&b){return a>b?(a=b,true):false;}
template<class T>bool chmax(T&a,const T&b){return a<b?(a=b,true):false;}

int nextInt() {
  int x; scanf("%d", &x); return x;
}

int color(int rate) {
  if (2400 <= rate && rate <= 2799) return 6;
  if (2800 <= rate && rate <= 3199) return 7;
  if (3100 <= rate) return 8;
  return rate / 400;
}

int main2() {
  int N = nextInt();
  set<int> colors;
  int any = 0;
  REP(i, N) {
    int c = color(nextInt());
    if (c == 8) 
      any++;
    else
      colors.insert(c);
  }
  int ans1 = max(1, (int)colors.size());
  int ans2 = colors.size() + any;
  cout << ans1 << " " << ans2 << endl;

  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws) main2();
  return 0;
}


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

int a[100001],b[100001];
int main(){
    int n,ai;
    cin>>n;
    int cnt=0;
    rep(i,n){
        cin>>ai;
        a[i]=b[i]=ai;
    }
    sort(a,a+n);
    rep(i,n){
        b[i]=lower_bound(a,a+n,b[i])-a;
    }
    rep(i,n){
        if(i%2!=b[i]%2) ++cnt;
    }
    cout<<cnt/2<<endl;
    return 0;
}

Measured memory_bytes: 1152
n,l = map(int,input().split())
lista = range(n)
listb = []
for i in range(n):
    listb.append(abs(lista[i]+l))
a = listb.index(min(listb))
listc = []
for i in range(n):
    listc.append(lista[i]+l)
listc[a] = 0
print(sum(listc))

Measured memory_bytes: 3064
n = int(input())

value = map(int,input().split())
cost = map(int,input().split())
value = list(value)
cost = list(cost)

sum = 0
for i in range(n):
  v = value[i]
  c = cost[i]
  if v > c:
    sum += v-c

print(sum)
  

Measured memory_bytes: 38256
#include <stdio.h>
#include <math.h>
  
 
int main(void)
{
 
    int  a,b,c;
    double  d,S,L,H,C,PI =3.14159265;
     
     
    scanf("%d %d %d",&a,&b,&c);
 
     
    C = PI * c/180;
    d = 0.5;
 
    S =  d * a * b * sin(C);
     
    L = a*a + b*b -2*a*b*cos(C);
 
    L = sqrt(L);
 
    L = a + b + L;
 
    H = sin(C) * b;
 
     
 
    printf("%f\n",S);
 
    printf("%f\n",L);
 
    printf("%f\n",H);
 
 
 
     
     
    return 0;
}

Measured memory_bytes: 636
import java.io.*;

class Main
{
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String bc[] = br.readLine().split(" ",0);
		int a = Integer.parseInt(bc[0]);
		int b = Integer.parseInt(bc[1]);
		int c = Integer.parseInt(bc[2]);
		
		if (a <= c && c <= b) {
			System.out.println("Yes");	
		}else{
			System.out.println("No");
		}
		
	}
}

Measured memory_bytes: 22740
#include <iostream>
#include <complex>
#include <cmath>
#include <iomanip>
using namespace std;

static const double pi = std::acos(-1.0); // お手軽に π を得る。

int main()
{
    double A, B, H, M;
    double HH, MM;
    
    cin >> A >> B >> H >> M;

    HH = 2.0*pi*H/12.0+pi/6.0*M/60.0;
    MM = 2.0*pi*M/60.0;

    std::complex<double> A_H = std::polar(A,pi/2.0-HH);
    std::complex<double> B_M = std::polar(B,pi/2.0-MM);

    // cout << A_H << endl;
    // cout << B_M << endl;
    // cout << real(A_H)-real(B_M) << endl;
    // cout << imag(A_H)-imag(B_M) << endl;

    std::cout << std::setprecision(20) << sqrt(pow(abs(real(A_H)-real(B_M)),2)+pow(abs(imag(A_H)-imag(B_M)),2)) << endl;

    // cin >> A;
    return 0;
}

Measured memory_bytes: 4056
H , W= map(int, input().split())
que = [(0, 0)]
S = [input() for i in range(H)]
flag = [[1<<30 for i in range(W)] for j in range(H)]
flag[0][0] = 1
cnt = sum(row.count('.') for row in S)
while que:
	y, x = que.pop(0)
	for ny, nx in [1, 0], [-1, 0], [0, 1], [0, -1]:
		nx += x
		ny += y
		if ny >= 0 and nx >= 0 and ny < H and nx < W and S[ny][nx] != '#' and flag[ny][nx] > flag[y][x] + 1:
			que.append((ny, nx))
			flag[ny][nx] = flag[y][x] + 1
			if (ny, nx) == (H - 1, W - 1):
				print(cnt - flag[ny][nx])
				exit()
print(-1)

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

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

const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const double eps = 1e-9;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
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; }

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

    char tmp = s[0];
    int ans = 0;

    for (int i = 1; i < int(s.size()); i++) {
        if (tmp != s[i]) {
            ans++;
            tmp = s[i];
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define ll long long
int main()
{
    ll t,n,i,j,k,l,m,f,a,b,c,d,s;
    string s1,s2,s3;
    cin>>s1;
    d=INT_MAX;
    for(i=0;i+2<s1.size();i++)
    {
        s2.push_back(s1[i]);
        s2.push_back(s1[i+1]);
        s2.push_back(s1[i+2]);
        stringstream ss;
        ss<<s2;
        ss>>k;
        if(abs(k-753)<d)
        {
            d=abs(753-k);
        }
        s2.clear();
    }
    cout<<d<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <cmath>
#define endl "\n"
using namespace std;

void solve(int n)
{

}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n; cin >> n; string s; int ac=0,wa=0,tle=0,re=0;
    while(n--)
    {
        cin >> s;
        if(s=="AC")++ac;
        else if(s=="WA")++wa;
        else if(s=="TLE")++tle;
        else ++re;
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
}

Measured memory_bytes: 3660
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

d = min(a,b,c)

ans = 0
if d == a:
    ans = d + min(b,c)
elif d == b:
    ans = d + min(a,c)
else:
    ans = d + min(a,b)
print(ans)




Measured memory_bytes: 9040
# 100の位r,10の位g,1の位ｂに整数を入力
r,g,b = map(int,input().split())
# 100r+10g+bが4の倍数ならYES、違うならNO
if (100 * r + 10 * g + b) % 4 == 0:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 9164
#pragma GCC optimize("O3")
#pragma GCC optimize("O1")
#pragma GCC optimize("O2")
#pragma GCC optimize("Os")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);
#define FO cout.tie(NULL);
#define FI cin.tie(NULL);
#define IN cin>>
#define OUT cout<<
#define loop(i,a,n) for(int i=a; i<n; i++)
#define rloop(i,a,n) for(int i=a; i>=n; i--)
#define endl "\n";
#define pb push_back
#define mp make_pair
#define set_bits(a) __builtin_popcountll(a)
#define ll long long int
#define ld long double
#define vll vector<long long int>
#define pll pair<long long int, long long int>
#define mod 1000000007
#define M 998244353
ll gcd(ll a, ll b)
{
    return (b?gcd(b,a%b):a);
}
ll P(ll B, ll power, ll modulo)
{
    ll ans=1LL;
    while(power>0LL)
    {
        if(power%2LL==1LL)
        {
            ans=(ans*B)%modulo;
        }
        B=(B*B)%modulo;
        power/=2LL;
    }
    return ans;
}
bool isPrime(ll n)
{
    if(n<=1LL)
    {
        return false;
    }
    if(n<=3LL)
    {
        return true;
    }
    if(n%2==0LL || n%3==0LL)
    {
        return false;
    }
    for(ll i=5LL; (i*i)<=n; i+=6LL)
    {
        if(n%i==0LL || n%(i+2LL)==0LL)
        {
            return false;
        }
    }
    return true;
}
using namespace std;
bool sortbysec(const pair<pair<int,int>,int> &a, const pair<pair<int,int>,int> &b)
{
    return (a.first.second<b.first.second);
}
bool sortbysecll(const pll &a, const pll &b)
{
    return (a.second<b.second);
}
ll modinv(ll x, ll y, ll modulo)
{
    return ((x%modulo)*(P(y,modulo-2LL,modulo)%modulo))%modulo;
}
bool comp(const array<int,4> &a, const array<int,4> &b)
{
    return a[3]>b[3];
}
void vok()
{
    FAST
    FO
    FI
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt","r",stdin);
    //     freopen("output.txt","w",stdout);
    // #endif
}
int main()
{
    vok();
    ll a,b,n;
    IN a>>b>>n;
    ll x=min(n,b-1);
    ll p1=(a*x)/b;
    ll p2=x/b;
    ll ans=p1-(a*p2);
    OUT ans<<endl
    return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
using namespace std;

int main() {
	map<long long int, long long int>mp;
	//cout << fixed << setprecision(10);
	long long int n, m,k;
	cin >> n >> m>>k;
	for (int i = 1; i <= 10; i++) {
		k = n * k - m;
		cout << k << endl;
	}
	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;

int main(){
  int n,m,x;cin>>n>>m>>x;
  int ans1=0,ans2=0;
  rep(i,m){
    int a;cin>>a;
    if(x<=a&&a<=n)ans1++;
    if(a<=x)ans2++;
  }
  cout << min(ans1,ans2);
}


Measured memory_bytes: 256
#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;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = a;i < b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = b-1;i >= a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;

const ll INF=(1LL<<50);
#if __cplusplus>=201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif

template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}


template<typename T>
T genpow(T a,unsigned long long b){
  T base=a,ans=T(1LL);
  while(b){
    if(b&1){
      ans=ans*base;
    }
    base=base*base;
    b>>=1;
  }
  return ans;
}

pair<pll,pll> maxmin(pll a,pll b){
  return make_pair(max(a,b),min(a,b));
}
int main(){
    ll N;
    cin>>N;
    ll NN=genpow(2,N);
    vector<ll> A(NN);
    REP(NN)cin>>A[i];
    vector<pair<pll,pll>> B(NN);
    REP(NN){
      B[i]=make_pair(pll(A[i],i),pll(0,-1));
    }
    For(i,N)For(j,1<<N){
      if(j&(1<<i)){
        ll tmp=j^(1<<i);
        if(B[j].first!=B[tmp].first){
          B[j]=max(B[j],maxmin(B[j].first,B[tmp].first));
        }else{
          B[j]=max(B[j],max(maxmin(B[j].first,B[tmp].second),maxmin(B[j].second,B[tmp].first)));
        }
      }
    }
    ll mx=0;
    FOR(k,1,NN){
      mx=max(mx,B[k].first.first+B[k].second.first);
      cout<<mx<<endl;
    }
    return 0;
}


Measured memory_bytes: 13312
n, m = map(int, input().split())
to = [False for i in range(n)]
fr = [False for i in range(n)]
for i in range(m):
	a, b = map(int, input().split())
	a -= 1
	b -= 1
	if a == 0: to[b] = True
	if b == n - 1: fr[a] = True
flg = False
for i in range(1, n - 1):
	if to[i] and fr[i]: flg = True
print("POSSIBLE" if flg else "IMPOSSIBLE")


Measured memory_bytes: 6296
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = 0

for x in range(n):
    if a[x] <= b[x]:
        b[x] -= a[x]
        c += a[x]
        a[x] = 0
    else:
        c += b[x]
        b[x] = 0

    if b[x] != 0:
        if a[x + 1] >= b[x]:
            a[x + 1] -= b[x]
            c += b[x]
        else:
            c += a[x + 1]
            a[x + 1] = 0

print(c)

Measured memory_bytes: 18624
#include <stdio.h>

using namespace std;

int main(){
	char str[20001];
	int m,tmp,length;
	while(true){
		scanf("%s",str);
		if(str[0] == '-') break;
		length = 0;
		for(int k = 0; str[k] != '\0';k++) length++;
		scanf("%d",&m);
		int index = 0;
		for(int i = 0; i < m; i++){
			scanf("%d",&tmp);
			for(int j = 0; j < tmp; j++){
				str[index+length] = str[index];
				index++;
			}
		}
		for(int p = 0; p < length; p++){
			printf("%c",str[index+p]);
		}
		printf("\n");
	}
}

Measured memory_bytes: 1004
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)()
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<int,int> p;
//const ll big=998244353;
const ll big=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}
ll inv(ll x){
    return expm(x,big-2);
}

int dfs(int now,vector<vector<int>> &graph,vector<int> &dp){
    if(dp[now]!=-1)return dp[now];
    dp[now]=0;
    for(int nx:graph[now]){
        dp[now]=max(dp[now],dfs(nx,graph,dp)+1);
    }
    return dp[now];
}

int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/

    int n,m;cin >> n >> m;
    vector<vector<int>> graph(n);
    rep(i,m){
        int x,y;cin >> x >> y;
        x--;y--;
        graph[x].push_back(y);
    }

    vector<int> dp(n,-1);
    int ans=0;
    rep(i,n){
        dfs(i,graph,dp);
        ans=max(ans,dp[i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 11016
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    X, A = map(int, input().split())
    print(0) if X < A else print(10)

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc130","a",main)

Measured memory_bytes: 2940
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include<math.h>
struct Point {
  double x;
  double y;
};
struct Point *p;
double **dist;
double btsp(int size);
int main(void)
{
  int i, n;
  scanf("%d", &n);
  p = (struct Point*)malloc(sizeof(struct Point) * n);
  dist = (double**)malloc(sizeof(double*) * n);
  for (i = 0; i < n; i++) {
    dist[i] = (double*)malloc(sizeof(double) * n);
    scanf("%lf%lf", &p[i].x, &p[i].y);
  }
  printf("%f\n", btsp(n));
  for (i = 0; i < n; i++) free(dist[i]);
  free(dist);
  free(p);
}
double btsp(int size)
{
  int i, j, k;
  double t, ans;
  for (j = 0; j < size; j++) {
    for (i = 0; i < j; i++) {
      if (i == 0 && j == 1) dist[i][j] = hypot(p[i].x - p[j].x, p[i].y - p[j].y);
      else if (i < j - 1) dist[i][j] = dist[i][j-1] +  hypot(p[j-1].x - p[j].x, p[j-1].y - p[j].y);
      else {
        dist[i][j] = INT_MAX;
        for (k = 0; k < i; k++){
          t = dist[k][i] +  hypot(p[k].x - p[j].x, p[k].y - p[j].y);
          if (t < dist[i][j]) dist[i][j] = t;
        }
      }
    }
  }
  ans = INT_MAX;
  for (i = 0; i < size - 1; i++) {
    t = dist[i][size-1] +  hypot(p[i].x - p[size-1].x, p[i].y - p[size-1].y);
    if (t < ans) ans = t;
  }
  return ans;
}


Measured memory_bytes: 8532
object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in.tail.head.split(' ').map(_.toLong).toArray
  
  @scala.annotation.tailrec
  private def func(count:Int):Int = {    
    
    val l = ls.indexWhere(_ > 0)
    if(l == -1) return count
    
    val tmp = ls.drop(l).indexWhere(_ == 0)
    var r = if(tmp == -1) ls.size-1 else l + tmp-1
    
    //println(l, r)
    (l to r).foreach{ i =>
      ls(i) -= 1
    }
    func(count+1)
  }
  val ret = func(0)
  println(ret)
}


Measured memory_bytes: 27992
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
using Graph = vector<vector<int>>;
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true;
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue;
        dfs(G, next_v); // 再帰的に探索
    }
}
int main()
{
	int N,M;
	cin>> N>>M;
	Graph G(N);
	
	for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a-1].push_back(b-1);
        G[b-1].push_back(a-1);
    }
	int count = 0;
    seen.assign(N, false);
    for (int v = 0; v < N; ++v) {
        if (seen[v]) continue; // v が探索済みだったらスルー
        dfs(G, v); // v が未探索なら v を始点とした DFS を行う
        ++count;
    }
	int ans = count - 1;
	cout<<ans<<endl;
}

Measured memory_bytes: 9576
#include <iostream>

using namespace std;

int main(void){
	int n;
	cin >> n;
	
	for(int i = 0; i < n; i++) {
		int a,b,c;
		cin >> a >> b >> c;
		if( a*a + b*b == c*c || 
			b*b + c*c == a*a ||
			c*c + a*a == b*b ) {
				cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
    return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;

const int INF = INT_MAX;
const long long INFL = 1LL<<40;
const double PI = atan(1)*4;
//const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}

bool is_in(pii c, pii p, int r){
    
    
    return pow((p.first - c.first),2) + pow((p.second - c.second),2) <= r*r;
    
}


int main() {
    ll N;cin>>N;
    
    repsg(n,1,3501){
        repsg(h,1,3501){
            if((4*n*h - n*N - h*N)==0)continue;
            if((N*n*h)%(4*n*h - n*N - h*N) != 0) continue;
            ll k = (N*n*h)/(4*n*h - n*N - h*N);
            
            if(k<=0) continue;
            
            cout<<h <<" " << n<<" " << k << endl;
            return 0;
        }
    }
    return 0;
}


// (4/N-1/h-1/n) = 1/w

/// ((4nh - nN - hN) / (Nhn)
// w(4nh - nN - hN) = Nhn;













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

using namespace std;

const int INF = 1e9 + 7;

void solve()
{
  int x, a, b;
  cin >> x >> a >> b;
  if(b - a <= 0) {
    cout << "delicious\n";
  } else if (b - a <= x) {
    cout << "safe\n";
  } else {
    cout << "dangerous\n";
  }
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main(){
    ll n, m; cin >> n >> m;
    vector<ll> a(100100);
    rep(i, n) a[i] = 1;
    vector<bool> flag(100100, false);
    flag[0] = true;
    vector<ll> x(100100);
    vector<ll> y(100100);
    rep(i, m){
        cin >> x[i] >> y[i];
        x[i]--, y[i]--;
    }
    rep(i, m){
        a[x[i]]--;
        a[y[i]]++;
        if(flag[x[i]]){
            flag[y[i]] = true;
            if(a[x[i]] == 0)flag[x[i]] = false;
        }
    }
    ll count = 0;
    rep(i, n) if(flag[i])count++;
    cout << count << endl;
}

Measured memory_bytes: 2560
use std::io;
use std::collections::VecDeque;

fn main() {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin
        .read_line(&mut buf)
        .expect("ERROR Can't read array size");
    let n:usize = buf.trim().parse().unwrap();
    let mut graph: Vec<Vec<usize>> = Vec::with_capacity(n);
    for _ in 0..n {
        graph.push(Vec::new());
    }
    for _ in 0..n-1 {
        let mut buf = String::new();
        stdin
            .read_line(&mut buf)
            .expect("ERROR Can't read array size");
        let v: Vec<usize> = buf.split_whitespace()
            .map(|n| n.parse().unwrap())
            .collect();
        let a = v[0]-1;
        let b = v[1]-1;
        graph.get_mut(a).unwrap().push(b);
        graph.get_mut(b).unwrap().push(a);
    }
    let mut used: Vec<bool> = Vec::new();
    used.resize(n, false);
    let mut sa = 0;
    let mut sb = 0;

    let mut aque = VecDeque::new();
    let mut bque = VecDeque::new();
    aque.push_back(0);
    bque.push_back(n-1);

    while !aque.is_empty() || !bque.is_empty() {
        let mut aque_new = VecDeque::new();
        while !aque.is_empty() {
            let tar = aque.pop_front().unwrap();
            if !used[tar] {
                used[tar] = true;
                sa += 1;
                for val in graph[tar].iter() {
                    aque_new.push_back(*val);
                }
            }
        }
        aque.append(&mut aque_new);
        let mut bque_new = VecDeque::new();
        while !bque.is_empty() {
            let tar = bque.pop_front().unwrap();
            if !used[tar] {
                sb += 1;
                used[tar] = true;
                for val in graph[tar].iter() {
                    bque_new.push_back(*val);
                }
            }
        }
        bque.append(&mut bque_new);
    }
    if sa > sb {
        println!("Fennec");
    } else {
        println!("Snuke");
    }


}


Measured memory_bytes: 12540
#include <stdio.h>
#include <math.h>
int main(){
	int a,b,h,m,c,d,t;
	double e,ans;
	scanf("%d%d%d%d",&a,&b,&h,&m);
	c=60*h+m,d=12*m;
	if(c<d)t=c,c=d,d=t;
	e=(c-d)*2*M_PI/720;
	ans=sqrt(a*a+b*b-2*a*b*cos(e));
	printf("%.12lf\n",ans);
	return 0;
}

Measured memory_bytes: 3672
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <climits>
#include <cassert>
#include <algorithm>
#include <utility>

using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;
using VVI = vector<vector<long long int> >;

int main(void) {
    string s;
    cin >> s;
    cout << s.substr(0, 3) << endl;
    return 0;
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
 
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long POM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[n - k] % MOD) % MOD;
}
ll n,k;
vector<ll> v[100005];
bool used[100005];
ll rec(ll pos){
    ll num = 0;
    ll res = 0;
    ll ans = 1;
    rep(i,v[pos].size()){
        ll to = v[pos][i];
        if(!used[to]){
            num++;
            used[to] = true;
            ans = ans * rec(to) % MOD;
        }
        else res++;
    }
    ans = ans * POM(k-1-res, num) % MOD;
    return ans ;

}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  COMinit();
  cin >> n >> k;
  rep(i,n-1){
      ll a,b; cin >> a >> b;
      a--;b--;
      v[a].push_back(b);
      v[b].push_back(a);
  }
  used[0] = true;
  cout << k * rec(0) %MOD << endl;
}

Measured memory_bytes: 22528
N = int(input())
S = list(map(int,input().split()))

if N < 3:
  print(0)
  exit(0)

import itertools as it
per = it.combinations(S,r=3)

cnt = 0
for r in per:
  a,b,c = r
  if a ==  b or b == c or a == c:
    continue
    
  if a+b > c and b+c > a and a+c > b:
    #print(a,b,c)
    cnt += 1
    
print(cnt)


Measured memory_bytes: 9172