akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <math.h>

int main(void){
    int N,M,X;
    int C[12];
    int A[12][12];
    int minsum = 100000000;
    int ans = -1;
    
    scanf("%d%d%d",&N,&M,&X);
    
    for(int i = 0; i < N; i++){
        scanf("%d",&C[i]);
        for(int j = 0; j < M; j++){
            scanf("%d",&A[i][j]);
        }
    }
    
    for(int i = 1; i < (int)pow(2,N); i++){
        int und[12] = {};
        int sum = 0;
        
        for(int j = 0; j < N; j++){
            if((i >> j & 1) == 1){
                sum += C[j];
                for(int z = 0; z < M; z++){
                    und[z] += A[j][z];
                }
            }
        }
        
        int flag = 1;
        for(int j = 0; j < M; j++){
            if(und[j] < X){
                flag = 0;
                break;
            }
        }
        
        if(flag == 1 && minsum > sum){
            minsum = sum;
            ans = i;
        }
    }
    
    if(ans == -1){
        printf("-1\n");
    }
    else{
        printf("%d\n",minsum);
    }
}


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


using namespace std;


int sum(vector<int> w) {
    int ret = 0;
    for (int e: w) {
        ret += e;
    }
    return ret;
}


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

    vector<int> w(n);
    for (int i=0; i<n; i++) cin >> w[i];

    int l = 0;
    int r = sum(w);

    int ans = 1001001001;
    for (int i=0; i<n; i++) {
        l += w[i];
        r -= w[i];
        ans = min(ans, abs(l-r));
    }

    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 384
#include<stdio.h>

#include<stdio.h>
main( )
{
  int a, b, c,i ,num[3];

  for(i = 0 ; i < 3 ; i++)
    {
      scanf("%d",&num[i]);
    }
    
  if( num[0] > num[1])
    { a = num[0];
  num[0] = num[1];
  num[1] = a ;
    } 
  if(num[1] > num[2])
    { b = num[1];
  num[1] = num[2];
  num[2] = b;
  if(num[0] > num[1])
    {  c = num[0];
  num[0] = num[1];
  num[1] = c;
    }
    }
  printf("%d %d %d\n", num[0], num[1], num[2]);
  return 0;

}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <set>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main() {
  int a, b;
  cin >> a >> b;
  P(max({a + b, a - b, a * b}));
  return 0;
}



Measured memory_bytes: 256
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = in.readLine();
		
		while(!s.equals("0")){
			int num = 0;
			for(int i = 0; i < s.length(); i++){
				num += Integer.parseInt(s.substring(i, i+1));
			}
			System.out.println(num);
			s = in.readLine();
		}
	}

}

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

#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for (int i = (n); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main()
{
    int n, m;
    cin >> n >> m;
    OP(n * (n - 1) / 2 + m * (m - 1) / 2);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>func(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p;
}


int main() {
  int x,y;
  cin>>x>>y;
  if((4*x-y)%2==0&&4*x>=y&&2*x<=y&&abs(2*x-y)%2==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
  return 0;
}

Measured memory_bytes: 3616
#pragma region
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define vi vector<int>
#define vd vector<double>
#define vs vector<string>
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m-1);i>=(int)(n);i--)
#define rev(i, n) revi(i, n, 0)
#define each(i, n) for(auto&& i: n)
#define sz(v) ((int)(v).size()) 
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define uniq(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define dump(x) cerr << #x << " = " << x << endl
#define gcd __gcd
int lcm(int a, int b){return a / gcd(a, b) * b;}
const int INF = 1e18;
const int MOD = 1e9 + 7;
const double EPS = 1e-15;
const double PI = acos(-1);
int dig(int n){return (int)(log10(n) + 1);}
int abc(char x){return (int)(x)-(int)('a');} // 0~25
char abc(int x){return (char)(x+(int)('a'));} 
int ABC(char x){return (int)(x)-(int)('A');}
char ABC(int x){return (char)(x+(int)('A'));}
void solve();
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	solve();
}
#pragma endregion

void solve() {
	int N; cin >> N;
	vi A(N), B(N), C(N-1);
	rep(i, N) cin >> A[i];
	rep(i, N) cin >> B[i];
	rep(i, N-1) cin >> C[i];
	int ans = 0;
	int p = -1;
	each(a, A) {
		ans += B[a - 1];
		if (a == p + 1) ans += C[a - 2];
		p = a;
	}
	cout << ans << endl;
}

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

using namespace std;
using ll = long long;


bool cmp(pair<ll, ll> a, pair<ll, ll> b){
  return a.second < b.second;
}


int main(){
  ll n;
  cin >> n;
  vector<pair<ll, ll>> ab(n);
  for(int i=0; i<n; i++){
    cin >> ab[i].first >> ab[i].second;
  }
  sort(ab.begin(), ab.end(), cmp);
  
  
  bool flag = true;
  ll sum = 0;
  for(int i=0; i<n; i++){
    sum += ab[i].first;
    if(sum>ab[i].second) flag = false;
  }
  
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

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



class Myon
{
    public Myon() { }
    public static int Main()
    {
        cin = new Scanner();
        new Myon().calc();
        return 0;
    }

    static Scanner cin;

    void calc()
    {
        string S = cin.next();

        const int N = 13;
        //dp[k] -> 13で割った余りがKのパターン数
        long[] dp = new long[N];
        dp[0] = 1;

        //後ろから解くアルゴリズム
        // 1?2?3   0 -> 3 -> ?3 -> 2?3 -> ...
        long mod = 1000000007;

        int mul = 1;
        for (int i = S.Length - 1; i >= 0; i--)
        {
            //次の状態
            long[] nextDP = new long[N];

            char c = S[i];
            if(c == '?')
            {
                for (int k = 0; k < 10; k++)
                {
                    for (int j = 0; j < N; j++)
                    {
                        nextDP[(k * mul + j) % N] += dp[j];
                        nextDP[(k * mul + j) % N] %= mod;
                    }
                }
            }
            else
            {
                int k = (int)(S[i] - '0');
                for (int j = 0; j < N; j++)
                {
                    nextDP[(k * mul + j) % N] += dp[j];
                    nextDP[(k * mul + j) % N] %= mod;
                }
            }

            mul *= 10;
            mul %= N;
            dp = nextDP;
        }

        Console.WriteLine(dp[5]);
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


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

int main() {
  int n;
  cin>>n;
  vector<int> a(n);
  int b=0,c=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a.begin(),a.end());
  for(int i=n-1;i>=0;i-=2){
    b+=a[i];
  }
  for(int i=n-2;i>=0;i-=2){
    c+=a[i];
  }
  cout<<b-c<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MOD	1000000007
#define int	long long
#define pii pair<int,int> 
#define vi vector<int>
using namespace std;

int power(int a, int b){ int S = 1; while(b--)S *= a; return S;}

int32_t main(){
	int n;
	cin >> n;
	int s = 1000*(n/500);
	n -= s/2;
	s += 5*(n/5);
	cout << s;

	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(void)
{
	int n;
	int i,j,k;
	int cnt;
	int len,flg,flg2;
	char ri[21];
	char ar[11];
	cnt=0;

	scanf("%s",ar);
	len=strlen(ar);
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",ri);
		for(j=0;j<10;j++){
			ri[j+10]=ri[j];
		}
		ri[20]='\0';
		flg2=0;
		for(j=0;j<20;j++){
			flg=1;
			for(k=0;k<len;k++){
				if(j+k>20){
					flg=0;
					break;
				}
				if(ar[k]!=ri[j+k]){
					flg=0;
				}
			}
			if(flg==1){
				flg2=1;
			}
		}
		if(flg2==1){
			cnt++;
		}
	}
	printf("%d\n",cnt);
	return 0;
}

				

Measured memory_bytes: 596
//#pragma GCC optimize("trapv")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
#include <x86intrin.h>
#define pb push_back
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;
const int maxn = 2e6 + 55, mod = 1000000007;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, m;
	cin >> n >> m, m = 2*m;
	vi a(n);
	int t = -1, eq = -1;
	uint64_t lc = 1;
	for(auto &i : a) {
		cin >> i;
		lc = lc*(i/__gcd((uint64_t)i, lc));
		if(lc>m) return cout << 0, 0;
		if(t==-1) t = __builtin_ctz(i);
		if(t!=__builtin_ctz(i)) return cout << 0, 0;
		if(eq == -1) eq = i;
		if(eq != i) eq = -2;
	}
	cout << 1 + ((m/lc) - 1)/2;
}


Measured memory_bytes: 640
import java.util.*;
 
public class Main{
      public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String str = sc.next();
            String[] str2 = str.split("");
              if("7".equals(str2[0]) || "7".equals(str2[1]) || "7".equals(str2[2])){
                System.out.println("Yes");
              } else {
                System.out.println("No");
              }
          }
}

Measured memory_bytes: 35536
a, b = map(int, input().split())
M = [['#']*100 for _ in range(50)] + [['.']*100 for _ in range(50)]

for i in range(a-1):
    M[(2*i//100)*2][2*i%100] = '.'

for i in range(b-1):
    M[99 - (2*i//100)*2][2*i%100] = '#'

print(100, 100) 
for l in M:
    print(''.join(l))

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

//C++14 (GCC 5.4.1)

#define LLINF (1LL<<60)
typedef long long ll;
#define mod 1000000007

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define rrepd(i,a,b) for(int i=(a);i>=(b);i--)

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

template<typename T> inline T divrup(T a, T b) { if (a % b) return a/b+1; else return a/b;}
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); }

#define dbg_v1(i,V) do{cout<<"-v1----\n";rep(i,V.size())cout<<" "<<i<<"\t:"<<V[i]<<endl;cout<<endl;}while(0)
#define dbg_v2(i,k,V) do{cout<<"-v2----\n";rep(i,V.size()){rep(k,V[0].size())cout<<" "<<V[i][k];cout<<endl;}}while(0)

int main() {
    ios::sync_with_stdio(false);//stdoutとcoutの同期解除
    cin.tie(nullptr);//cinとcoutの同期解除
    
    int N;
    cin >>N;

    vector<int> A(N),B(N);
    rep(i,N-1) cin >> B[i];
    A[0]=B[0];
    A[1]=B[0];
    repd(i,1,N-1){
        A[i+1]=B[i];
        if(A[i]>B[i])A[i]=B[i];
    }
/*
    dbg_v1(i,A);
    dbg_v1(i,B);*/
    int ans=0;
    rep(i,N) ans+=A[i];

    cout << ans <<endl;
    return (0);
}

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

#define ll long long
#define ld long double
#define pb push_back
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define umap unordered_map
#define uset unordered_set
#define forz(i, n) for (ll i = 0; i < n; i++)
#define fore(i, m, n) for (ll i = m; i <= n; i++)
#define forr(i, n, m) for (ll i = n; i >= m; i--)
#define itor(it,x) for(auto it=x.begin();it!=x.end();it++)
#define itor2(it,x) for(auto it=x->begin();it!=x->end();it++)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define deci(n) fixed << setprecision(n)
#define setbits(n) __builtin_popcountll(n)
#define zrobits(n) __builtin_ctzll(n)
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define gcd __gcd
#define raunak ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define pv(v) forz(qaz,v.size()) cout<<v[qaz]<<" "; cout<<endl;
#define pa(arr,n) forz(qaz,n) cout<<arr[qaz]<<" "; cout<<endl;

#define oset tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll po(ll a,ll b,ll m){
    ll res=1;
    while(b>0){
        if(b&1) res=((res%m)*(a%m))%m;
        a=((a%m)*(a%m))%m;
        b>>=1;
    }
    return res;
}
ll modi(ll a,ll m){
    return po(a,m-2,m);
}
ll lcm(ll a, ll b){ 
    return (a*b)/(gcd(a, b));
}

/////////////////////(^_^)/////////////////////(^_^)/////////////////////(^_^)/////////////////////

int main(){
    raunak;
    ll n,m,k;
    cin>>n>>m>>k;
    ll a[n];
    ll b[m];
    forz(i,n) cin>>a[i];
    forz(i,m) cin>>b[i];
    ll x=k;
    ll i=0;
    while(i<m){
        //p1(x);
        if(x-b[i]<0) break;
        x-=b[i];
        i++;

    }
    ll j=0;
    while(j<n){
        if(x-a[j]<0) break;
        x-=a[j];
        j++;
    }
    ll ans=i+j;
    //p3(i,j,x);
    i--;
    while(j<n&&i>=0){
        x+=b[i];
        i--;
        
        while(x>=a[j]&&j<n){
            //p3(i,j,x);
            x-=a[j];
            j++;
        }
        //p3(i,j,x);
        ans=max(ans,1+i+j);
    }
    p1(ans);


    return 0;
}

Measured memory_bytes: 6736
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
#define MOD 1000000007 
#define INF LONG_LONG_MAX
#define MINF LONG_LONG_MIN


ll po(ll x,ll n){
    if(n==0) return 1;
    else if(n%2 == 0) return po((x*x)%MOD,n/2);
    else return (x*po((x*x)%MOD,(n-1)/2))%MOD;
}



void init(){
    
}

void solve( ll  tst ){
    ld r;
    cin>>r;
    ld pi = 6.28318530717958623200;
    printf("%0.6Lf", pi*r);
    return;
}

int main(){
    FAST;
    init();
    //cout<<"init"<<endl;
    ll t = 1;
    //cin>>t;
    for (ll i=1;i<=t;i++ ) solve(i);
    return 0;
} 

Measured memory_bytes: 3816
#include<iostream>
using namespace std;
static const int N = 100;

int main(){
  int M[N][N];
  int n,u,k,v;

  cin >> n;

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++) M[i][j]=0;
  }

  for(int i=0;i<n;i++){
    cin >> u >> k;
    u--;
    for(int j=0;j<k;j++){
      cin >> v;
      v--;
      M[u][v]=1;
    }
  }

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(j) cout << " ";
      cout << M[i][j];
    }
    cout << endl;
  }

  return 0;
}



Measured memory_bytes: 3120
using System;
using System.Linq;
using System.Collections.Generic;
 
public class Digits
{
 
    public static void Main()
    {
      var res = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
      var N = res[0];
      var K = res[1];
      var cnt=1;
	  var D=K;
      while(true) {
      	if(D<=N){cnt++;D*=K;}
        else{break;}
      }
      Console.WriteLine(cnt);
      
    }
}

Measured memory_bytes: 13268
import java.util.*;

public class Main {
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  int n = sc.nextInt();
	  int x = sc.nextInt();
      
      int[] l = new int[n];
      for(int i = 0; i < n; i++) {
        l[i] = sc.nextInt();
      }
      
      int sum = 0;
      boolean flg = false;
      for(int i = 0; i < n; i++) {
        sum += l[i];
        if (sum > x) {
          System.out.println(i+1);
          flg = true;
          break;
        }
      }
      if (!flg) {
        System.out.println(n+1);
      }
	}
}

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

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long int x;
    cin>>x;
    long long int y=x;
    long long int a=360;
    long long int rotate=0;
    while(x%a!=0)
    {
        x+=y;
        rotate++;
    }
    cout<<rotate+1<<"\n";
}

Measured memory_bytes: 3608
import itertools as it

N = int(input())
A = [0] + list(map(int, input().split())) + [0]

L = 0
for i in range(N+1):
    L += abs(A[i+1] - A[i])
    
for i in range(1,N+1):
    print(L - (abs(A[i] - A[i-1]) + abs(A[i+1] - A[i])) + abs(A[i+1] - A[i-1]))


Measured memory_bytes: 14168
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
#include<assert.h>

using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
//SOLVE


void solve(void)
{

 
  double w, h, x, y;
  cin >> w >> h >> x >> y;
  double ans = w*h/2;
  cout<<ans<<" "<<endl;
  if(w/2 == x && h/2 == y) cout <<1<< endl;
  else cout <<0<< endl;
  
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
int ans=0;
        String s = sc.next();
        String t = sc.next();
        char[] ca = s.toCharArray();
        char[] cb = t.toCharArray();
for(int i=0;i<3;i++){
	if(ca[i]==cb[i]){
		ans++;
	}
}
        System.out.println(ans);
    }
}


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

typedef long long ll;
typedef double db;

#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1

const int mod   = 1e9 + 7;
const int maxn  = 3e6;
const int inf   = 2e9;

bool check(string now,int len)
{
    for(int i=0;i<len/2;i++)
        if(now[i]!=now[i+len/2])
            return false;
    return true;
}

int main() {
#ifdef LOCAL
    freopen("sample.in", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    string now;
    cin>>now;
    int len=now.length();
    if(len%2==0)
        len--;
    len/=2;
    int ans=0;
    for(int i=len;i>=0;i--)
    {
        if(check(now,i*2))
        {
            cout<<i*2<<endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  int m,f,r;
  while (true) {
    cin >> m >> f >> r;
    if(m == -1 && f == -1 && r == -1) break;
    if(m == -1 || f == -1) cout << 'F' << endl;
    else if(m + f >= 80) cout << 'A' << endl;
    else if(m + f >= 65) cout << 'B' << endl;
    else if(m + f >= 50) cout << 'C' << endl;
    else if(m + f >= 30){
      if(r >= 50) cout << 'C' << endl;
      else cout << 'D' << endl;
    }
    else cout << 'F' << endl;
  }
  return 0;
}


Measured memory_bytes: 3088
# -*- coding: utf-8 -*-
from sys import stdin
# from bisect import bisect_left
# import numpy as np

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()


MOD = 10**9 + 7


def check_length(list_):
    return len(list_) > len(set(list_))


N, M = ds_in()
NM = N * M
A_list = ds_in()
B_list = ds_in()
if check_length(A_list) or check_length(B_list):
    print(0)
    exit()

A_list.sort()
B_list.sort()

if A_list[-1] < NM or B_list[-1] < NM:
    print(0)
    exit()

ans = 1
a_idx = 0
b_idx = 0
for i in range(1, NM+1):
    flag = 1
    if i == A_list[a_idx]:
        n = 1
        a_idx += 1
        flag = 0
    else:
        n = N - a_idx

    if i == B_list[b_idx]:
        m = 1
        b_idx += 1
        flag = 0
    else:
        m = M - b_idx

    ans *= (n * m - flag * (NM - i))
    ans = ans % MOD

print(ans)


Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n, c = 0;
	cin >> n;
	int a[n];
	for (int i=0;i<n;i++) cin >> a[i];
	for (int i=0;i<n;i++){
		for (int j=n - 1;j>i;j--){
			if (a[j] < a[j - 1]){
				swap(a[j], a[j - 1]);
				c++;
			}
		}
	}
	for (int i=0;i<n;i++){
		cout << a[i];
		if (i == n - 1) break;
		cout << ' ';
	}
	cout << endl;
	cout << c << endl;
}


Measured memory_bytes: 3092
n = int(input())
b_list = list(map(int,input().split()))
a_list = [0]*n
a_list[0] = b_list[0]
a_list[-1] = b_list[-1]
for i in range(1,n-1):
    a_list[i] = min(b_list[i],b_list[i-1])
print(sum(a_list))

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

int main() {
	long long N, A[50], ANS = 0;
	cin >> N;
	for (int i = 0; i < N; i++) cin >> A[i];
	while (1) {
		long long COUNT = 0;
		for (int i = 0; i < N; i++) COUNT += A[i] / N;
		if (COUNT == 0) {
			cout << ANS;
			return 0;
		}
		ANS += COUNT;
		for (int i = 0; i < N; i++) {
			A[i] = A[i] - (A[i] / N) * N + COUNT - A[i] / N;
		}
	}
}

Measured memory_bytes: 256
//       Author: Mostafa Mounir Shehab
 
#include <bits/stdc++.h>
using namespace std;
 
#define PI  3.14159265  // PI = acos(-1)
#define EPS (1e-10)
#define endl "\n"
#define SZ(v) (int)(v.size())
typedef long long ll;
typedef long double ld;
//template <class Type>
 
 
void Fast(){
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL);
}
 
inline int D(){
	int t;
	scanf("%d",&t);
	return t;
}
inline ll llD(){
	ll t;
	scanf("%lld",&t);
	return t;
}
 
 
ll MOD=1e9 + 7; 
const int N=1e2 + 5,M=1e5 + 5;
ll pre[N];
ll arr[N];
ll dp[N][M];
ll OO=1e13; 
 
ll n,m,k,cnt,SU,idx,len,MN,MX,T,ans=1e6;
ll l,r,mid;
ll a,b,c,d;
vector<int> vec;
string str,s;

ll Solve(int idx,int val){
	
	if(idx == n)
		return val ? OO : 0;
	
	ll &ret = dp[idx][val];
	if(~ret)
		return ret;
	
	
	ll x = Solve(idx+1,val); 
	ll y = (val >= pre[idx]) ? arr[idx] + Solve(idx+1,val-pre[idx]) : OO;
	
	return ret = min(x,y);
	
}


 
int main(){
	
	memset(dp,-1,sizeof dp);
	
	scanf("%lld%lld",&n,&m);
	for(int i=0;i<n;++i)
		scanf("%lld%lld",arr+i,pre+i);
	
	for(ll i=0;i<M;++i)
		if(Solve(0,i) <= m)
			MX=max(MX,i);
	
	printf("%lld\n",MX);
	
	
	//cerr << "Time elapsed: " << clock() / 1000 << " ms" << endl;
}














Measured memory_bytes: 82304
s = input()
t = input()

res = 10000000000

for i in range(0, len(s)-len(t)+1):
    m = 0
    # print(s[i:], t)
    for j, k in zip(s[i:],t):
        # print(j,k)
        if j==k:
            m += 1
            
    res = min(res, len(t)-m)

if(res==10000000000):
    print(len(t))
else: 
    print(res)

Measured memory_bytes: 9000
#include <iostream>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  char A[50][50], B[50][50];
  for(int i=0; i<N; ++i) scanf("%s", &A[i][0]);
  for(int i=0; i<M; ++i) scanf("%s", &B[i][0]);
  for(int Ay=0; Ay<=N-M; ++Ay)for(int Ax=0; Ax<=N-M; ++Ax)
      if([&](int x, int y){
        for(int i = 0; i < M; i++)for(int j = 0; j < M; j++)
          if(A[x+i][y+j] != B[i][j]) return 0;
        return 1;
      }(Ax, Ay))
      {
        cout << "Yes" << endl;
        return 0;
      }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
n,k=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(n)]
ab.sort()
x=[0]
for i in range(n):
    x.append(x[-1]+ab[i][1])
for i in range(n):
    if x[i]<k<=x[i+1]:
        print(ab[i][0])

Measured memory_bytes: 32532
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#define MAXN 310
#define LL long long
#define P 1000000007
using namespace std;

void update(LL &x,LL y){ x=(x+y)%P; }

int n,m;
vector< pair<int,int> > q[MAXN];
LL f1,f2[2][MAXN],f3[2][MAXN][MAXN];

int main(){
#ifdef DEBUG
	freopen("E.in","r",stdin);
#endif
	scanf("%d%d",&n,&m);
	while(m--){
		int l,r,w;
		scanf("%d%d%d",&l,&r,&w);
		q[r].push_back(make_pair(l,w));
	}
	f1=1;
	for(int j=0;j<q[1].size();j++)
		if(q[1][j].second>1)
			f1=0;
	for(int i=2;i<=n;i++){
		int now=i&1;
		int last=now^1;
		memset(f2[now],0,sizeof f2[now]);
		memset(f3[now],0,sizeof f3[now]);
		update(f2[now][i-1],f1);
		for(int j=1;j<i-1;j++)
			if(f2[last][j]){
				update(f2[now][j],f2[last][j]);
				update(f2[now][i-1],f2[last][j]);
				update(f3[now][i-1][j],f2[last][j]);
			}
		for(int j=1;j<i-1;j++)
			for(int k=1;k<j;k++)
				if(f3[last][j][k]){
					update(f3[now][j][k],f3[last][j][k]);
					update(f3[now][i-1][k],f3[last][j][k]);
					update(f3[now][i-1][j],f3[last][j][k]);
				}
		bool flag=0;
		int lj1=1,lj2=i-1,lk1=1,lk2=i-1;
		for(int j=0;j<q[i].size();j++){
			int x=q[i][j].first,w=q[i][j].second;
			if(w==1){
				lj2=min(lj2,x-1);
			}else if(w==2){
				f1=0;
				lk2=min(lk2,x-1);
				lj1=max(lj1,x);
			}else{
				f1=0; flag=1;
				lk1=max(lk1,x);
			}
		}
		if(flag) memset(f2[now],0,sizeof f2[now]);
		else{
			for(int j=1;j<=i-1;j++)
				if(j<lj1 || j>lj2)
					f2[now][j]=0;
		}
		for(int j=1;j<i;j++)
			for(int k=1;k<j;k++)
				if(j<lj1 || j>lj2 || k<lk1 || k>lk2)
					f3[now][j][k]=0;
	}
	LL ans=0;
	update(ans,f1*3);
	for(int j=1;j<=n;j++)
		update(ans,f2[n&1][j]*6);
	for(int j=1;j<=n;j++)
		for(int k=1;k<=n;k++)
			update(ans,f3[n&1][j][k]*6);
	printf("%lld\n",ans);
	return 0;
}


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

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

ll dp[55][2505][55];

int main() {
  ll n, a, tmp, ans = 0, cnt;
  cin >> n >> a;
  vector<int> x(n);
  rep(i, n) cin >> x[i];

  dp[0][0][0] = 1;

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= n * a; ++j) {
      for (int k = 0; k < n; ++k) {
        dp[i + 1][j][k] += dp[i][j][k];
        dp[i + 1][j + x[i]][k + 1] += dp[i][j][k];
      }
    }
  }

  for (int i = 1; i <= n; ++i) ans += dp[n][i * a][i];

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 57420
#include<bits/stdc++.h>
using namespace std;
int n, q, A[30];
bool rem[30][2010];
bool solve(int now, int m){
	if(rem[now][m]) return true;
	if(m == 0) return true;
	if(now == n) return false;
	rem[now][m] = solve(now + 1, m) || solve(now + 1, m - A[now]);
	return rem[now][m];
}

int main()
{
	scanf("%d", &n);
	for(int i = 0; i < n; i++) scanf("%d", &A[i]);
	scanf("%d", &q);
	while(q--){
		int m;
		scanf("%d", &m);
		if(solve(0, m))printf("yes\n");
		else printf("no\n");
	} 
	return 0;
} 


Measured memory_bytes: 3132
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		Set<String> set = new HashSet<String>();
		for(int i=0; i<n; i++) {
			String s = sc.next();
			set.add(s);
		}
		System.out.println(set.size());
		sc.close();
	}


}

Measured memory_bytes: 78364
import sys
input = sys.stdin.readline
N = int(input())
list = []
for i in range(N) :
    s, p = input().split()
    list.append((s,p,i+1))

list.sort(key = lambda x: (x[0],-1*int(x[1])))
for i in range(N) :
    print(list[i][2])


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

int main(){
    int n,m; cin>>n;
    vector<string> id(n);
    for(int i=0; i<n; i++)cin>>id[i];

    cin>>m;
    vector<string> have(m);
    for(int i=0; i<m; i++)cin>>have[i];

    bool flag = false,search;

    for(int i=0; i<m; i++){
        search = false;
        for(int j=0; j<n; j++){
            if(have[i] == id[j]) search = true;
        }
        if(search && flag){
            cout<<"Closed "<<"by "<<have[i]<<endl;
            flag = false;
        }

        else if(search && !flag){
            cout<<"Opened "<<"by "<<have[i]<<endl;
            flag = true;
        }

        else cout<<"Unknown "<<have[i]<<endl;
    }

    return 0;
}


Measured memory_bytes: 3240
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL (1LL<<60)
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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; }
using namespace std;

// 間に数字を挿入したり出来ないため、移動しない数字の相対的な順序は変わらない。
// 先頭から見ていき、単調増加となっている最大の部分集合を求め、
// nからその部分集合の要素数を減算したものが解となる。

int main(){
    // 入力
    Init();
    ll n; cin >> n;
    vi p(n);
    rep(i, n) cin >> p[i];

    // dpで単調増加となっている最大の部分集合を求める
    // dp[i]; 数字iより前に出現した数字で、かつ数字i以下の数字の連続部分（差は1）
    vi dp(n+1, 0);
    ll maxval = 0;
    rep(i, n){
        if(dp[p[i]-1] == 0) dp[p[i]] = 1;
        else dp[p[i]] = dp[p[i]-1] + 1;
        chmax(maxval, dp[p[i]]);
    }
    cout << n-maxval << endl;
    return 0;
}

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

#define int    long long

void fast()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
}
//a^n O(log(n))

int power(int a, int n)
{
	int result = 1;
	while (n > 0)
	{
		if (n & 1)
		{
			result = result * a;
		}
		a = a * a;
		n = n >> 1;

	}
	return result;
}


bool compare(string &s1, string &s2)
{
	return s1.size() < s2.size();
}

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

	vector<int> v(10005);

	int cnt = 0;

	for (int i = 1; i < 101; ++i)
	{
		for (int j = 1; j < 101; ++j)
		{
			for (int k = 1; k < 101; ++k)
			{
				int ans = (i * i + j * j + k * k + i * j + i * k + j * k);
				if (ans > n)
					continue;
				else
					v[ans]++;
			}
		}
	}

	for (int i = 1; i <= n; ++i)
	{
		cout << v[i] << '\n';
	}

	return 0;
}


Measured memory_bytes: 3736
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(false); cin.tie(0);
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const int nmax = 3e5 + 10;
int n;
string s;
int a[nmax], b[nmax];
int main() {
    IO;
   
    cin >> n;
    cin >> s;
    s = "#" + s;
    a[0] = 0, b[0] = 0;
    for (int i = 1; i <= n; i++) {
        a[i] = a[i - 1];
        b[i] = b[i - 1];
        if (s[i] == 'W') a[i]++;
        if (s[i] == 'E') b[i]++;
    }
    int res = INF;
    for (int i = 1; i <= n; i++) {
        int cnt = a[i - 1] + b[n] - b[i];
        if (cnt < res) res = cnt;
    }
    cout << res;
    return 0;
}


Measured memory_bytes: 3056
a,b,c=map(int,input().split())
 
if a+b+c==17:
  if a==5 and b==5:
    print("YES")
  elif a==5 and c==5:
    print("YES")  
  elif b==5 and c==5:
    print("YES") 
  else:
  	print("NO")
else:
	print("NO")

Measured memory_bytes: 3060
/*
 *Author - Abhas Jain
 *Code is inside the solve function
 */
 
#include <bits/stdc++.h>
 
#define F first
#define S second
#define all(c) c.begin(), c.end()
#define endl '\n'
#define pb push_back
#define mp make_pair 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
 
typedef long long ll;
typedef long double ld;

#define rep(i,a,b) for(ll i=a;i<b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)

 
using namespace std;
using namespace __gnu_pbds;
template <typename A, typename B>
string to_string(pair<A, B> p);
 
string to_string(const string& s) {
  return '"' + s + '"';
}
 
string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
 
#ifdef AJ47
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
typedef tree<pair<ll,ll>,null_type,less<pair<ll,ll> >,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;
mt19937 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
 
const ld PI = 3.141592653589793;
const ll INF = 9223372036854775807ll;
const ll mod = 1e9 + 7;
 
void solve() 
{
    char c;
    cin >> c;
    c++;
    cout << c << endl;
}
 
int main( )
{   
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
#define REP(i,n)    for(int i = 0; i < (int)n; i++)
#define MAX_N   100000
typedef long long ll;

void solve(){
    int a, b;
    cin >> a >> b;
    if(a - 2 * b > 0)
        cout << a - 2 * b << '\n';
    else
        cout << 0 << endl;
}

int main(){
    solve();
    return 0;
}

Measured memory_bytes: 256
N,M = map(int,input().split())

G = [[] for _ in range(N+1)]
for i in range(M):
    c,d = map(int,input().split())
    G[c].append(d)
    G[d].append(c)


#i番目の辺を取り除いたときに非連結となる
#i番目の辺を取り除いたときにグラフが連結かどうかを調べる
ans = 0
for i in range(M):
    for j in range(1,N+1):
        #頂点jに接続している辺の数が１のとき
        if len(G[j]) == 1:
            tmp = G[j][0]
            G[j].remove(tmp)
            G[tmp].remove(j)
            ans += 1
print(ans)          

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;

int main(){
    string s, t; cin >> s >> t;
    int ans = 0;
    rep(i, s.size()){
        if(s[i] != t[i]) ans++;
    }
    cout << ans << endl;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h, w;
    cin >> h >> w;
    char grid[100][100];
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) cin >> grid[i][j];
    }

    for (int i = 0; i < h+2; i++) {
        if (i == 0 || i == h+1) {
            for (int j = 0; j < w+2; j++) cout << '#';
            cout << endl;
        } else {
            cout << '#';
            for (int j = 0; j < w; j++) cout << grid[i-1][j];
            cout << '#' << endl;
        }
    }
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    // dp[i]:iを最後とする最長部分列の長さ
    vector<int> dp(N+1);
    rep(i,N){
        int p;
        cin >> p;
        dp[p] = dp[p-1]+1; // 1つ前までの長さから1伸びるか、新たに1となるか
    }
    sort(dp.rbegin(),dp.rend());
    cout << N - dp[0] << endl;
    return 0;
}

Measured memory_bytes: 4020
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def solve():
    s, w = MI()

    if w >= s:
        print('unsafe')
    else:
        print('safe')


if __name__ == '__main__':
    solve()


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

int main(){
  int x[4];
  for (int i = 0; i < 5; i++){
    cin >> x[i];
    if (x[i] == 0){
      cout << i + 1 << endl;
      break;
    }
  }
  return 0;
}


Measured memory_bytes: 3572
n = int(input())
target = [0 for i in range(n)]
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      temp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
      if(temp <= n):
        target[temp - 1] += 1
for i in range(n):
  print(target[i])

Measured memory_bytes: 69572
#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  st s;
  	ci(s);
  ll a=s.sz;
  bool b=true;
  bool c=false;
  FOR(i,0,a){
    FOR(j,0,a){
      if(i==j) continue;
      else if(s[i]==s[j]){
          co("no")
          b=false;
          c=true;
          break;
        }
    }
    if(c) break;
  }
  if(b) co("yes")
}


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

int main(){
  int a[3];
  std::cin >> a[0] >> a[1] >> a[2];

  std::sort(a, a+3);
  std::cout << a[0] << " " << a[1] << " " << a[2] << std::endl;

  return 0;
}



Measured memory_bytes: 3088
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[0]
if a[-1] == 0:
    print(0)
else:
    for i in range(1, n):
        ans *= a[i]
        if ans > 10**18:
            ans = -1
            break
    print(ans)

Measured memory_bytes: 21600
N = int(input())
X = list(map(int, input().split()))
def meeting_cost(P,List):
    cost = 0
    for i in List:
        cost += (i - P)**2
    return cost
result = {}
for P in range(1, 101):
    result[P] = meeting_cost(P, X)
print(min(result.values()))

Measured memory_bytes: 9164
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; using ll = long long; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];

    if (count(all(A), 0LL) > 0) {
        write(0);
        return 0;
    }

    ll ans = 1;
    rep(i, N) {
        if ((double)ans * A[i] > 2e18) {
            write(-1);
            return 0;
        }
        ans = ans * A[i];
        if (ans > (ll)1e18) {
            write(-1);
            return 0;
        }
    }
    write((ll)ans);
}

Measured memory_bytes: 3988
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
{
	string s;
	for (int i = 0; i<tgt.size(); i++) {
		s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
	}
	out << s;
	return out;
}

vi rnk, par;

int find(int x) {
	if (par[x] == x) return x;
	return par[x] = find(par[x]);
}

void unite(int x, int y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rnk[x] < rnk[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rnk[x] == rnk[y])rnk[x]++;
	}
}

bool same(int x, int y) {
	return (find(x) == find(y));
}

int main() {
	int n, m, in, inn;
	int ans = 0;
	vi v;
	cin >> n >> m;
	par.resize(n);
	rnk.resize(n);
	rep(i, n) {
		par[i] = i;
		rnk[i] = 0;
	}
	rep(i, n) {
		cin >> in;
		v.push_back(in-1);
	}
	rep(i, m) {
		cin >> in >> inn;
		unite(in-1, inn-1);
	}
	rep(i, n) {
		if (same(i, v[i]))ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 1660
while True:
    n = int(input())
    if n == 0:
        break
    else:
        score = [int(x) for x in input().split()]
        a = 0
        m = sum(score)/n
    for s in score:
        a += (s-m)**2
    a = (a/n)**0.5
    print('{:.8f}'.format(a))



Measured memory_bytes: 5684
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <math.h>
#include <string>
#include <iomanip>
#include <locale>
#include <list>
#include <bitset>
#include <tuple>
using namespace std;
#define FORN(i,m,n) for(int i=(m); i<int(n); i++)
#define PRINTVEC(v) FORN(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define PRINTMAT(m) FORN(j,0,m.size()) {PRINTVEC(m[j]);}
typedef long long ll;

int main(){
  ios_base::sync_with_stdio(false); cin.tie(NULL);
  int k, n;
  cin>>k>>n;
  vector<int> v(n), tmp;
  FORN(i,0,n) cin>>v[i];
  FORN(i,1,n) tmp.push_back(v[i] - v[i-1]);
  tmp.push_back(k - v[n-1] + v[0]);
  sort(tmp.begin(), tmp.end());
  cout<<k-tmp.back()<<endl;
}

Measured memory_bytes: 2168
#include <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <iterator>
#include <map>
#include <set>
#include <iomanip>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Graph = vector<vector<int>>;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define INF 10000000000000000
#define MAX 200001
#define MOD 1000000007  

struct edge{
    ll to, cost;
};

ll d[100005];
void dijkstra(int s, vector<vector<edge>> &G){
    priority_queue<P, vector<P>, greater<P>> que;
    fill(d, d + 100005, INF);
    d[s] = 0;
    que.push({0, s});
    while(!que.empty()){
        P p = que.top();
        que.pop();
        ll v = p.second;
        if(d[v] < p.first) continue;
        for(auto n_v:G[v]){
            if(d[n_v.to] > d[v] + n_v.cost){
                d[n_v.to] = d[v] + n_v.cost;
                que.push({d[n_v.to], n_v.to});
            }
        }
    }
}

int main(){
    ll N, M;
    cin >> N >> M;
    vector<vector<edge>> G(N);
    for(int i = 1; i < N; i++){
        G[i].push_back({i - 1, 0});
    }
    for(int i = 0; i < M; i++){
        ll l, r, c;
        cin >> l >> r >> c;
        l--;r--;
        G[l].push_back({r, c});
    }
    dijkstra(0, G);
    if(d[N - 1] == INF) d[N - 1] = -1;
    cout << d[N - 1] << endl;
}

Measured memory_bytes: 12796