akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define  For(i,a,b) for(int i=a,i##E=b;i<=i##E;++i)
#define rFor(i,a,b) for(int i=a,i##E=b;i>=i##E;--i)
typedef long long LL;
using namespace std;
const int N=2010;
const int mod=1e9+7;
template<typename T>inline bool chkmin(T &a,const T &b){return a>b?a=b,1:0;}
template<typename T>inline bool chkmax(T &a,const T &b){return a<b?a=b,1:0;}
template<typename T>inline void read(T &x)
{
	x=0;int _f(0);char ch=getchar();
	while(!isdigit(ch))_f|=(ch=='-'),ch=getchar();
	while( isdigit(ch))x=x*10+ch-'0',ch=getchar();
	x=_f?-x:x;
}
inline void file()
{
#ifdef ztzshiwo
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif
}
int n,k;
int dp[N][N],S[N][N];
int main()
{
	file();
	read(n),read(k);
	dp[1][n-k]=1;
	For(i,1,n-1)
	{
		For(j,0,n)S[i][j]=((j?S[i][j-1]:0)+dp[i][j])%mod;
		For(j,0,n-1)dp[i+1][j]=S[i][j+1];
	}
	int ans=dp[n][0];
	For(i,1,n-k-1)ans=(ans<<1)%mod;
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 31744
program sample
    implicit none
  
    integer(8) :: i,j,m,n,a,b
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n,a,b
    if(a>b)then
        write(*,*)0
    else if(a==b)then
        write(*,*)1
    else if(n==1 .and. a/=b)then
        write(*,*)0
    else
        write(*,*) (b-a)*(n-2)+1
    end if
  
    stop
end program sample
  



Measured memory_bytes: 2856
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        Graph g = new Graph(n);
        for (int i = 0; i < n; i++)
        {
            int[] s = Console.ReadLine().Split(' ').Select(p => int.Parse(p)).ToArray();
            int u = s[0];
            for (int j = 2; j < s.Length; j++)
                g.SetEdge(u, s[j]);
        }
        g.BFS(1);
        for (int i = 0; i < n; i++)
            Console.WriteLine("{0} {1}", i + 1, g.d[i]);
    }
}
class Graph
{
    private int n;
    private List<int>[] adj;
    public int[] d;
    public Graph(int n)
    {
        this.n = n;
        adj = new List<int>[n];
        d = new int[n];
        for (int i = 0; i < n; i++)
        {
            adj[i] = new List<int>();
            d[i] = -1;
        }
    }
    public void SetEdge(int s, int g)
    {
        if (s > n || g > n)
            return;
        adj[s - 1].Add(g);
    }
    public List<int> GetEdge(int i)
    {
        return adj[i - 1];
    }
    public void BFS(int s)
    {
        d[s - 1] = 0;
        Queue<int> q = new Queue<int>();
        q.Enqueue(s);
        while (q.Count != 0)
        {
            int u = q.Dequeue();
            foreach (var v in GetEdge(u))
            {
                if (d[v - 1] == -1)
                {
                    d[v - 1] = d[u - 1] + 1;
                    q.Enqueue(v);
                }
            }
        }
    }
}


Measured memory_bytes: 10552
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int H, W;
    cin>>H>>W;
    vector<string> s(H);
    for(auto& e: s) cin>>e;

    for(int i=0; i<H; ++i) {
        for(int j=0; j<W; ++j) {
            if (s[i][j]!='#') continue;
            if (i>0 && s[i-1][j]!='.') s[i-1][j]=s[i][j]='O';
            if (j>0 && s[i][j-1]!='.') s[i][j-1]=s[i][j]='O';
            if (i<H-1 && s[i+1][j]!='.') s[i+1][j]=s[i][j]='O';
            if (j<W-1 && s[i][j+1]!='.') s[i][j+1]=s[i][j]='O';
        }
    }
    string res="Yes";
    for(auto& e: s) for(auto& c: e) if (c=='#') res="No";
    cout<<res<<endl;
}


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

#define debug(x) cerr << #x << ": " << x << endl
#define debugArray(x, n)                                                       \
    for(long long hoge = 0; (hoge) < (n); ++(hoge))                            \
    cerr << #x << "[" << hoge << "]: " << x[hoge] << endl
using namespace std;

using ll = long long;
using ull = unsigned long long;
const ll INF = LLONG_MAX / 2;
const ll MOD = 1e9 + 7;

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int N, K;
    cin >> N >> K;
    int h[N];
    for(int i = 0; i < N; i++) {
        cin >> h[i];
    }
    sort(h, h + N);
    int ans = 1e9 + 10;
    for(int i = 0; i + K - 1 < N; i++) {
        ans = min(ans, h[i + K - 1] - h[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <iostream> // cout, endl, cin
#include <iomanip>
#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 <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 <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
using namespace std;

int main(){
	int D;
	cin >> D;
	vector<int> C(26);
	for (int i = 0; i < 26; i++) {
		cin >> C.at(i);
	}
	vector<vector<int>> S(D, vector<int>(26));
	for (int d = 0; d < D; d++) {
		for (int l = 0; l < 26; l++) {
			cin >> S.at(d).at(l);
		}
	}
	vector<long long> S_max(26);
	for (int l = 0; l < 26; l++) {
		for (int d = 0; d < D; d++) {
			S_max.at(l) += S.at(d).at(l);
		}
	}
	int ans = 0;
	for (int i = 0; i < 25; i++) {
		if (S_max.at(i + 1) > S_max.at(i)) ans = i + 1;
	}
	for (int i = 0; i < D; i++) {
		cout << ans << endl;
	}
}


Measured memory_bytes: 3708
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++) {
			h[i] = sc.nextInt();
		}
		sc.close();

		h[0]--;
		for (int i = 1; i < n; i++) {
			if (h[i] < h[i - 1]) {
				System.out.println("No");
				return;
			}
			if (h[i] > h[i - 1]) {
				h[i]--;
			}
		}
		System.out.println("Yes");
	}
}


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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  string s,t;cin>>s>>t;
  int m,n;
  m=s.size();
  n=t.size();
  vector<vector<int>> dp(m+1,vector<int>(n+1,0));
  int i,j;
  for(i=1;i<=m;i++)
  {
    for(j=1;j<=n;j++)
    {
      dp[i][j]=max(dp[i-1][j-1],max(dp[i-1][j],dp[i][j-1]));
      if(s[i-1]==t[j-1])dp[i][j]=max(dp[i-1][j-1]+1,max(dp[i-1][j],dp[i][j-1]));
    }
  }
  string ans="";
  int nowi=m;
  int nowj=n;
  while(nowi>0&&nowj>0)
  {
    int val=dp[nowi][nowj];
    if(dp[nowi-1][nowj]==val-1&&dp[nowi][nowj-1]==val-1&&dp[nowi-1][nowj-1]==val-1)
    {
      ans+=s[nowi-1];
      nowi--;
      nowj--;
    }
    else if(dp[nowi-1][nowj]==val)
    {
      nowi--;
    }
    else
    {
      nowj--;
    }
  }
  reverse(all(ans));
  cout<<ans<<endl;
}


Measured memory_bytes: 35584
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

int main()
{
//	cut here before submit 
//	freopen ("testcase.SNDP", "r", stdin );
	int a, b, n;
	while (scanf ("%d%d%d", &a, &b, &n ) != EOF ){
		int sum = 0;
		rep (i, n ){
			int rem = a%b;
//			cerr << "rem: " << rem << endl;
			sum += (10*rem)/b;
			a = (10*rem)%b;
		} // end rep

		printf ("%d\n", sum );
	} // end loop
		
	return 0;
}

Measured memory_bytes: 1184
import sys
#ユークリッドの互除法
def gcd(x, y):
    if x % y == 0:
        return y
    else:
        return gcd(y, x % y)
#入力
N = int(input())
A = list(map(int, input().split()))
#カウントしていく
count= [0] * (1000001)
setwise_gcd = A[0]
for i in range(0,N):
    count[A[i]]+= 1
    setwise_gcd = gcd(setwise_gcd, A[i])

#全体のgcdが1でないならnot coprime
if setwise_gcd != 1:
    print("not coprime")
    sys.exit(0)
#A[x] % i == 0 && A[y] % i == 0 となるx, y が存在しないならpairwise coprime
for i in range(2,1000001):
    divided_count = count[i]
    now_number = 2 * i
    while(now_number<1000001):
        divided_count+= count[now_number]
        now_number+= i
    if(divided_count >= 2):
        print("setwise coprime")
        exit(0)
print("pairwise coprime")

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

using namespace std;

int main(){
    string O, E; cin >> O >> E;

    for (int i=0, j=0; i < O.size(); i++, j++){
        cout << O[i];
        if (j < E.size()) cout << E[i];
    }

    return 0;
}


Measured memory_bytes: 256
//#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>

using namespace std;


int main(){

	const int H = 5;
	double v, t, y;
	long long ans;

	while (cin >> v){
		t = v / 9.8;
		y = 4.9 * t * t;
		ans = (long long)(ceil(y / H)+1);
		cout << ans << endl;
	}


	return 0;
}

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

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

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


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  // ll N; cin >> N;
  // ll N, K; cin >> N >> K;
  // ll x, y, z; cin >> x >> y >> z;
  // ll a, b, c; cin >> a >> b >> c;
  string s; cin >> s;
  bool ok = false;
  bool fn = false, fs = false, fe = false, fw = false;
  rep(i, s.size()) {
    switch(s[i]) {
    case 'S':
      fs = true;
      break;
    case 'N':
      fn = true;
      break;
    case 'E':
      fe = true;
      break;
    case 'W':
      fw = true;
      break;
    }
  }
  ok = (fs == fn) && (fe == fw);
  
  
  // cout << ans << endl;
  cout << (ok?"Yes":"No") << endl;
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}


Measured memory_bytes: 3644
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
class Program
{
	static void Main()
	{
	long n = long.Parse(Console.ReadLine());
	long[] nums = Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);
  long answer = 0;
  long memo = 0;

  for(long i = 1; i < n; i++)
  {
    if(nums[i] == nums[i-1]) memo++;
    else memo = 0;
    if(memo % 2 == 1) answer++;
  }

	Console.WriteLine(answer);
	}
}

Measured memory_bytes: 13140
def main():
    n = int(input())
    As = sorted(list(map(int, input().split())))
    edeges = []
    i = 0
    while i < n-1:
        if As[i] == As[i+1]:
            edeges.append(As[i])
            i += 1
        i += 1
    if len(edeges) < 2:
        ans = 0
    else:
        ans = edeges[-1] * edeges[-2]
    print(ans)


if __name__ == "__main__":
    main()


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

using namespace std;

const int N = 2005;

int n, X, Y;

int cnt[2005];

int main(){
    scanf("%d%d%d",&n,&X,&Y);

    for(int i=1;i<=n;++i){
        for(int j=i+1;j<=n;++j){
            if(i<=X&&j<=Y){
                ++cnt[min(j-i,X-i+Y-j+1)];
            }else if(i<=X&&j>Y){
                ++cnt[X-i+j-Y+1];
            }else if(i<=Y&&j<=Y){
                ++cnt[min(j-i,i-X+Y-j+1)];
            }else if(i<=Y&&j>Y){
                ++cnt[min(j-i,i-X+j-Y+1)];
            }else{
                ++cnt[j-i];
            }
        }
    }

    for(int i=1;i<n;++i){
        printf("%d\n",cnt[i]);
    }


    return 0;
}


Measured memory_bytes: 3788
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
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;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> n;
  rep(i, n) {
    cin >> a;
    if (i % 2 == 1) continue;
    if (a % 2 == 0) continue;
    ans++;
  }
  Cout(ans);
  return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 4e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

int main() {
    init();
    string s;
    getline(cin, s);

    stack<ll> st;
    string tmp;
    repa(c, s){
        if(c==' '){
            if (tmp != "") st.push(stoi(tmp)), tmp = "";
        }
        else if(c=='+'){
            ll a = st.top();
            st.pop();
            st.top() += a;
        }
        else if(c=='-'){
            ll a = st.top();
            st.pop();
            st.top() -= a;
        }
        else if(c=='*'){
            ll a = st.top();
            st.pop();
            st.top() *= a;
        }
        else{
            tmp += c;
        }
    }

    cout << st.top() << endl;
}


Measured memory_bytes: 3216
#include <stdio.h>

int main(void){
	int l[10];
	int interval[11];
	int v1, v2;
	int x;
	double y;
	int i;

	while(1){
		if(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &l[0], &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2) == EOF) break;
		x = 0;
		interval[0] = 0;
		for(i=0; i<10; i++){
			interval[i+1] = interval[i] + l[i];	
			x += l[i];
		}
		y = (1.0 * v1 * x) / (v1 + v2);
		for(i=0; i<10; i++){
			if(interval[i] < y && y <= interval[i+1]){
				printf("%d\n", i+1);
			}
			if(y == interval[0]) puts("1");
		}
		
	}
	return 0;
}

Measured memory_bytes: 0
using System;
using System.Collections.Generic;
using System.Linq;

public class Hello
{
    private const int MOD_N = 1000000000 + 7;

    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var sps = new KeyValuePair<int, KeyValuePair<string, int>>[n];
        for (int i = 0; i < sps.Length; ++i)
        {
            var list = Console.ReadLine().Split(' ');
            var s = list[0];
            var p = int.Parse(list[1]);
            sps[i] = new KeyValuePair<int, KeyValuePair<string, int>>(i + 1, new KeyValuePair<string, int>(s, p));
        }

        Array.Sort(
            sps,
            (l, r) =>
            {
                var lsp = l.Value;
                var rsp = r.Value;

                var scomp = lsp.Key.CompareTo(rsp.Key);
                return scomp != 0 ? scomp : rsp.Value.CompareTo(lsp.Value);
            }
        );

        for (int i = 0; i < sps.Length; ++i)
            Console.WriteLine(sps[i].Key);
    }

    private static int Comb(int m, int n)
    {
        var t = m - n;
        if (n > t)
            n = t;

        long numerator = 1;
        for (int i = 0; i < n; ++i)
        {
            numerator *= m - i;
            numerator %= MOD_N;
        }
        long denominator = 1;
        for (; n != 0; --n)
        {
            denominator *= n;
            denominator %= MOD_N;
        }

        var inv_denominator = ModInv((int)denominator, MOD_N);
        var ret = (int)(numerator * inv_denominator % MOD_N);

        return ret >= 0 ? ret : ret + MOD_N;
    }

    private static int ModInv(int a, int m)
    {
        int b = m, x = 1, y = 0;
        while (b != 0)
        {
            var t = a / b;
            a -= t * b;
            Swap(ref a, ref b);
            x -= t * y;
            Swap(ref x, ref y);
        }
        x %= m;
        return x >= 0 ? x : x + m;
    }

    private static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
}


Measured memory_bytes: 13408
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*----------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

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


Measured memory_bytes: 256
n = int(input())
s = input()
count = 0
ans = 1 
for i, x in enumerate(s):
    if (i%2 == 0 and x == "B") or (i%2 == 1 and x == "W"): # B:1(R), W:0(L)
        count += 1
    else:
        ans *= count
        count -= 1
        ans %= (10**9+7)
if count != 0:
    print(0)
else:
    for i in range(1, n+1):
        ans *= i
        ans %= (10**9+7)
    print(ans)


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

int gcd(int a, int b) {
    return b ? gcd(b, a%b) : a;
}

int main() {
    int N, K; scanf("%d%d", &N, &K);
    int g = -1, ma = 0;
    for(int i=0; i<N; i++) {
        int p; scanf("%d", &p);
        if(g < 0) g = p;
        else g = gcd(g, p);
        if(ma < p) ma = p;
    }

    printf("%s\n", (K % g || K > ma ? "IMPOSSIBLE" : "POSSIBLE"));
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define MOD (long long)1000000007
#define INF (long long)998244353
using namespace std;

int main(void){
    int a,b,x;
    cin >> a >> b >> x;
    double thita=45.0;
    if(x>a*a*b/2){
        double temp=(double)x/a/a*2-b;
        thita=atan((double)a/(b-temp));
        thita=90-(thita)*180/M_PI;
    }else {
        double temp=-(double)x/a/b*2;
        thita=atan((double)b/temp);
        thita=-((thita)*180/M_PI);
    }
    cout << setprecision(10) << thita << endl;
    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10
 
 
def main():
    x, a, b = map(int, input().split())
    print("A" if abs(x - a) < abs(x - b) else "B")
 
 
if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
N, M = map(int, input().split())
bulbs = []
for _ in range(M):
    b = tuple(map(int, input().split()))
    bulbs.append(b[1:])
p = list(map(int, input().split()))    

ans = 0
for switch in range(2**N):
    check = [0] * M
    for i, bulb in enumerate(bulbs):
        cnt = 0
        for b in bulb:
            if switch >> (b-1) & 1:
                cnt += 1
                
        if cnt % 2 == p[i]:
            check[i] = True
        else:
            check[i] = False
        
    if all(check):
        ans += 1

print(ans)

Measured memory_bytes: 3064
//C
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

//C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

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


//LOVE NyantakoGG	https://www.youtube.com/channel/UC6XdFs8T6Ei54O0FYl3PVVA


using namespace std;



int main() {
	int N;
	cin >> N;
	vector<int>data(N);
	for (int i = 0; i < N; i++) {
		cin >> data[i];
	}
	sort(data.begin(), data.end());
	cout << data[N - 1] - data[0] << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#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++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int main(int argc, char* argv[]) {
   int a, b, c;
   cin >> a >> b >> c;
   int ans;
   ans = b/a;
   if(ans > c) ans = c;
   cout << ans << endl; 
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int s[3], t[3], u[3], _time, vtime;

void printtime(int sec) {
	printf("%02d:%02d:%02d\n", sec / 3600, (sec / 60) % 60, sec % 60);
}

int main() {
	while (true) {
		cin >> s[0] >> s[1] >> s[2];
		if (s[0] == -1) { break; }
		_time = s[0] * 3600 + s[1] * 60 + s[2];
		vtime = 7200;
		printtime(vtime - _time);
		printtime(vtime * 3 - _time * 3);
	}
}

Measured memory_bytes: 1160
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int tate = in.nextInt();
        int yoko = in.nextInt();
        int menseki = tate*yoko;
        int syu = tate*2+yoko*2;
        System.out.println(menseki + " " + syu);
    }
}

Measured memory_bytes: 26252
#include<bits/stdc++.h>
/*---------------------Define--------------------*/
#define int long long
#define next nextt
#define pii pair<int,int>
#define fi first
#define se second
#define rd random
#define ll long long
#define taskname ""
#define pb push_back
#define mp make_pair
#define pb push_back
#define popb pop_back
#define popf pop_front
#define pf push_front
#define res(a,z,n) for(int i = 1 ; i<=n ; i ++) a[i] = z;
/*-------------------necesary---------------------*/
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/*------------------limit-------------------------*/
const int base  = 998244353 ;
const int oo = 1e6 + 10;
const int gh = 1e3 + 3 ;
const int inf = 1e15 + 5 ;
double pi=2*asin(1);
/*-----------------globalvari-----------------------*/
int n,m,k,q;
int a[oo];
int b[oo];
int sum[oo];
string s;
char c[oo];
//int sum[oo];
/*-----------------code-----------------------*/


void input()
{
    cin>>n>>k;
    for(int i = 1;  i <= n ; i ++)
        cin>>a[i];
    int x,y;
    int ans =n ;
    for(int i = 1 ;  i<= k ; i ++)
    {
        cin>>x>>y;
        if(a[x] < a[y]) {if(b[x] == 0 ) ans -- ,b[x] = 1;}
        else if(a[x] > a[y]) {if(b[y] == 0 ) ans -- ,b[y] = 1;}
        else { if(b[x] == 0 ) ans -- ,b[x] = 1;if(b[y] == 0 ) ans -- ,b[y] = 1;}
    }
    cout<<ans;

    //read
}

void cre()
{

}

void solve()
{
    cre();
    //main code here :))
}

void ouput()
{

    //write
}

int32_t main()
{

    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //#ifndef ONLINE_JUDGES
    if (ifstream("test.txt"))
    {
        freopen("test.txt", "r", stdin);
        #ifdef CHECKING
            freopen(taskname".out", "w", stdout);
        #else
            //\freopen("test.out", "w", stdout);
        #endif //CHECKING
    }
    else if (ifstream(taskname".inp"))
    {
        freopen(taskname".inp", "r", stdin);
        freopen(taskname".out", "w", stdout);
    }
    //#endif // ONLINE_JUDGES
    int t=1;
   // cin>>t;

    while(t--)
    {
    input();
    solve();
    ouput();
    }
}

//ilove??<3


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

int X, Y;

cin >> X >> Y;

if(Y % 2 != 0)
cout << "No" << endl;

else if(X * 4 >= Y && X * 2 <= Y)
cout << "Yes" << endl;

else
cout << "No" << endl;
    
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main(){
  int64_t T1, T2, A1, A2, B1, B2;
  cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
  bool same = false;
  if(T1*A1 + T2*A2 < T1*B1 + T2*B2){
    swap(A1,B1);
    swap(A2,B2);
  }
  if(T1*A1 + T2*A2 == T1*B1 + T2*B2){
    same = true;
  }
  
  if(same){
    cout << "infinity" << endl;
  }
  else{
    int64_t ans = 0;
    if(A1 < B1){
      int64_t sub = T1*A1 + T2*A2 - (T1*B1 + T2*B2);
      int64_t one = T1*B1 - T1*A1;
      //cout << sub << " " << one << endl;
      ans = 1;
      ans += (one/sub)*2;
      if(one %sub == 0){
        ans--;
      }
    }
    cout << ans << endl;
  }
}

Measured memory_bytes: 256
//#include <stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
#define PI 3.14159265359;

class Hoge{
  public:
					long int i0;
	int i1,N0;
	long int D;
					string s0;
					int* iarray0;
					Hoge(int);
					void func0();
					void array0();
	void printarray0();
	~Hoge();
  private:
	
	void inputarray(int*,int);
	void inputarray2(long int*,long int*,int);
	void printarray(int*,int);
	void calcarray(long int*,long int*,int);
	
};


Hoge::Hoge(int itemp){
	
	i0=itemp;
	//cout<<"i0="<<i0<<endl;
	
									}

void Hoge::func0(){
	//cout<<"N0?"<<endl;
	cin>>N0;
	//iarray0=new int[N0];
	//int N1=3;int N2=2;
	cin>>D;
	
	long int* iarray1=new long int[N0];
	long int* iarray2=new long int[N0];

	//inputarray(iarray0,N0);
	//printarray(iarray0,N0);
	inputarray2(iarray1,iarray2,N0);
	//printarray(iarray1,N0);
	//printarray(iarray2,N0);
	
	calcarray(iarray1,iarray2,N0);
	
	delete [] iarray1;
	delete [] iarray2;
	
								}


void Hoge::array0(){

	cout<<"N0?";
	cin>>N0;
	
	
	for (int i0=0;i0<N0;i0++){
		cout<<"i0="<<i0<<endl;
		cin>>iarray0[i0];
		
		
	}
}

void Hoge::inputarray(int* itemp,int itempn){
	
	int* iarray=itemp;
	int n0=itempn;
	for (int i0=0;i0<n0;i0++){
		cout<<"i0="<<i0<<endl;
		cin>>iarray[i0];
	}
}
void Hoge::inputarray2(long int* itemp,long int* itemp2,int itempn){
	
	long int* iarray=itemp;
	long int* iarray2=itemp2;
	int n0=itempn;
	
	for (int i0=0;i0<n0;i0++){
		//cout<<"i0="<<i0<<endl;
		cin>>iarray[i0];
		cin>>iarray2[i0];
	}
}

void Hoge::printarray(int* itemp,int itempn){
	
	int* iarray=itemp;
	int n0=itempn;
	for (int i0=0;i0<n0;i0++){
		cout<<"iarray["<<i0<<"]="<<iarray[i0]<<endl;
	
	}
}

void Hoge::calcarray(long int* itemp1,long int*itemp2,int itempn){
	
	long int* iarray1=itemp1;
	long int* iarray2=itemp2;
	int n0=itempn;
	int nsum0=0;
	for (int i0=0;i0<n0;i0++){
		//cout<<"r^2="<<(iarray1[i0]*iarray1[i0]+iarray2[i0]*iarray2[i0])<<endl;
				if((iarray1[i0]*iarray1[i0]+iarray2[i0]*iarray2[i0])<=(D*D)){nsum0++;}
	}
	//cout<<"nsum0="<<nsum0<<endl;
	cout<<nsum0<<endl;
}


	void Hoge::printarray0(){
							 
							 for (int i0=0;i0<N0;i0++){
			cout<<"iarray0["<<i0<<"]="<<iarray0[i0]<<endl;
										 							 }
}


Hoge::~Hoge(){
	
	//delete [] iarray0;
							}
int main(){
				int N=0;
				//cin>>N;
	Hoge* hoge=new Hoge(N);
	hoge->func0();
	
	return 0;
	delete hoge;
}//end of main

Measured memory_bytes: 6324
#include<iostream>
#include<algorithm>
#include<functional>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<deque>
#include<sstream>
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<bitset>
#include<time.h>
#include<cstdlib>
#include<cassert>
#define ll long long
#define fi first
#define se second
using namespace std;

ll n,m,k;
                   
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout<<fixed;
#ifdef LOCAL_DEFINE
    freopen("in", "r", stdin); 
    freopen("out","w",stdout);
#endif
  cin>>n>>m>>k;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=m;j++){
      if(i*m+j*n-i*j*2==k){
        cout<<"Yes"<<endl;
        return 0;
      }
    }
  }
  cout<<"No"<<endl;
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

int main() {
    int s;
    while (cin >> s) {
        int a[4];
        int b[4];
        a[0] = s;
        REP(i,3) cin >> a[i+1];
        REP(i,4) cin >> b[i];
        
        int hit = 0;
        REP(i,4) {
            if (a[i] == b[i]) hit++;
        }
        
        int blow = 0;
        REP(i,4) {
            if (find(begin(a), end(a), b[i]) != end(a)) {
                if (b[i] != a[i]) blow++;
            }
        }
        
        cout << hit << " " << blow << endl;
    }
    return 0;
}

Measured memory_bytes: 3088
H,W,K = map(int, raw_input().split())
K -= 1

if W==1:
  print 1
  exit(0)

mod = 1000000007

T = [0]*W
T[0] = 1
for i in range(H):
  P = T
  T = [0]*W
  for b in range(1<<(W-1)):
    ok = True
    for j in range(W-2):
      if b>>j&1 and b>>(j+1)&1:
        ok = False
    if ok:
      for j in range(W):
        if j>0 and b>>(j-1)&1:
          T[j-1] += P[j]
          T[j-1] %= mod
        elif j<W-1 and b>>j&1:
          T[j+1] += P[j]
          T[j+1] %= mod
        else:
          T[j] += P[j]
          T[j] %= mod
print T[K]


Measured memory_bytes: 2696
import java.util.*;
public class Main{
	public static void main(String args[]){
    	Scanner s = new Scanner(System.in);
      	long a = s.nextLong();
      	long b= s.nextLong();
      	long mul = a*b;
      	if(a ==1 || b==1)
      		System.out.println(1);	
      	else if(mul%2 == 0)
          	System.out.println(mul/2);
      	else
          	System.out.println(mul/2+1);
    }
}

Measured memory_bytes: 23764
import java.util.Scanner;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String low = str.toLowerCase();
        String up = str.toUpperCase();
        
        for(int i = 0 ; i < str.length() ; i++ ){
            if(str.charAt(i) == low.charAt(i)){
                System.out.print(up.charAt(i));
            } else {
                System.out.print(low.charAt(i));
            }
        }
        System.out.println();
        
    }
}


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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
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(){
	ll int a[31];
	a[1] = 1;
	a[2] = 2;
	a[3] = 4;
	int n;
	for(int i = 4; i <= 30; i++){
		a[i] = a[i-1] + a[i-2] + a[i-3];
	}
	while(cin >> n, n){
		cout << a[n]/3650+(a[n]%3650!=0) << endl;
	}
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;

typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)

long long modinv(long long a, long long m=MOD) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
    /*MODの割り算の際に
    a/＝b;
    を
    a *= modinv(b,MOD);
    とする。
        */
}



const int MAXN = 200001;
int A[MAXN];
int main(){
    int N;cin >> N;
    Rep(i,N)cin >> A[i];
    map<ll,ll> lmap;
    map<ll,ll> smap;
    Rep(i,N){
        ll large = i + A[i];
        ll small = i - A[i];
        if(lmap[large]>0)lmap[large]++;
        else lmap[large] = 1;
        if(smap[small]>0)smap[small]++;
        else smap[small] = 1;
    }
    ll ans = 0;
    Rep(i,N){
        ll large = i + A[i];
        ll small = i - A[i];
        smap[small]--;
        ans += smap[large];
        lmap[large]--;
    }

    cout << ans << endl;
    


    return 0;
}

Measured memory_bytes: 38532
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
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 INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  IOS;
  string s,t;
  cin >> s >> t;
  int ss = s.size(), ts = t.size();

  int ans = ts;
  REP(i, ss - (ts - 1) ) {
    int cnt = 0;
    string tmps = s.substr(i, ts);
    REP(j,ts) {
      if (tmps[j] != t[j]) cnt++;
    }
    chmin(ans, cnt);
  }
  COUT(ans);


  return 0;
}


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

int main(){
  int H[100],W[100];
  int k = 0;
  while(true){
  	cin >> H[k] >> W[k];
    if((H[k] == 0)&&(W[k] == 0))
      break;
    k++;
  }
  for(int l = 0; l < k; l++){
  	for(int i = 0; i < H[l]; i++){
  		for(int j = 0; j < W[l]; j++){
      		if(i % 2 == 0){
      			if(j % 2 == 0)
        			cout << "#";
      			else
        			cout << ".";
      			}
      		else{
        		if(j % 2 == 0)
        			cout << ".";
      			else
        			cout << "#";
      		}
    	}
   	 	cout << endl;
  	}
    cout << endl;
  }
}


Measured memory_bytes: 3104
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>
#include <time.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

int N, K, P[212345];

int main() {

	scanf("%d %d", &N, &K);
	rep(i, N) scanf("%d", &P[i]);

	set<int> s;

	rep(i, K) s.insert(P[i]);

	int ans = 1;

	bool ff[212345] = {};

	for (int i = K; i < N; ++i) {
		bool f = true;
		if (*s.begin() != P[i - K]) f = false;
		s.erase(s.find(P[i - K]));
		s.insert(P[i]);
		if (*s.rbegin() != P[i]) f = false;
		if (!f) ans++;
		ff[i - K] = f;
	}

	bool zoi[212345] = {};
	rep(i, N - 1) {
		if (P[i + 1] > P[i]) zoi[i] = true;
	}

	int zoizoi = 0;
	int c = 0;
	rep(i, K - 1) {
		if (zoi[i]) c++;
	}
	if (c == K - 1) zoizoi++;
	rep(i, N - K) {
		if (zoi[i]) c--;
		if (zoi[i + K - 1]) c++;
		if (c == K - 1 && !ff[i]) zoizoi++;
	}
	if (zoizoi) zoizoi -= 1;

	printf("%d\n", ans - zoizoi);

	return 0;
}


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

using namespace std;

int main()
{
	string s;
	cin >> s;
	int a[30] = {};
	for (int i = s.length(); i--;) {
		a[s[i] - 'a'] = 1;
		if (s.length() == 26 && i < 25 && s[i] < s[i + 1]) {
			while (!a[++s[i] - 'a']);
			cout << s.substr(0, i + 1) << endl;
			return 0;
		}
	}
	if (s.length() == 26) {
		cout << -1 << endl;
		return 0;
	}
	int n = -1;
	while (a[++n]);
	cout << s + char('a' + n) << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
const int N = 1e5+3;

int a[N];

int32_t main() {

    ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

    string s;
    cin>>s;
    int l = s.length();
    int now = 0;
    for(int i=0;i<l;i++){
        if(s[i] == 'R') now++;
        else {
            if(now&1) a[i-1] += now/2+1,a[i] += now/2;
            else a[i] += now/2,a[i-1]+=now/2;
            now = 0;
        }
    }
    now = 0;
    for(int i=l-1;~i;i--){
        if(s[i] == 'L') now++;
        else {
            if(now&1) a[i+1] += now/2+1,a[i] += now/2;
            else a[i] += now/2,a[i+1]+=now/2;
            now = 0;
        }
    }
    for(int i=0;i<l;i++) cout<<a[i]<<' ';
     
    return 0;
}

Measured memory_bytes: 1104
H, W =map(int, input().split())
while not (H == 0 and W == 0):
 for h in range(H):
  if h == 0 or h == H-1:
   print("#" * W)
  else:
   print("#" + "."*(W-2) + "#")
 print()
 H, W =map(int, input().split())

Measured memory_bytes: 7636
#include <bits/stdc++.h>
#define hell 1000000007
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define ll long long 
#define pi 3.1415926536
using namespace std;
const ll N=1e5+5;
void solve()
{ll n,k,m,l,h,r,x,z,w,mini,maxi=INT_MAX,prev;
  cin>>n>>m;
  vector<ll> v(n);x=0;
  for(ll i=0;i<n;i++)
  cin>>v[i],x+=v[i];
  sort(v.rbegin(),v.rend());
  double y=(double)x/(4*m);
  if(((double)v[m-1])>=y)
  cout<<"Yes"<<endl;
  else
  cout<<"No";
}
  
int main()
{
  fast
  //fact();
  //chk();
ll t=1;
//cin>>t;
//SieveOfEratosthenes();
//cout<<"ok";
while(t--)
{ //cout<<"ok";

solve();
 //cout<<ma<<endl;
}
return 0;}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

int n, count;
int S[500000], L[250001], R[250001];

inline void merge(int left, int mid, int right) {
//    printf("[merge] left = %d, mid = %d, right = %d\n",
//                    left,      mid,      right);
    int n1 = mid - left, n2 = right - mid;
    memcpy(L, S + left, sizeof(int) * n1);
    memcpy(R, S + mid, sizeof(int) * n2);
    L[n1] = R[n2] = 1e9+1;      // sentinel 
    for (int i = 0, j = 0, k = left; k < right; ++k) {
        ++count;
        if (L[i] <= R[j]) {
            S[k] = L[i++];
        }
        else {
            S[k] = R[j++];
        }
    }
}

inline void merge_sort(int left, int right) {
    if (left + 1 < right) {
        int mid = (left + right) / 2;
//        printf("[merge_sort] left = %d, mid = %d, right = %d\n",
//                             left,      mid,      right);
        merge_sort(left, mid);
        merge_sort(mid, right);
        merge(left, mid, right);
    }
}

int main(void) {

    scanf("%d", &n);

    for (int i = 0; i < n; ++i) {
        scanf("%d", S + i);
    }

    merge_sort(0, n);

    printf("%d", S[0]);
    for (int i = 1; i < n; ++i) {
        printf(" %d", S[i]);
    }
    printf("\n%d\n", count);

    return 0;
}

Measured memory_bytes: 5120
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

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

	int N;
	cin >> N;
	vector<int> L(N);
	for (int i = 0; i < N; i++) {
		cin >> L[i];
	}

	int cnt = 0;
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			for (int k = j + 1; k < N; k++) {
				if (L[i] != L[j] && L[j] != L[k] && L[k] != L[i]) {
					if (L[i] < L[j] + L[k] && L[j] < L[k] + L[i] && L[k] < L[i] + L[j]) {
						cnt++;
					}
				}
			}
		}
	}
	cout << cnt << "\n";
	return 0;
}


Measured memory_bytes: 3648
#include <algorithm>
#include <iomanip>
#include <iostream>

using namespace std;

#define SIDE 4
#define N 16
#define LIMIT 100

struct Board {
  int state[N];
  int zero_pos;
  int md;
};

int DX[4] = { 0, 1, 0, -1 };
int DY[4] = { 1, 0, -1, 0 };
char DIR[4] = { 'u', 'r', 'd', 'l' };

int MDs[N][N];
int path[LIMIT];
Board b;
int limit;

bool dfs(int depth, int prev) {
  if (b.md == 0) return true;
  if (depth + b.md > limit) return false;

  int sx = b.zero_pos / SIDE;
  int sy = b.zero_pos % SIDE;

  Board tmp;

  for (int i = 0; i < 4; i++) {
    int new_x = sx + DX[i];
    int new_y = sy + DY[i];

    if (new_x < 0 || new_x >= SIDE || new_y < 0 || new_y >= SIDE) continue;
    if (max(prev, i) - min(prev, i) == 2) continue;

    tmp = b; // preserve current board

    b.md -= MDs[new_x * SIDE + new_y][b.state[new_x * SIDE + new_y] - 1];
    b.md += MDs[sx * SIDE + sy][b.state[new_x * SIDE + new_y] - 1];

    swap(b.state[sx * SIDE + sy], b.state[new_x * SIDE + new_y]);
    b.zero_pos = new_x * SIDE + new_y;

    if (dfs(depth + 1, i)) {
      path[depth] = i;
      return true;
    }

    b = tmp; // restore current board
  }

  return false;
}

int get_MD_sum(Board in) {
  int sum = 0;
  for (int i = 0; i < N; i++) {
    if (in.state[i] == N) continue;
    sum += MDs[i][in.state[i] - 1];
  }
  return sum;
}

void ida(Board in) {
  in.md = get_MD_sum(in);

  for (limit = in.md; limit <= LIMIT; limit++) {
    b = in;
    if (dfs(0, -100)) {
      string ans = "";
      for (int i = 0; i < limit; i++) ans += DIR[path[i]];

      cout << ans.size() << endl;
      return;
    }
  }
}

int main() {
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      MDs[i][j] = abs(i / SIDE - j / SIDE) + abs(i % SIDE - j % SIDE);

  Board in; 

  for (int i = 0; i < N; i++) {
    cin >> in.state[i];
    if (in.state[i] == 0) {
      in.state[i] = N;
      in.zero_pos = i;
    }
  }

  ida(in);
}



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

int main(){

  int n;
  int a[100];
  cin >> n;
  for(int i=0; i<n; i++){
  	cin >> a[i];
  }
  
  int count=1;
  
  sort(a, a + n ,greater<int>());
  int key = a[0];
  for(int i=0; i<n; i++){
  	if(a[i] != key){
    	key = a[i];
        count++;
    }
  }
  cout << count << endl;
  
}

Measured memory_bytes: 256