akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() 
{
	int h, w; cin >> h >> w;
	vector<string> rock(h);
	for (auto &s : rock)
		cin >> s;
	vector<vector<vector<int>>> grid(h, vector<vector<int>>(w, vector<int>(4, -1)));
	for (int i = 0; i < h; i++)
	{
		int d = 0;
		for (int j = 0; j < w; j++, d++)
			if (rock[i][j] == '#')
				d = -1;
			else
				grid[i][j][0] = d;
		d = 0;
		for (int j = w - 1; j >= 0; j--, d++)
			if (rock[i][j] == '#')
				d = -1;
			else
				grid[i][j][1] = d;
	}
	for (int j = w - 1; j >= 0; j--)
	{
		int d = 0;
		for (int i = 0; i < h; i++, d++)
			if (rock[i][j] == '#')
				d = -1;
			else
				grid[i][j][2] = d;
		d = 0;
		for (int i = h - 1; i >= 0; i--, d++)
			if (rock[i][j] == '#')
				d = -1;
			else
				grid[i][j][3] = d;
	}
	int m = 0;
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			if (rock[i][j] == '.')
			{
				int s = 0;
				for (int k = 0; k < 4; k++)
					s += grid[i][j][k];
				m = max(m, s);
			}
		}
	}
	cout << m + 1;
	return 0;
}

Measured memory_bytes: 223232
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            var V = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            var C = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            int[] X = new int[N];
            int Max = 0;

            for(int i = 0; i < N; i++)
            {
                X[i] = V[i] - C[i];
                if (X[i] > 0)
                {
                    Max += X[i];
                }
            }

            Console.WriteLine(Max);

        }
    }
}


Measured memory_bytes: 13140
//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pll>   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
//typedef    unordered_multiset<int>   umsi;
//typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pi>   vpi;
typedef    set<pi>   spi;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   1000000007
#define    inf  9223372036854775807
#define    ninf   -inf
#define    ima   2147483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define    all(x)   x.be(),x.en()
#define    eps   1e-9
#define    coutd   cout<<setprecision(10)<<fixed
#define    mems(dp,x)   memset(dp,x,sizeof(dp))
const    ld   PI=3.1415926535897932384626433832792884197169399375105820974944;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}
inline ll lcm(ll a,ll b){return ((a*b)/gcd(a,b));}


int main()
{
io
int testcases=1;//cin>>testcases;
while(testcases--)
{





ll l,r;
cin>>l>>r;

if(r-l>=2019)
cout<<0;

else {
	
	ll mi=ima;
	
	for(ll i=l;i<r;i++)
	{
		for(ll j=l+1;j<=r;j++)
		{ll h=(i*j)%2019;
			mi=min(mi,h);
		}
	}
	cout<<mi;
}



}return 0;}

Measured memory_bytes: 384
#include<stdio.h>
int main(){
  int n,i,S[14],H[14],C[14],D[14],number;
  char chara,dummy;

  for(i=1;i<14;i++){
    S[i] = 0;
    D[i] = 0;
    H[i] = 0;
    C[i] = 0;
  }

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%c",&dummy);
    scanf("%c %d",&chara,&number);
    switch(chara){
    case 'S':
      S[number] = number;
      break;
    case 'H':
      H[number] = number;
      break;
    case 'C':
      C[number] = number;
      break;
    case 'D':
      D[number] = number;
      break;
    default: break;
    }
  }
   for(i=1;i<14;i++){
    if(S[i] == 0){
      printf("S %d\n",i);
    }
  }
  for(i=1;i<14;i++){
    if(H[i] == 0) printf("H %d\n",i);
  }
  for(i=1;i<14;i++){
    if(C[i] == 0) printf("C %d\n",i);
  }
  for(i=1;i<14;i++){
    if(D[i] == 0) printf("D %d\n",i);
  }
  return 0;
}





Measured memory_bytes: 2068
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

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

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

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

	for (int i = 0; i <= n - m; ++i) {
		for (int j = 0; j < n; ++j) {
			bool match = true;
			for (int k = i, km = 0; km < m; ++k, ++km) {
				for (int l = j, lm = 0; lm < m; l = (l + 1) % n, ++lm) {
					if (a[k][l] != b[km][lm]) {
						match = false;
						break;
					}
				}
			}

			if (match) {
				cout << "Yes\n";
				return 0;
			}
		}
	}

	cout << "No\n";

	return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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

const ll MOD = 1000000007;
const int INF = 1<<29;
//const ll INF = (ll)1e18 + 1;

int main(){
  int N, K; cin >> N >> K;
  K--;
  string S; cin >> S;

  if (S[K] == 'A') S[K] = 'a';
  else if(S[K] == 'B') S[K] = 'b';
  else S[K] = 'c';
  cout << S << endl;
}


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

def check():
  for i in range(N + 1):
    for j in range(N - i + 1):
      if 10000 * i + 5000 * j + 1000 * (N - i - j) == Y:
        print(i, j, N - i - j)
        return
  print(-1,-1,-1)

check()

Measured memory_bytes: 9108
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
using namespace std;

int main(){
    int a,b;
    cin >> a >> b;
    if(b-a>=0){
        cout << a << endl;
    }else{
        cout << a-1 << endl;
    }
        return 0;
    }
    


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

int main(){
  int N,Y,sum;
  cin >> N >> Y;
  int a=-1;
  int b=-1;
  int c=-1;
  for(int i=0;i<=N;++i){
    for(int j=0;j+i<=N;++j){
      int k=N-i-j;
      sum = 10000*i +5000*j + 1000*k;
      if(sum == Y){
        a=i;
        b=j;
        c=k;
      }
    }
  }
  cout << a << " " << b << " "<< c << endl;
}

Measured memory_bytes: 256
#include <vector>
#include<string>
#include <iostream>
#include <map>
using namespace std;

int a[111111];
int b[111111];
int n;
const long long mod = 1000000007LL;

int main() {

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

        bool flag = true;
        map<int, int> heigit;
        for(int i=0; i<n; i++) {
            if(i == 0) {
                heigit[0] = a[i];
            } else {
                if(a[i] > a[i-1]) {
                    heigit[i] = a[i];
                }
            }
        }
        for(int i=n-1; i>=0; i--) {
            if(heigit.find(i) != heigit.end()) {
                if(heigit[i] > b[i]) {
                    flag = false;
                }
            }
            
            if(i == n-1 || b[i] > b[i+1]) {
                if(heigit.find(i)==heigit.end()) {
                    heigit[i] = b[i];
                } else if(heigit[i] != b[i]) {
                    flag = false;
                }
            }
        }
        if(flag == false) {
            cout << 0 << endl;
            continue;
        }
        long long res = 1LL;
        for (int i=0; i<n; i++) {
            if(heigit.find(i) == heigit.end()) {
                res *= min(a[i], b[i]);
                res %= mod;
            }
        }
        cout << (res % mod) << endl;
    }

}

Measured memory_bytes: 5760
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
#define int long long
   template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
    const int MAX =200005;
const int MOD =1000000007;

signed main(){
  int n,q;
  cin>>n>>q;
  dsu d(n);
  int t,u,v;
  for(int i=0;i<q;i++){
    cin>>t>>u>>v;
    if(t){
      if(d.same(u,v))cout<<1<<endl;
      else cout<<0<<endl;
    }else d.merge(u,v);
  }
}

Measured memory_bytes: 4008
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int ope(int a, int b, int i){
    if(i == 0)
        return a + b;
    else if(i == 1)
        return a - b;
    else
        return a * b;
}

void solve(vector<int> a)
{
    char c[] = {'+', '-', '*'};

    do{
        for(int i=0; i<3; ++i){
            for(int j=0; j<3; ++j){
                for(int k=0; k<3; ++k){
                    if(ope(ope(a[0], a[1], i), ope(a[2], a[3], j), k) == 10){
                        cout << "((" << a[0] << c[i] << a[1] << ')' << c[k] << '(' << a[2] << c[j] << a[3] << "))" << endl;
                        return;
                    }
                    if(ope(ope(ope(a[0], a[1], i), a[2], j), a[3], k) == 10){
                        cout << "(((" << a[0] << c[i] << a[1] << ')' << c[j] << a[2] << ')' << c[k] << a[3] << ')' << endl;
                        return;
                    }
                    if(ope(ope(a[0], ope(a[1], a[2], i), j), a[3], k) == 10){
                        cout << "((" << a[0] << c[j] << '(' << a[1] << c[i] << a[2] << "))" << c[k] << a[3] << ')' << endl;
                        return;
                    }
                    if(ope(a[0], ope(ope(a[1], a[2], i), a[3], j), k) == 10){
                        cout << '(' << a[0] << c[k] << "((" << a[1] << c[i] << a[2] << ')' << c[j] << a[3] << "))" << endl;
                        return;
                    }
                }
            }
        }
    }while(next_permutation(a.begin(), a.end()));

    cout << '0' << endl;
}

int main()
{
    for(;;){
        vector<int> a(4);
        for(int i=0; i<4; ++i){
            cin >> a[i];
            if(a[i] == 0)
                return 0;
        }
        sort(a.begin(), a.end());

        solve(a);
    }
}

Measured memory_bytes: 0
import java.util.Scanner;

//Caesar Cipher
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		char[]s = sc.next().toCharArray();
		for(int i=0;i<s.length;i++)s[i]=(char)((s[i]-'A'+23)%26+'A');
		System.out.println(s);
	}

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

Measured memory_bytes: 12000
using Printf

const double = Float64
const int = Int64
const vint = Vector{int}
const vdouble = Vector{double}

int(x) = parse(int,x)
parseint(x) = parse(int, x)
readint() = map(parseint, split(readline()))

function main()
  s = readline()
  t = readline()
  
  s == t[1:length(s)] ? println("Yes") : println("No")

end

main()

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

typedef struct{
	int p;
	int l;
	int r;
}Node;
Node T[100000];
int C[100000];
int n;
void print(int);
void rec(int,int);

int main(){
  int id,k,c,i,j,l,r;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    T[i].p=-1;
    T[i].l=-1;
    T[i].r=-1;
  }
  for(i=0;i<n;i++){
    scanf("%d%d",&id,&k);
    for(j=0;j<k;j++){
      scanf("%d",&c);
      if(j==0){
	T[id].l=c;
      }else{
	T[l].r=c;
      }
      l=c;
      T[c].p=id;
    }	
  }
  for(i=0;i<n;i++){
    if(T[i].p == -1){
      r = i;
    }
  }
  rec(r,0);
  for(i=0;i<n;i++){
    print(i);
  }
  return 0;
}

void rec(int a,int b){
  C[a] = b;
  if(T[a].r != -1)rec(T[a].r,b);
  if(T[a].l != -1)rec(T[a].l,b+1);
}
void print(int a){
  int i,c;
  printf("node %d: ",a);
  printf("parent = %d, ",T[a].p);
  printf("depth = %d, ",C[a]);
  if(T[a].p == -1){
    printf("root, ");
  }else if(T[a].l == -1){
    printf("leaf, ");
  }else{
    printf("internal node, ");
  }
  printf("[");
  c = T[a].l;
  while(c != -1){
    printf("%d",c);
    if(T[c].r!=-1){
      printf(", ");
    }
    c = T[c].r;
  }
  printf("]\n");
}



Measured memory_bytes: 6368
#include<stdio.h>                                                 
                                                                  
int main(void){                                                   
   int A,B,C,K;                                                   
                                                                  
   scanf("%d %d %d %d",&A,&B,&C,&K);                              
                                                                  
   if(K <= A){                                                    
      printf("%d",K);                                             
   }else if( K <= A+B){                                           
      printf("%d",A);                                             
   }else{                                                         
      printf("%d",A-(K-A-B));                                     
   }                                                              
}    

Measured memory_bytes: 1688
#include <iostream>
#include <array>

int main(){
	std::array<u_int, 4> que;
	std::array<u_int, 4> ans;

	while(std::cin >> que[0] >> que[1] >> que[2] >> que[3] && std::cin >> ans[0] >> ans[1] >> ans[2] >> ans[3]){
		
		int hit = 0;
		int blow = 0;
		
		for(int i = 0; i < 4; ++i){
			if(que[i] == ans[i])
				hit++;

			if(que[i] == ans[(i + 1) % 4] || que[i] == ans[(i + 2) % 4] || que[i] == ans[(i + 3) % 4])
				blow++;
		}

		std::cout << hit << " " << blow << std::endl;
	}

	return 0;
}


Measured memory_bytes: 3044
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

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

	if (s[0] != 'A') {
		cout << "WA" << endl;
		return 0;
	}

	int n = s.size();
	bool once = false;
	int pos;
	for (int i = 2; i < n - 1; i++) {
		if (s[i] == 'C') {
			if (!once) {
				once = true;
				pos = i;
			}
			else {
				cout << "WA" << endl;
				return 0;
			}
		}
	}
	if (!once) {
		cout << "WA" << endl;
		return 0;
	}

	for (int i = 1; i < n; i++) {
		if (i == pos) continue;
		bool valid = false;
		for (char c = 'a'; c <= 'z'; c++) {
			if (c == s[i]) {
				valid = true;
				break;
			}
		}
		if (!valid) {
			cout << "WA" << endl;
			return 0;
		}
	}
	cout << "AC" << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

void solve()
{
	int K;
	while(cin >> K, K)
	{
		int sum = 0;
		int temp;
		int n = K * (K - 1) / 2;
		for(int i = 0; i < n; ++i)
		{
			cin >> temp;
			sum += temp;
		}
		cout << sum / (K - 1) << endl;
	}
}

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

Measured memory_bytes: 0
(let* ((n (read))
       (lst (loop repeat n
                  collect (read)))
       (m (read))
       (lst2 (loop repeat m
                   collect (cons (read) (read))))
       (sum (reduce #'+ lst)))

  (format t "~{~A~%~}"
          (mapcar #'(lambda (n)
                      (+ sum n))
                  (loop for i in lst2
                        collect (- (cdr i) (nth (1- (car i)) lst))))))


Measured memory_bytes: 15972
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int W,a,b;
  cin>>W>>a>>b;
  
  if(a+W<b)
    cout<<b-(a+W)<<endl;
  else if(a>b+W)
    cout<<a-(b+W)<<endl;
  else
    cout<<0<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 500005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
    	if(c == '-') f = -1;
    	c = getchar();
    }
    while(c >= '0' && c <= '9') {
    	res = res * 10 +c - '0';
    	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
    	out(x / 10);
    }
    putchar('0' + x % 10);
}
struct Point {
    double x,y;
    Point(double _x = 0,double _y = 0) {
        x = _x;y = _y;
    }
    friend Point operator + (const Point &a,const Point &b) {
        return Point(a.x + b.x,a.y + b.y);
    }
    friend Point operator - (const Point &a,const Point &b) {
        return Point(a.x - b.x,a.y - b.y);
    }
    friend double operator * (const Point &a,const Point &b) {
        return a.x * b.y - a.y * b.x;
    }
}que[MAXN];
int N,ql,qr;
double L,sum;
void Solve() {
    read(N);scanf("%lf",&L);
    double t,v;
    for(int i = 1 ; i <= N ; ++i) {
        scanf("%lf%lf",&t,&v);
        que[++qr] = Point(v,t * v);
        sum += t * v;
        double dec = 0;
        if(i != 1) {
            while(1) {
                if(dec >= v) break;
                if(que[ql].x <= v - dec) {
                    dec += que[ql].x;
                    sum -= que[ql].y;
                    ++ql;
                }
                else {
                    sum -= que[ql].y;
                    que[ql].y -= que[ql].y / que[ql].x * (v - dec);
                    que[ql].x -= v - dec;
                    sum += que[ql].y;
                    break;
                }
            }
        }
        printf("%.7lf\n",sum / L);
        while(ql <= qr - 1) {
            if(que[qr] * que[qr - 1] >= -1e-8) {
                que[qr - 1] = que[qr] + que[qr - 1];
                --qr;
            }
            else break;
        }
    }
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 16896
#include <bits/stdc++.h>
#define ll long long
using namespace std;

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

    vector<ll> A(n);
    vector<ll> B(n);
  
    ios::sync_with_stdio(false);
  
    for(ll i=1; i<n; i++){
        cin >> A.at(i);
        B.at(A.at(i)-1)++;
    }

    for(ll i=0; i<n; i++){
        cout << B.at(i) << endl;
    }
  
    return 0;
}


Measured memory_bytes: 6352
import bisect

n=int(input())
*L,=map(int,input().split())

L.sort()

ans=0
for i in range(n-1):
      for j in range(i+1,n):
            index=bisect.bisect_left(L,L[i]+L[j])
            ans+=index-(j+1)
print(ans)       

Measured memory_bytes: 3188
// atcoder/abc127/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int a, b;
  while (cin >> a >> b) {
    if (13 <= a) cout << b << endl;
    else if (6 <= a && a <= 12) cout << b/2 << endl;
    else cout << 0 << endl;
  }

  return 0;
}


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


int main()
{
	int a, b, sum, i;
	while(scanf("%d%d", &a, &b)!=EOF) 
	{
		i=0;
		sum=a+b;
		while(sum>0)
		{
			i=i+1;
			sum=sum/10;	
		}
		printf("%d\n", i);   
	}
	return 0;
 } 


Measured memory_bytes: 1976
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <iomanip>
#include <map>
#include <stack>
#include <sstream>

using namespace std;


int main()
 {
	
	int A;
	int B;
	cin >> A >> B;
	cout << A *  B;
	return 0;


}

Measured memory_bytes: 3152
#include<stdio.h>
#define MAX 10000
int search(int[],int,int);


int main(){
  int i,S[MAX],q,key,p,count=0;
 
  scanf("%d",&p);


  for(i=0;i <= p-1;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);
  for(i=0;i <= q-1;i++){
    scanf("%d",&key);
    if(search(S,p,key))count++;
  }


       
  printf("%d\n",count);
  return 0;
}


int search(int S[],int p,int key){
  int i;
  i=0;
  S[p] = key;
  while(S[i] != key)
    {  
      i++;
    }
  return i!= p;
}
  



Measured memory_bytes: 2108
# include<bits/stdc++.h>
 
using namespace std;
 
# define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
typedef pair<ll, ll> pll;
 
# define S second
# define F first
# define kill(x) return(cout << x << endl, 0)
# define debug(x) cerr<< #x << " : " << x << endl
# define ddebug(x, y) cerr<< #x << " : " << x  << ", " << #y << " : " << y << endl
# define sz(s) (int)s.size()
# define sq(x) (x) * (x)
# define PB(x) push_back(x)
# define smax(x, y) (x) = max((x), (y))
# define smin(x, y) (x) = min((x), (y))
# define all(x) x.begin(), x.end()
# define SP fixed << setprecision(10)
# define UB upper_bound 

const int MAXN = 2 * 1000 + 10;
int l[MAXN];

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

	int n;
	cin >> n;
	for (int i = 0; i < n; i ++)
		cin >> l[i];
	sort(l, l + n);
	int ans = 0;
	for (int i = 0; i < n; i ++)
		for (int j = i + 1; j < n; j ++)
		{
			int a = l[i], 
			    b = l[j],
			    x = lower_bound(l, l + n, a + b) - upper_bound(l, l + n, abs(a - b));
			ans += x - (a < a + b && a > abs(a - b)) - (b < a + b && b > abs(a - b));
		}
	debug(ans);
	cout << ans / 3 << endl;

	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000

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

    int mi = 1e9, ans = 0;
    rep(i, N) {
        int a;
        cin >> a;
        if (mi >= a)
            ans++;
        mi = min(mi, a);
    }

    cout << ans << endl;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<long long> vl;
typedef pair<long long, long long> pl;
typedef vector<vector<long long>> matrix;

#define F 						first
#define S 						second
#define PB 						push_back
#define MP 						make_pair
#define all(c) 					c.begin(), c.end()
#define f(i,a,b) 				for(ll i=a; i<b; i++)
#define rep(i,n) 				f(i,0,n)
#define tr(c,i) 				for(typeof(c).begin() i = c.begin(); i != c.end(); i++)
#define present(c,x) 			(c.find(x) != c.end())	//for set and map
#define cpresent(c,x) 			(find(all(c),x) != c.end())	//for vectors
#define w(t)					ll t; cin>>t; while(t--)
#define epsilon 				1e-9
#define MOD						(ll)1e9

void doublade() {
	ios::sync_with_stdio(false); cin.tie(0); cout.precision(10);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
}

// ll N = 200001;
vl adj[200001];
vector<bool> visited(200001, false);

ll dfs(ll s, ll &cnt) {
	visited[s] = true;
	cnt++;
	for(auto u:adj[s]) {
		if(!visited[u]) {
			dfs(u, cnt);
		}
	}
	return cnt;
}

int main() {
	doublade();
	// w(t) {
		ll n, m;
		cin >> n >> m;
		// vl a(n), b(m);
		rep(i, m) {
			ll x, y;
			cin >> x >> y;
			adj[x].PB(y);
			adj[y].PB(x);
		}
		ll ans = 0;
		rep(i, n) {
			if(!visited[i]) {
				ll cnt = 0;
				ans = max(ans, dfs(i, cnt));
			}
		}
		cout<<ans<<"\n";
	// }
	return 0;
}

Measured memory_bytes: 23968
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <vector>

using namespace std;

int main() {
	int n, k, q;
	cin >> n >> k >> q;
	vector<int> vec(n, k);
	for (int i = 0; i < q; i++) {
		int k; cin >> k;
		k--;
		vec[k]++;
	}
	for (int i = 0; i < n; i++) {
		if (vec[i] - q > 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 1024
N = int(input())
A = [int(i) for i in input().split()] 
B = [int(i) for i in input().split()] 

delta = []
for i in range(N):
    delta.append(A[i] - B[i])

# -1になっている数を数える
minus = [x for x in delta if x < 0]
plus = [x for x in delta if x >= 0]

plus.sort()
plus.reverse()
min_sum = sum(minus)
min_sum = min_sum * -1

num = -1
plu_sum = 0

if min_sum == 0:
    num = 0
else:
    for i in range(len(plus)):
        plu_sum += plus[i]
        if plu_sum >= min_sum:
            num = i + 1 + len(minus)
            break

print(num)


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

#define REP(i, n, N) for(ll i=(n);i<(N);i++)
#define RREP(i, n, N) for(ll i=(N-1);i>=(n);i--)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(), (v).end()
#define MCP(a, b) memcpy(b,a, sizeof(b))
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

ll N;

int main() {
    while (cin >> N, N) {
        string s[30];
        REP(i, 0, N) {
            cin >> s[i];
        }
        if(N==1){
            cout<<s[0]<<endl;
            continue;
        }
        char op[30];
        queue<ll> num[30];
        ll now_level = 0;
        ll ans = 0;
        REP(i, 0, N) {
            ll next_level = s[i].size();
            if (next_level >= now_level) {
                if (isdigit(s[i].back())) {
                    num[next_level].push(s[i].back() - '0');
                } else {
                    op[next_level] = s[i].back();
                }
            } else if (next_level < now_level) {
                RREP(j, next_level+1, now_level + 1) {
                    ll tmp=0;
                    if(op[j - 1]=='*') tmp=1;
                    while (!num[j].empty()) {
                        if (op[j - 1] == '+') {
                            tmp += num[j].front();
                        } else {
                            tmp *= num[j].front();
                        }

                        num[j].pop();
                    }
                    num[j-1].push(tmp);
                }
                if (isdigit(s[i].back())) {
                    num[next_level].push(s[i].back() - '0');
                } else {
                    op[next_level] = s[i].back();
                }
            }
            now_level = next_level;
        }

        RREP(j, 2, now_level + 1) {
            ll tmp=0;
            if(op[j - 1]=='*') tmp=1;
            while (!num[j].empty()) {
                if (op[j - 1] == '+') {
                    tmp += num[j].front();
                } else {
                    tmp *= num[j].front();
                }

                num[j].pop();
            }
            num[j-1].push(tmp);
        }
        p(num[1].front());
    }
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
const ll Mod = 1000000007;

int main(){
  short a;
  cin >> a;
  if(a < 1200){
    cout << "ABC";
  }else if(a >= 2800){
    cout << "AGC";
  }else{
    cout << "ARC";
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 8005;

bool ox[2*MAX_N],oy[2*MAX_N];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    s += 'T';
    int x,y;
    cin >> x >> y;
    int n = len(s);
    vector<int> u,v;
    int cnt = 0;
    bool flag = false;
    int nx,ny;
    int kind = 1;
    nx = ny = 0;
    rep(i,n){
        if(s[i] == 'F'){
            cnt++;
        }else{
            if(flag){
                if(cnt > 0){
                    if(kind == 1){
                        v.pb(cnt);
                    }else{
                        u.pb(cnt);
                    }
                }
                cnt = 0;
                kind ^= 1;
            }else{
                flag = true;
                nx += cnt;
                cnt = 0;
            }
        }
    }
    // svec(u),svec(v);
    // cout << nx << " " << ny << "\n";
    int mid = 8002;
    ox[mid] = oy[mid] = true;
    rep(i,len(u)){
        vi ch;
        rep(j,16005){
            if(ox[j]){
                ch.pb(j+u[i]), ch.pb(j-u[i]);
            }
        }
        rep(j,16005){
            ox[j] = false;
        }
        rep(j,len(ch)){
            ox[ch[j]] = true;
        }
    }
    rep(i,len(v)){
        vi ch;
        rep(j,16005){
            if(oy[j]){
                ch.pb(j+v[i]), ch.pb(j-v[i]);
            }
        }
        rep(j,16005){
            oy[j] = false;
        }
        rep(j,len(ch)){
            oy[ch[j]] = true;
        }
    }
    if(ox[x-nx+mid] && oy[y-ny+mid]){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}


Measured memory_bytes: 384
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.functional;

void main() {
    int n = readln.chomp.to!int;
    int[] a = readln.split.to!(int[]);

    int k = a.reduce!min, m = a.reduce!max;

    if (m - k > 1) {
        writeln("No");
        return;
    }

    if (k == m) {
        writeln(k == n - 1 || 2*k <= n ? "Yes" : "No");
    }
    else {
        int p = a.count(k).to!int;

        writeln(p <= k && 2*(k + 1 - p) <= n - p ? "Yes" : "No");
    }

}

void scan(T...)(ref T args) {
    auto line = readln.split;
    foreach (ref arg ; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

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

int main() {
        char a;
        cin >> a;
        if ('a' <= a && a <= 'z') {
                cout << "a" << endl;
        } else {
                cout << "A" << endl;
        }
        return 0;
}


Measured memory_bytes: 3600
def main():
    n,m,c = list(map(int,input().split()))
    b = list(map(int,input().split()))
    cnt = 0
    for _ in range(n):
        a = list(map(int,input().split()))
        res = c
        for i in range(m):
            res += a[i]*b[i]
        if res>0:
            cnt += 1
    print(cnt)



if __name__=='__main__':
    main()

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll  long  long
#define INF 0x3f3f3f3f
#define pll pair<long long , long long>
const int MAX=5e6+9;
const ll mod=998244353;
const int TOT_PRIMES=19;
const int MAX_A=70;
using namespace std;
vector<int>adj[MAX];
int prime[MAX];
ll dp[MAX];
int main() 
{
	
	int n , k;
	cin>>n>>k;
	
	memset(dp,0, sizeof(dp));
	dp[0]=0;
	dp[1]=1;
	vector<pair<int,  int > > v;
	for(int i=0;i<k;i++)
	{
		int x, y;
		cin>>x>>y;
		v.push_back({x,y});
	}
	for(int i =1;i<=n+5;i++){
		if(i>2)
			dp[i]+=dp[i-1];

		ll now = dp[i]%mod;
		for(int j =0;j<v.size();j++){
			dp[i+v[j].first]=(dp[i+v[j].first]+now);
			dp[i+v[j].second+1]=(dp[i+v[j].second+1]-now);
		}
        //cout<<dp[i]<<endl;
	}
	cout<<dp[n]%mod;
	
	
}


Measured memory_bytes: 159844
N = int(input())
a = 0
b = 0
c = 0
d = 0

for _ in range(N):
    S = input()
    if S == "AC":
        a += 1
    if S == "WA":
        b += 1
    if S == "TLE":
        c += 1
    if S == "RE":
        d += 1

print("AC x "+str(a))
print("WA x "+str(b))
print("TLE x "+str(c))
print("RE x "+str(d))

Measured memory_bytes: 9208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(void){
    ll x, k, d;
    cin >> x >> k >> d;
    
    ll temp = abs(x);
    ll num = min(temp/d, k);
    k -= num;
    temp -= d*num;
    
    if(k%2!=0){
        cout << d-temp << endl;
    } else {
        cout << temp << endl;
    }
    
    //cout << abs(min) << endl;
    return 0;
}


Measured memory_bytes: 3636
#include<cstdio>
#include<cmath>
using namespace std;

int main() {
  double x1, y1, x2, y2;

  scanf("%lf %lf %lf %lf",&x1, &y1, &x2, &y2);

  printf("%.5f\n",sqrt(pow((x1 - x2),2) + pow((y1 - y2),2)));

  return 0;
}


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

int main() {
  int N, M, SumA=0, SumW=0;
  string S;
  cin >> N >> M;
  vector<int> P(M), W(N), A(N);
  rep(i, M){
    cin >> P.at(i) >> S;
    if(S=="WA" && A.at(P.at(i)-1)==0) W.at(P.at(i)-1)++;
    else if(S=="AC") A.at(P.at(i)-1)=1;
  }
  rep(i, N) SumA+=A.at(i);
  rep(i, N) if(A.at(i)==1) SumW+=W.at(i);
  cout << SumA << " " << SumW << endl;
}

Measured memory_bytes: 1408
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
int len[1010] = {},h[6],w[6],maxi=-1,cub[1010];
bool sc[1010],pc[1010];

 
int main(){
	for(int i=0; i<6; i++){
		cin >> h[i];
		if(maxi < h[i]) maxi = h[i];
		cin >> w[i];
		if(maxi < w[i]) maxi = w[i];
		if(h[i]==w[i])cub[h[i]]++;
		len[h[i]]++;
		len[w[i]]++;
	}

	for(int i=1; i<=maxi; i++){
		bool jud;
		if(cub[i] == 6)jud=true;
		else if(cub[i] == 2){
			if(len[i]%8 == 0) jud=true;
			else jud = false;
		}
		else if(cub[i] > 0)jud = false;
		else if(len[i]%4 != 0) jud = false;
		else jud = true;
		if(!jud){
			cout << "no" << endl;
			break;
		}
		if(i==maxi){
			cout << "yes" << endl;
		}
	}


    return 0;
}



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

const int M = 101010;

int main() {
    string a, b;
    cin >> a >> b;
    string s = a+b;
    int num = stoi(s);
    vector<int> square;
    for (int i=1; i*i<M; i++) {
        square.push_back(i*i);
    }
    for (int i: square) {
        if (i == num) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

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


double arr[3001];
double dp[3001][3001];
double rec(int i,int h){
    if(h==0)
    return 1;
    if(i<0)
    return 0;
    if(dp[i][h]>-0.9){
        return dp[i][h];
    }

    double val= arr[i]*rec(i-1,h-1)+(1-arr[i])*rec(i-1,h);
    dp[i][h]=val;
    return dp[i][h];
}


int main() {
    int n;
    cin>>n;
    for(int i=0;i<=n;i++){
        cin>>arr[i];
    }
   memset(dp,-1,sizeof(dp));
    cout<<fixed<<setprecision(10)<<rec(n-1,(n+1)/2);

}


Measured memory_bytes: 70784
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main()
{
	char a[200],b[200],c[200];
	int oa=0,ob=0,oc=0,n=0;
	scanf("%s%s%s",a,b,c);
	for(;;)
	{
		switch(n)
		{
			case 0:
				if(oa==strlen(a))
				{
					puts("A");
					return 0;
				}
				n=a[oa++]-'a';
				break;
			case 1:
				if(ob==strlen(b))
				{
					puts("B");
					return 0;
				}
				n=b[ob++]-'a';
				break;
			case 2:
				if(oc==strlen(c))
				{
					puts("C");
					return 0;
				}
				n=c[oc++]-'a';
				break;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll a, b;
    cin >> a >> b;

    if(a%2 != b%2) {
        out("IMPOSSIBLE");
    }
    else {
        out((a+b)/2);
    }
    
    re0;
}

Measured memory_bytes: 256
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <cmath>         // sqrt
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pl;
typedef pair<int, int> P;
typedef tuple<ll, ll, string> Tlls;

// Greatest Common Divisor (最大公約数)
ll gcd(ll a, ll b)
{
  // Eucledean algorithm
  while (a)
  {
    if (a < b)
    {
      std::swap(a, b);
    }
    a %= b;
  }
  return b;
}

// Least Common Multiple 最小公倍数
ll lcm(ll a, ll b)
{
  return a / gcd(a, b) * b;
}

// key: value of prime factor素因数分解
// value: number of prime factor
map<ll, ll> prime_factorization(ll n)
{
  map<ll, ll> prime_factors;
  for (ll i = 2; i * i <= n; i++)
  {
    while (n % i == 0)
    {
      prime_factors[i]++;
      n /= i;
    }
  }
  if (n != 1)
    prime_factors[n] = 1;
  return prime_factors;
}

// 約数リスト約数の列挙
vector<ll> get_divisors(const ll n)
{
  vector<ll> divs;
  for (ll i = 1; i < (ll)sqrt((ld)n) + 1; i++)
  {
    if (n % i == 0)
    {
      divs.push_back(i);
      if (i != n / i)
      {
        divs.push_back(n / i);
      }
    }
  }

  // 必要に応じてソート
  // sort(divs.begin(), divs.end());

  return divs;
}

int main()
{
  ll S, W;
  cin >> S >> W;

  if (W >= S)
  {
    cout << "unsafe" << endl;
  }
  else
  {
    cout << "safe" << endl;
  }

  return 0;
}


Measured memory_bytes: 3604
import java.util.Arrays;
import java.util.Scanner;
 
class Main {
    	static String str;
    	static Scanner sc = new Scanner(System.in);
    	public static void main(String[] args) {
        	str = sc.nextLine();
        	String[] dice = str.split(" ");
        	String[] x;
        	int y = Integer.parseInt(sc.nextLine());
         
        	for (int i = 0; i < y; i++) {
            		str = sc.nextLine();
            		x = str.split(" ");
            		sort(dice, x);
        	}
    	}

    	private static void sort(String[] dice, String[] x){
        	for(int i = 0; i < 4; i++){
            		for(int j = 0; j < 4; j++){
                		for (int h = 0; h < 4; h++) {
                    			String[] z = new String[i+j+(h*3)];
                    			String[] dice2 = Arrays.copyOf(dice, dice.length);
                    			for (int k = 0; k < i; k++) {
	                        		z[k] = "N";
	                    		}
	                    		for (int l = 0; l < j; l++) {
	                        		z[i+l] = "E";
	                    		}
	                    		for (int f = 0; f < h; f++) {
	                        		int num = f * 3;
	                        		z[i+j+num] = "W";
	                        		z[i+j+(num+1)] = "S";
	                        		z[i+j+(num+2)] = "E";
	                    		}
	                    		move(dice2, z);                     
	                    		if(dice2[0].equals(x[0]) && dice2[1].equals(x[1])){
	                        		System.out.println(dice2[2]);
	                        		return;
	                    		}
	                	}
	                }
	        }
	}
	    
	private static String[] move(String[] dice, String[] z) {
        	for (int i = 0; i < z.length; i++) {
            		if(z[i].equals("E")){
               			str = dice[0];
		                dice[0] = dice[3];
		                dice[3] = dice[5];
		                dice[5] = dice[2];
		                dice[2] = str;
            		}else if(z[i].equals("W")){
                		str = dice[0];
		                dice[0] = dice[2];
		                dice[2] = dice[5];
		                dice[5] = dice[3];
		                dice[3] = str;
		       	}else if(z[i].equals("S")){
		                str = dice[0];
		                dice[0] = dice[4];
		                dice[4] = dice[5];
		                dice[5] = dice[1];
		                dice[1] = str;
		        }else if(z[i].equals("N")){
		                str = dice[0];
		                dice[0] = dice[1];
		                dice[1] = dice[5];
		                dice[5] = dice[4];
		                dice[4] = str;
            		}
        	}
        	return dice;        
    	}
}

Measured memory_bytes: 17196
#include <stdio.h>

int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	
	int tambah = a+b;
	int kurang = a-b;
	int bagi = a*b;
	
	if(tambah>=kurang && tambah>=bagi){
		printf("%d\n",tambah);
	}else if(kurang>=tambah && kurang>=bagi){
		printf("%d\n",kurang);
	}else if(bagi>=kurang && bagi>=tambah){
		printf("%d\n",bagi);
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))

using namespace std;
typedef pair<llint, llint> P;

llint n, m, t;
llint x[100005], y[100005];
bitset<50005> bs[50005];
char ans[100005];

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> m >> t;
	for(int i = 1; i <= m; i++) cin >> x[i] >> y[i];
	
	if(t == 1){
		for(int i = 1; i <= n; i++) bs[i][i] = 1;
		for(int i = m; i >= 1; i--) bs[x[i]] |= bs[y[i]], bs[y[i]] |= bs[x[i]];
		
		bitset<50005> tmp;
		tmp.set();
		for(int i = 1; i <= n; i++) tmp &= bs[i];
		llint p = 0;
		for(int i = 1; i <= n; i++){
			if(tmp[i]){
				p = i;
				break;
			}
		}
		if(p == 0){
			cout << -1 << endl;
			return 0;
		}
		
		tmp.reset(), tmp[p] = 1;
		for(int i = m; i >= 1; i--){
			if(tmp[x[i]]) ans[i] = '^', tmp[y[i]] = 1;
			else{
				ans[i] = 'v';
				if(tmp[y[i]]) tmp[x[i]] = 1;
			}
		}
	}
	else{
		if(n == 2){
			cout << -1 << endl;
			return 0;
		}
		
		llint p = 0;
		for(int i = m; i >= 1; i--){
			if(y[i] > 3){
				ans[i] = '^';
				continue;
			}
			if(p == 0) ans[i] = '^';
			else{
				if(x[i] == x[p] && y[i] == y[p]) ans[i] = ans[p];
				else{
					if(x[p] != x[i] && y[p] != x[i]) ans[i] = '^';
					else ans[i] = 'v';
				}
			}
			p = i;
		}
	}
	
	for(int i = 1; i <= m; i++) cout << ans[i]; cout << endl;
	
	return 0;
}

Measured memory_bytes: 310760
#include<stdio.h>

int main(void){

  int num[5]={0};
  int a=0, b=0;
  int i=0, j=0, n=0, cnt=0;

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

  for(i=a; i<=b; i++){
    n=i;
    for(j=0; j<5; j++){
      num[j]=n%10;
      n=n/10;
    }

    if(num[0]==num[4] && num[1]==num[3])
      cnt++;

  }

  printf("%d\n", cnt);

  return 0;
}


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

using namespace std;

int main() {
    int n, d, x;
    cin >> n >> d >> x;

    int ans = x;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        ans += (d - 1) / a + 1;
    }

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

Measured memory_bytes: 256
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  int x, a;
  readf("%s %s\n", &x, &a);
  if (x < a) {
    writeln("0");
  } else {
    writeln("10");
  }
}


Measured memory_bytes: 256
open System 

type Explicit =          
    static member inline ($) (_:int32, _:Explicit) = int
    static member inline ($) (_:int64, _:Explicit) = int64

let inline convert (value:'a): 'b = 
    (Unchecked.defaultof<'b> $ Unchecked.defaultof<Explicit>) value

let inline fromInt (x: int): 'a = convert x

module NumericLiteralG =
    let inline FromZero(): ^a = LanguagePrimitives.GenericZero
    let inline FromOne(): ^a = LanguagePrimitives.GenericOne
    let inline FromInt32 n = fromInt n

let R() = Console.ReadLine()

let f (n: int) (m: int): bool =
    n = m 

let N, M = let t = R().Split() |> Array.map (string >> int) in t.[0], t.[1]

f N M 
|> function
| true -> "Yes"
| _ -> "No"
|> printfn "%s"

Measured memory_bytes: 29632