akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp14
{
    class Class1
    {
        static void Main()
        {
            var I = Console.ReadLine().Split().Select(int.Parse).ToArray();
            long K = I[0];
            long A = I[1];
            long B = I[2];
            long ans = 1;
            if (B - A > 2)
            {
                if (K <= A)
                {
                    ans += K;
                }
                else
                {
                    ans = A;
                    K -= A - 1;
                    ans += K / 2 * (B - A);
                    ans += K % 2;
                }
            }
            else
            {
                ans += K;
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13268
// #include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

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

const int MAX = 100;
const int INF = (1<<12);

int main() {
  int N, x;
  int ans = 0;
  cin >> N >> x;
  vector<int> A(N);
  rep(i,N) cin >> A[i];
  sort(A.begin(),A.end());
  rep(i,N) {
    if(A[i] <= x){
      ans++;
      x -= A[i];
    }
  }

  if(ans == N && x > 0) ans--;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import sys
from collections import Counter
from collections import deque
import math
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,m,Q=mp()
grid=[[0]*(n+1) for i in range(n+1)]
for i in range(m):
    l,r=mp()
    for k in range(1,l+1):
        grid[k][r]+=1

for i in range(n):
    for k in range(n):
        grid[i][k+1]+=grid[i][k]



for i in range(Q):
    p,q=mp()
    print(grid[p][q])

Measured memory_bytes: 55388
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int d = scanner.nextInt();

        if(n % (2 * d + 1) == 0){
            System.out.println(n / (2 * d + 1));
        } else {
            System.out.println(n / (2 * d + 1) + 1);
        }
    }
}


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

int main() {
	// your code goes here
	int a,s,m,h;
	cin>>a;
	h=a/3600;
	m=a%3600/60;
s=a%3600%60;
cout<<h<<":"<<m<<":"<<s<<endl;
	return 0;
}

Measured memory_bytes: 1164
//MADE BY Y_is_sunshine;
//#include <bits/stdc++.h>
//#include <memory.h>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define pb push_back
#define pf push_front
#define INF 0x3f3f3f3f
#define MAXN (int) 1e6 + 7
#define all(a) a.begin(), a.end()

typedef long long ll;

const ll mod = 1e9 + 7;
const double PI = acos(-1);

using namespace std;

int N, M, K, T;

int dp[MAXN];

signed main(void) {

#ifdef Sunshine
	freopen("data.txt", "r", stdin);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	memset(dp, 0x3f, sizeof(dp));

	cin >> N >> K;

	vector<int>d(N + 1);
	for (int i = 1; i <= N; i++)
		cin >> d[i];

	dp[1] = 0;
	for (int i = 2; i <= N; i++) {
		for (int j = max(1, i - K); j < i; j++) {
			dp[i] = min(dp[i], dp[j] + abs(d[j] - d[i]));
		}
	}

	cout << dp[N] << '\n';











#ifdef Sunshine
	freopen("CON", "r", stdin);
	system("pause");
#endif
	return 0;
}

Measured memory_bytes: 4608
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string.h>
#include<cmath>
using namespace std;
typedef long long ll;
#define N 100005
int main()
{
    int n,m,i,j,k,l;
    int T,unit;
    int x,z,y,x1,y1;
    int ans1=0,ans2=0;
    int n1,n2;
    int a[100005]={0};
    scanf("%d%d%d",&n,&m,&T);
    for(i=0;i<T;i++)
    {
        scanf("%d",&x);
        a[x]++;
    }
    for(i=1;i<=n;i++)
    {
        if(m<=T-a[i])
            printf("No\n");
        else
            printf("Yes\n");
    }
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>

using namespace std;

int main() {
    int n;
    cin >> n;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        int l, r;
        cin >> l >> r;
        cnt += r-l+1;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn =1e5+13;

char s[maxn];
int main()
{
	scanf("%s",s);
	printf("%s",s);
	int len = strlen(s);
	if(s[len-1]=='s')
	{
		printf("es");
	}
	else printf("s");
 } 

Measured memory_bytes: 3744
# AOJ 1030 Cubes Without Holes
# Python3 2018.7.6 bal4u

import sys
from sys import stdin
input = stdin.readline

while True:
	n, h = map(int, input().split())
	if n == 0: break
	ans = []
	for i in range(h):
		c, a, b = input().split()
		a, b = int(a)-1, int(b)-1
		if c == "xy":
			ans += [a+b*n+z*n**2 for z in range(n)]
		elif c == "xz":
			ans += [a+y*n+b*n**2 for y in range(n)]
		else:
			ans += [x+a*n+b*n**2 for x in range(n)]
	print(n**3-len(set(ans)))


Measured memory_bytes: 10272
n = int(input())
l = list(map(int, input().split()))
n_ = n + 3
mod = 10**9+7
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod
revs = [rev[i+1]*fun[i] for i in range(n_)]
for i in range(n_-1):
  revs[i+1] = (revs[i+1] + revs[i])%mod
ans = 0
for i in range(n-1):
  ans += (l[i+1]-l[i])*revs[i]
  ans %= mod
print(ans*fun[n-1]%mod)

Measured memory_bytes: 19216
#include <bits/stdc++.h>
#define rt "\n"
#define sp " "
#define test1 cout << "test1" << endl;
#define test2 cout << "test2" << endl;
#define fixprecision(n) fixed; cout << setprecision(n)
#define kyopro ios::sync_with_stdio(false);cin.tie(NULL)
#define MOD 1000000007
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define iikae auto&
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

int main(){
  kyopro;
  char b, a;
  cin >> b;
  if(b == 'A') a = 'T';
  else if(b == 'T') a = 'A';
  else if(b == 'C') a = 'G';
  else if(b == 'G') a = 'C';
  cout << a << rt; 
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n[] = new int[3];
		n[0] = sc.nextInt();
		n[1] = sc.nextInt();
		n[2] = sc.nextInt();
		Arrays.sort(n);
		sc.close();
		System.out.println(n[2] * 10 + n[1] + n[0]);

	}
}



Measured memory_bytes: 35888
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

immutable long INF = 1L << 59;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto S = s[2] - 1;
    auto T = s[3] - 1;

    auto G = new Tuple!(int, long)[][](N);
    auto H = new Tuple!(int, long)[][](N);
    foreach (i; 0..M) {
        auto t = readln.split;
        G[t[0].to!int-1] ~= tuple(t[1].to!int-1, t[2].to!long);
        G[t[1].to!int-1] ~= tuple(t[0].to!int-1, t[2].to!long);
        H[t[0].to!int-1] ~= tuple(t[1].to!int-1, t[3].to!long);
        H[t[1].to!int-1] ~= tuple(t[0].to!int-1, t[3].to!long);
    }

    auto A = new long[](N);
    auto B = new long[](N);
    fill(A, INF);
    fill(B, INF);

    void dij(long[] D, Tuple!(int, long)[][] F, int start) {
        auto pq = new BinaryHeap!(Array!(Tuple!(int, long)), "a[1] > b[1]")();
        pq.insert(tuple(start, 0L));
        while (!pq.empty) {
            auto t = pq.front;
            pq.removeFront;
            auto n = t[0];
            auto d = t[1];
            if (d >= D[n]) continue;
            D[n] = d;
            foreach (to; F[n]) {
                auto m = to[0];
                auto nd = d + to[1];
                if (nd >= D[m]) continue;
                pq.insert(tuple(m, nd));
            }
        }
    }

    dij(A, G, S);
    dij(B, H, T);

    auto hoge = new long[](N);
    foreach (i; 0..N) hoge[i] = A[i] + B[i];
    foreach_reverse (i; 0..N-1) hoge[i] = min(hoge[i], hoge[i+1]);
    foreach (i; 0..N) writeln(10L^^15 - hoge[i]);
}


Measured memory_bytes: 38140
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <random>
#include <iterator>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(v) reverse((v).begin(),(v).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  for (int i = 0; i < (n); ++i)

struct MyStruct {
	int a, b;
};

bool comp(const MyStruct& s, const MyStruct& t) {
	if (s.b != t.b)
		return s.b < t.b; //syoujunn
	return s.a > t.a;
}


int main() {
	int n, a, b;
	cin >> n >> a >> b;

	ANS(min(n*a, b));

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <iomanip>

using namespace std;

const int maxn = 1002;
const int mo = 1e9 + 7;

int n, m, f[maxn][maxn];
string g[maxn];

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	cin >> n >> m;
	for (int i = 0; i < n; ++i)
		cin >> g[i];

	f[0][0] = 1;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < m; ++j) {
			if ((i == 0 && j == 0) || g[i][j] == '#')
				continue;

			if (i == 0)
				f[i][j] = f[i][j-1];
			else
				if (j == 0)
					f[i][j] = f[i-1][j];
				else
					f[i][j] = (f[i-1][j] + f[i][j-1])%mo;
		}

	cout << f[n-1][m-1] << endl;

	return 0;
}

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

#define ONLINE_JUDGE
#define pb(a) push_back(a)
#define ALL(a) (a.begin(), a.end())
#define FOR(x,to) for(x=0;x<(to);x++)

using ll = long long;

const int E5 = 1e5;

//////////// Solution /////////////////////////////////

int pow(int a, int n) {
	int res = 1;
	while (n--)
		res *= a;
	return res;
}

void solve() {
	int mx = 0;
	int x;
	cin >> x;
	for (int b = 1; b <= x; ++b) {
		for (int p = 2; p <= 30; ++p) {
			if (pow(b,p) <= x) {
				mx = max(mx,pow(b,p));
			}
		}
	}	

	cout << mx << '\n';
}	

/////////// End Solution ///////////////////////////////////////

//////// Initialization ////////////////////////////////////

int main() {

	#ifndef ONLINE_JUDGE
	FILE *FIN = freopen("/home/danil/prog/input.txt", "r", stdin);
	clock_t time_start = clock();
	#endif

	ios::sync_with_stdio(false);
	cin.tie(NULL);

	solve();

	#ifndef ONLINE_JUDGE
	fclose(FIN);
	cerr << "\x1b[031m\n-----------------\nTime=" << (ll)((double)(clock()-time_start) / CLOCKS_PER_SEC * 1000) << "ms\n\x1b[0m";
	#endif

	return 0;
}

//////// End Initialization ///////////////////////////////////////

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


int main(){
 cout<<fixed<<setprecision(12);
 double x1,y1,x2,y2;
 cin>>x1>>y1>>x2>>y2;
 double X=pow(x1-x2,2);
 double Y=pow(y1-y2,2);
 cout<< sqrt(X+Y)<<endl;
}


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

int main() {
  int n,r;
  cin>>n>>r;
  cout<<(n<10 ? r+100*(10-n) : r)<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

string s, t;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> s >> t;
	if(t.substr(0, (int)s.length()) == s && (int)t.length() == (int)s.length() + 1) cout << "Yes\n";
	else cout << "No\n";
	return 0;
}

Measured memory_bytes: 3660
n=int(input())
n=1000
a=list(map(int,input().split()))
x=[0]*(len(a)-1)
for i in range(len(a)-1):
    x[i]+=a[i+1]-a[i]

cnt=0

for i in range(len(x)):
    if x[i]>0:
        cnt+=n//a[i]
        n%=a[i]
    elif x[i]==0:
        continue
    elif x[i]<0:
        n+=cnt*a[i]
        cnt=0

n+=cnt*a[-1]

print(n)


Measured memory_bytes: 61640
#include <iostream>
#include <iomanip>
using namespace std;

int main(){

 int a, b, d, r;
 double f;

 cin >> a >> b;

 d = a / b;
 r = a % b;
 f = 1.0 * a / b;

 cout << d << " " << r << " " << fixed << setprecision(5) << f << "\n";

 return 0;
}

Measured memory_bytes: 1244
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n, d, ans = 0;
	cin >> n >> d;
	vector<vi> x;
	rep(i, n){
		vi v(d);
		rep(j, d) cin >> v[j];
		x.pb(v);
		rep(j, i){
			int s = 0;
			rep(k, d) s += (v[k] - x[j][k]) * (v[k] - x[j][k]);
			int sq = (int)(0.5 + sqrt(s));
			ans += sq * sq == s;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define Set set<int>
#define int long long
#define P pair<int,int>
const int maxn = 3e3+5;
const int INF = 1e17 +6;
using namespace std;
int n,m,a[maxn],b[maxn],d[maxn],c[maxn],ans;
int32_t main()
{
    IOS;
    cin>>n;
    cin>>m;
    if(m==1)cout<<0;
    else cout<<n-m;
    return 0;
}


Measured memory_bytes: 256
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b;
  cin>>a>>b;
  cout<<(b%a==0 ? a+b : b-a);
  return(0);
}



Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <numeric>

int main()
{
	int k;
	scanf("%d", &k);

	long long ans = 0;
	for (int a = 1; a <= k; ++a)
	{
		for (int b = 1; b <= k; ++b)
		{
			for (int c = 1; c <= k; ++c)
			{
				ans += (long long)(std::gcd(std::gcd(a, b), c));
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
  int d,t,s;
  cin>>d>>t>>s;
  if(s*t>=d) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 3672
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
#define all(v) v.begin(), v.end()
#define bigger (char)toupper
#define smaller (char)tolower
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;

int main() {
    int N;
    cin>>N;
    vi d(N);
    rep(i,N) {
        cin>>d[i];
    }
    sort(all(d));
    int s=d.size();
    rep(i,N-1) {
        if(d[i]==d[i+1]) s--;
    }
    cout<<s<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;
 
/*---------------------------------------------------*/

int main(){
  int n;
  int time=0,xx=0,yy=0;
  int t,x,y;
  cin>>n;
  rep(i,n){
    cin>>t>>x>>y;
    int tmp=abs(xx-x)+abs(yy-y)+time;
    if(tmp<=t&&(t-tmp)%2==0){
      xx=x;yy=y;
      time=t;
    }else{
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}

Measured memory_bytes: 256
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! p {
    ($($x:expr),*) => {
        $(println!("{:?}", $x);)*
    };
}
macro_rules! pr {
    ($($x:expr),*) => {
        $(println!("{}", $x);)*
    };
}
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        #[allow(unused_mut)]
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
#[allow(unused_imports)]
use std::cmp::*;
trait Each: Iterator {
    fn each<F>(self, mut f: F)
    where
        Self: Sized,
        F: FnMut(Self::Item),
    {
        self.fold((), move |(), item| f(item));
    }
}
impl<T: Iterator> Each for T {}

fn main() {
    input! {
        n:usize,
        mut s:[String;n]
    }
    s.sort();
    let mut v = vec![];
    let mut c = 0;
    let mut max = -5000;
    for i in 0..n - 1 {
        if s[i] == s[i + 1] {
            c += 1;
        } else {
            v.push((s[i].clone(), c + 1));
            if max < c + 1 {
                max = (c + 1)
            };
            c = 0;
        }
    }
    v.push((s[n - 1].clone(), c + 1));
    if max < c + 1 {
        max = (c + 1)
    };
    //p!(&v,max);
    for &(ref s, c) in v.iter() {
        if c == max {
            print!("{}\n", s);
        }
    }
}


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

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

const int INF=1e9;
const int MOD=1e9+7;

int main(){
    int N;
    ll D;
    cin >> N >> D;
    int ans=0;
    D=D*D;
    for(int i=0;i<N;i++){
        ll x,y; cin >> x >> y;
        ll res=x*x+y*y;
        if(res<=D){
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
using sint = int64_t;

template<class T> T read() {
	T t;
	cin >> t;
	return t;
}

inline void write() {
}

template<class T> void write(T const& t) {
	cout << t;
}

template<class T, class... Args> void write(T const& t, Args const&... args) {
	cout << t << ' ';
	write(args...);
}

template<class... Args> void writeln(Args const&... args) {
	write(args...);
	cout << '\n';
}

int main() {
	ios_base::sync_with_stdio(false);
	cin .exceptions(ios_base::badbit | ios_base::failbit);
	cout.exceptions(ios_base::badbit | ios_base::failbit);
	cin .tie(nullptr);
	cout.tie(nullptr);
	cout.precision(16);
	void run();
	run();
	return 0;
}

void run() {
	auto const N = read<sint>();
	auto const M = read<sint>();

	priority_queue<sint> prio;
	for (sint i = 0; i < N; ++i) {
		prio.push(read<sint>());
	}
	
	for (sint i = 0; i < M; ++i) {
		sint p = prio.top();
		prio.pop();
		prio.push(p / 2);
	}

	sint sum = 0;
	while (!prio.empty()) {
		sum += prio.top();
		prio.pop();
	}

	writeln(sum);
}

Measured memory_bytes: 1400
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue> //C++
#include <string> //C++
#include <iostream> //C++
#include <vector> //C++
#include <algorithm> //C++
#include <map> //C++
using namespace std; //C++
#define rep(i, a, n) for (i = (a); i < (n); i++)


//C++で提出



// string s="AAA";    s.size() =3    (sのサイズ) ...1
// vector <int> a;    配列a(サイズは0) ...2
// a.push_back(10);   配列のサイズが一つ増えて一番後ろに10を代入 ...2
// A.pop_back();   最後の要素が消去される
// sort(A.begin(),A.end());   配列Aの最初の要素から最後の要素(/.)より前までを小さい順に並び替えてa[0]から代入していく...3
// reverse(A.begin(),A.end());   配列Aの最初の要素から最後の要素(/.)までを逆の順にしてa[0]から代入していく
// s.substr(3,2)   配列s[3]から2個の文字を抜き出した文字列 (s[3]とs[4]) ...4
// strcmp(s1,s2)  文字列が等しければ0を出力　s1>s2なら1 s1<s2なら-1を出力　C言語用なので配列は、s1[100]にする...5




/*
const int MAX = 100;
int main() {
	int N, M;
	string s, t;
	map<string, int> m;
	m["apple"] = 10;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		cin >> s;
		m[s]++;
	}
	cin >> M;
	for (int i = 0; i < M; ++i) {
		cin >> t;
		m[t]--;
	}
	
	int max=0;

	for (map<string, int>::iterator i = m.begin(); i != m.end(); ++i) {
		if (max < (i->second)) max = i->second;
	}

	if (max < 0) cout << "0";
	else cout << max;

	return 0;
}

*/

int main() {

	int n,i;
	cin >> n;
	int x;
	int count=0;
	
	for (i = 0; i < n; i++) {
		cin >> x;

		if (x % 2 == 0) {

			if(x%3!=0 && x%5!=0) count++;
		}
		
	}

	if (count == 0) cout << "APPROVED";
	else cout << "DENIED";

}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
struct edges
{
	int to,next;
	bool mk;
}edge[202020];
int first[101010],now;
void adde(int x,int y)
{
	now++;
	edge[now].to=y;
	edge[now].next=first[x];
	edge[now].mk=false;
	first[x]=now;
}
int c[101010];
int fa[101010],dep[101010];
long long sum[101010];
int ex,ey;
void work(int p)
{
	for(int e=first[p];e;e=edge[e].next)
		if(edge[e].to!=fa[p])
		{
			if(c[edge[e].to])
			{
				ex=p;
				ey=edge[e].to;
			}
			else
			{
				c[edge[e].to]=-c[p];
				edge[e].mk=true;
				fa[edge[e].to]=p;
				dep[edge[e].to]=dep[p]+1;
				work(edge[e].to);
			}
		}
}
void work1(int p)
{
	sum[p]=c[p];
	for(int e=first[p];e;e=edge[e].next)
		if(edge[e].mk)
		{
			work1(edge[e].to);
			sum[p]+=sum[edge[e].to];
		}
}
int q[101010],qn;
void work2(int x,int y)
{
	while(x!=y)
	{
		if(dep[x]>=dep[y])
		{
			q[++qn]=sum[x];
			x=fa[x];
		}
		else
		{
			q[++qn]=sum[y];
			y=fa[y];
		}
	}
}
int main()
{
	int n,m,x,y;
	long long ans;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		scanf("%d%d",&x,&y);
		adde(x,y);
		adde(y,x);
	}
	ex=ey=0;
	memset(c,0,sizeof(c));
	c[1]=1;
	dep[1]=1;
	fa[1]=0;
	work(1);
	if(ex==0)
	{
		work1(1);
		if(sum[1])
		{
			printf("-1");
			return 0;
		}
		for(int i=1;i<=n;i++)
			ans+=abs(sum[i]);
		printf("%lld",ans);
	}
	else if(c[ex]==c[ey])
	{
		work1(1);
		c[ex]-=sum[1]/2;
		c[ey]-=sum[1]/2;
		ans+=abs(sum[1]/2);
		work1(1);
		if(sum[1])
		{
			printf("-1");
			return 0;
		}
		for(int i=1;i<=n;i++)
			ans+=abs(sum[i]);
		printf("%lld",ans);
	}
	else
	{
		work1(1);
		qn=0;
		q[++qn]=0;
		work2(ex,ey);
		sort(q+1,q+1+qn);
		ans+=abs(q[(qn+1)>>1]);
		c[ex]+=q[(qn+1)>>1];
		c[ey]-=q[(qn+1)>>1];
		work1(1);
		if(sum[1])
		{
			printf("-1");
			return 0;
		}
		for(int i=1;i<=n;i++)
			ans+=abs(sum[i]);
		printf("%lld",ans);
	}
	return 0;
}

Measured memory_bytes: 8448
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] a = (Console.ReadLine().Split(' '));
            int[] b = new int[2];

            for(int i=0;i < a.Length ; i++)
            {
                b[i] = int.Parse(a[i]);
            }
            int res = 0;
            int min = -9999;
            for(int i=0; i < b[0]; i++)
            {
                int num = b[1] + i;
                res += num;
                if(min * min > num * num)
                {
                    min = num;
                }
            }
            res -= min;
            Console.Write(res);
        }
    }
}

Measured memory_bytes: 13140
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

class UnionFindTree
    attr_accessor:par,:rank,:size
    def initialize(n)
        @par=Array.new(n){|i| i}
        @rank=array(n,0)
        @size=array(n,1)
    end

    def find(x)
        return x if @par[x]==x
        @par[x]=find(@par[x])
        return @par[x]
    end

    def union(x,y)
        x=find(x)
        y=find(y)
        return if x==y
        if @rank[x]<@rank[y]
            @par[x]=y
            @size[y]+=@size[x]
        else
            @par[y]=x
            @size[x]+=@size[y]
            @rank[x]+=1 if @rank[x]==@rank[y]
        end
    end

    def same?(x,y)
        return find(x)==find(y)
    end
    
    def Size(x)
        return @size[find(x)]
    end
end
N,M,K=get_i
friend=array(N,0)
uft=UnionFindTree.new(N)
M.times do|i|
  a,b=get_i.map{|x| x-=1}
  uft.union(a,b)
  friend[a]+=1
  friend[b]+=1
end
block=array(N,0)
K.times do|i|
  c,d=get_i.map{|x| x-=1}
  if uft.same?(c,d)
    block[c]+=1
    block[d]+=1 
  end
end
ans=[]
N.times do|i|
    ans.push(uft.Size(i)-friend[i]-block[i]-1)
end 
puts ans.join(" ")

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

#define rep(i,N) for(int i=0;i<(int)N;++i)
#define rep1(i,N) for(int i=1;i<=(int)N;++i)

using int64 = long long;
using i64 = long long;

const int inf = 1 << 30;
const i64 inf64 = 1ll << 60;

const int mod = 1e9 + 7;

template<typename T>
vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }

template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

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

template <typename G>
struct LowLink {
	G g;
	vector<int> used, low, ord;
	vector<pair<int, int>> bridge;
	vector<int> articulation;

	LowLink(const G& g) : g(g) {}

	int dfs(int u, int k, int par) {
		ord[u] = low[u] = k++;
		used[u] = true;
		int cnt = 0;
		bool flag = false;
		for (auto v : g[u]) {
			if (!used[v]) {
				k = dfs(v, k, u);
				low[u] = min(low[u], low[v]);
				cnt++;
				if (ord[u] < low[v]) bridge.emplace_back(make_pair(min(u, v), max(u, v)));
				flag |= (par != -1 && ord[u] <= low[v]);
			} else if (par != v) {
				low[u] = min(low[u], ord[v]);
			}
		}
		flag |= (par == -1 && cnt > 1);
		if (flag) articulation.emplace_back(u);
		return k;
	}

	void build() {
		used.assign(g.size(), 0);
		low.assign(g.size(), 0);
		ord.assign(g.size(), 0);
		int k = 0;
		for (int i = 0; i < g.size(); ++i) {
			if (!used[i]) dfs(0, k, -1);
		}
	}
};

int main() {
	int V, E; cin >> V >> E;
	vector<vector<int>> g(V);
	rep(i, E) {
		int u, v; cin >> u >> v;
		g[u].emplace_back(v);
		g[v].emplace_back(u);
	}

	LowLink<vector<vector<int>>> lowlink(g);
	lowlink.build();
	sort(lowlink.bridge.begin(), lowlink.bridge.end());
	for (auto e : lowlink.bridge) cout << e.first << " " << e.second << endl;
}


Measured memory_bytes: 5268
def nasu(a, b, x):
  return (a * x) // b - (x // b) * x

A, B, N = list(map(int, input().split()))
if B == N:
  print(nasu(A, B, N - 1))
elif B > N:
  print(nasu(A, B, N))
else:
  print(nasu(A, B, B - 1))

Measured memory_bytes: 9188
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

#include <utility>
using Bat = pair<int, int>;
#include <queue>

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, t;
    while (cin >> n >> t, n + t) {
        vector<vector<Bat>> v(n);
        REP(i, 0, n) {
            for (;;) {
                int a, b;
                cin >> a;
                if (a == 0) break;
                cin >> b;
                v[i].emplace_back(a, b);
            }
        }
        queue<int> q;
        vector<int> cur(n), pat(n, 0);
        REP(i, 0, n) {
            cur[i] = v[i][0].first;
        }
        ll ans = 0;
        int rem = 0, irem = -1;
        REP(T, 0, t) {
            REP(i, 0, n) {
                if (cur[i] == -1) continue;
                if (cur[i]-- == 0) {
                    q.emplace(i);
                }
            }
            if (irem == -1 && q.size()) {
                irem = q.front();
                rem = v[irem][pat[irem]].second;
                q.pop();
            }
            if (irem != -1 && --rem == 0) {
                pat[irem] = (pat[irem] + 1) % v[irem].size();
                cur[irem] = v[irem][pat[irem]].first;
                irem = -1;
                rem = -1;
            }
            ans += q.size();
            /*
            REP(i, 0, n) {
                cout << cur[i] << " ";
            }
            cout << q.size() << endl;
            */
        }
        cout << ans << endl;
    }
    return 0;
}



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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;

    ll m = 100 * A, n = 0;
    for (int a = 0; a * A * 100 <= F; ++a)
    {
        for (int b = 0; b * B * 100 + a * A * 100 <= F; ++b)
        {
            for (int c = 0; c * C + b * B * 100 + a * A * 100 <= F; ++c)
            {
                for (int d = 0; d * D + c * C + b * B * 100 + a * A * 100 <= F; ++d)
                {
                    if (E * (a * A + b * B) < c * C + d * D)
                        break;
                    if (100 * n * (100 * a * A + 100 * b * B + c * C + d * D) < 100 * (c * C + d * D) * m)
                    {
                        m = 100 * a * A + 100 * b * B + c * C + d * D;
                        n = c * C + d * D;
                    }
                }
            }
        }
    }
    cout << m << " " << n << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>

using namespace std;
template<class T1, class T2> inline void chkmin(T1 &x, const T2 &y) {if (x > y) x = y;}
template<class T1, class T2> inline void chkmax(T1 &x, const T2 &y) {if (x < y) x = y;}
#define all(c) (c).begin(), (c).end()
#define sz(c) (int)(c).size()
#define mp make_pair
#define pb push_back
#define read(FILENAME) freopen((string(FILENAME) + ".in").c_str(), "r", stdin)
#define write(FILENAME) freopen((string(FILENAME) + ".out").c_str(), "w", stdout);
const int MAXN = 270228;
const int Mod = 998244353;


int add(const int &a, const int &b) {
	return (a + b >= Mod ? a + b - Mod: a + b);
}


int dec(const int &a, const int &b) {
	return (a >= b ? a - b: a - b + Mod); 
}


int mul(const int &a, const int &b) {
	return (1LL * a * b) % Mod;
}


int powm(int a, int b) {
	int res = 1;
	while (b) {
		if (b & 1) res = mul(res, a);
		a = mul(a, a);
		b >>= 1;
	}	
	return res;
}




int n, w;
int a[MAXN], b[MAXN], c[MAXN];


void bpf(int *a) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 1 << n; j++) {
			if (j >> i & 1) {
				int x = a[j ^ (1 << i)];
				int y = a[j];
				a[j ^ (1 << i)] = add(x, y); 
				a[j] = dec(x, y);
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//read("input");
	cin >> n;
	for (int i = 0; i < (1 << n); i++) {
		cin >> a[i]; 
		w += a[i];
	}
	w = powm(w, Mod - 2);
	for (int i = 0; i < 1 << n; i++) {
		a[i] = dec(0, mul(a[i], w));
		b[i] = 1;
	}
	c[0] = dec(0, 1 << n); 
	a[0] = add(a[0], 1);
	bpf(a); 
	bpf(b); 
	bpf(c);
	for (int i = 1; i < 1 << n; ++i) {
		a[i] = mul(add(b[i], c[i]), powm(a[i], Mod - 2));
		a[0] = dec(a[0], a[i]);
	}
	bpf(a);
	w = powm(1 << n, Mod - 2);
	for (int i = 0; i < 1 << n; i++) {
		cout << mul(a[i], w) << '\n';
	}
 	return 0;
}


Measured memory_bytes: 5888
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int INF=1e9;

vector<int> G[100005];
bool visited[100005];

void dfs(int u){
    visited[u]=true;
    for(int v:G[u]){
        if(!visited[v])dfs(v);
    }
}

int main(){
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int x,y,z;
        cin>>x>>y>>z;
        --x;--y;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    int ans=0;
    for(int i=0;i<n;i++){
        if(!visited[i]){
            dfs(i);
            ++ans;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 8960
import scala.io.StdIn._

object Main {
  def checkLeftRight(l: List[Int],
    rl: Vector[Int] = Vector(0), ll: Vector[Int] = Vector(0)): Boolean = {
    if (l.isEmpty) true
    else {
      if (l.head > rl.last) checkLeftRight(l.tail, rl :+ l.head, ll)
      else if (l.head > ll.last) checkLeftRight(l.tail, rl, ll :+ l.head)
      else false
    }
  }

  def setBall(s: String): String = {
    val ballList = s.split(" ").map(_.toInt).toList
    val canSetBall = checkLeftRight(ballList)
    if (canSetBall) "YES" else "NO"
  }

  def results(n: Int, result: Vector[String] = Vector()): Vector[String] = n match {
    case 0 => result
    case _ => results(n - 1, result :+ setBall(readLine()))
  }

  def main(args: Array[String]): Unit = {
    results(readInt()).foreach(println)
  }
}

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

int main(int argc, char const *argv[])
{
    vector<int64_t> Ryuka(87);
    int N;
    cin >> N;

    Ryuka.at(0) = 2;
    Ryuka.at(1) = 1;
    for (size_t i = 2; i <= N; i++)
    {
        Ryuka.at(i) = Ryuka.at(i - 2) + Ryuka.at(i - 1);
    }
    cout << Ryuka.at(N) << endl;
}


Measured memory_bytes: 256
//#pragma warning(disable:4996)
//#include <Windows.h>
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>
//#include <stdio.h>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
typedef long long LL;
typedef long double LD;
//typedef boost::multiprecision::cpp_int bigint;
typedef pair<LL, LL> PLL;
typedef pair<int, int> PI;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef unsigned long long ULL;

template<class T>
inline void chmin(T& a, T b) {
	a = min(a, b);
}

template<class T>
inline void chmax(T& a, T b) {
	a = max(a, b);
}

void input();
void solve();

void daminput();

int main() {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	input();
	//daminput();
	solve();
	return 0;
}

//////////////////////////////////////////////////
//////////////////////////////////////////////////

LL N, A, B;

void input() {
	cin >> N >> A >> B;
}

void daminput() {
}

void solve() {
	LL ans = (N / (A + B)) * A;
	N -= (N / (A + B)) * (A + B);
	ans += min(A, N);
	cout << ans << "\n";
}

Measured memory_bytes: 3200
import sys


def input(): return sys.stdin.readline().strip()


def main():
    C = [[int(x) for x in input().split()] for _ in range(3)]

    a = [0, 0, 0]

    b = [C[0][i] for i in range(3)]  # b_i = c_1,i - a_1

    a = [C[i][0] - b[0] for i in range(3)]  # a_i = c_i,1 - b_1

    ans = [[a[i] + b[j] for j in range(3)] for i in range(3)]

    if ans == C:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
s=input()
if s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()
x=len(s)

al=[0]*26

if x!=26:
    for i in s:
        al[ord(i)-97]=1
    
    for i in range(26):
        if al[i]==0:
            s+=chr(97+i)
            print(s)
            exit()

else:
    option=[]
    
    for i in reversed(range(26)):
        option=sorted(option)
        num=ord(s[i])
        if i==25:
            option.append(num)
        else:
            if num>max(option):
                option.append(num)
            else:
                s=s[:26-len(option)-1]
                for i in option:
                    if i>num:
                        s+=chr(i)
                        print(s)
                        exit() 


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

typedef struct _node {
    int x;
    struct _node *parent;
    struct _node *left;
    struct _node *right;
} Node;

void set(Node *ptr, int x, Node *parent, Node *left, Node *right) {
    ptr->x = x;
    ptr->parent = parent;
    ptr->left = left;
    ptr->right = right;
}

Node *insert(Node *ptr, int x) {
    if(ptr == NULL) {
        Node *new = malloc(sizeof(Node));
        set(new, x, NULL, NULL, NULL);
        return new;
    } else if(x > ptr->x) {
        ptr->right = insert(ptr->right, x);
        ptr->right->parent = ptr;
    } else if(x < ptr->x) {
        ptr->left = insert(ptr->left, x);
        ptr->left->parent = ptr;
    } 

    return ptr;
}

void printPreorder(Node *ptr) {
    if(ptr != NULL) {
        printf(" %d", ptr->x);
        printPreorder(ptr->left);
        printPreorder(ptr->right);
    }
}

void printInorder(Node *ptr) {
    if(ptr != NULL) {
        printInorder(ptr->left);
        printf(" %d", ptr->x);
        printInorder(ptr->right);
    }
}

int main(void) {
    Node *root = NULL;

    int n;
    char buf[32];

    fgets(buf, sizeof(buf), stdin);
    sscanf(buf, "%d", &n);

    while(n--) {
        fgets(buf, sizeof(buf), stdin);
        if(buf[0] == 'i') {
            char command[8];
            int key;
            sscanf(buf, "%s %d", command, &key);
            root = insert(root, key);
        } else if(buf[0] = 'p') {
            printInorder(root);
            puts("");
            printPreorder(root);
            puts("");
        }
    }

    return 0;
}


Measured memory_bytes: 25212
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

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

int main(){
	ios::sync_with_stdio(false);

	int n, a, b;
	int count=0;

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

	vector<int> t(n);

	REP(i, n){
		scanf("%d", &t[i]);
		if(t[i]<a||b<=t[i])
			count++;
	}

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


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void) {
  string S, T;

  cin >> S >> T;

  string last, origin;
  bool ans = false;
  for (int i = 0; i < S.size(); i++) {
    last = S[S.size() - 1];
    origin = S;
    origin.pop_back();
    S = last + origin;
    if (T == S) {
      ans = true;
    }
  }

  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int gcd = __gcd(360,n);
    if(360%n==0)
        cout << 360/n << endl;
    else
    {
        cout << 360/gcd << endl;
    }
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxx = 1e5 + 7;
const int Inf = 1 << 30;
const ll INF = 1ll << 60;
typedef pair <int, int> PR;
priority_queue <PR> qua;
#define mst(x) memset(x, 0, sizeof(x))
vector <int> vec;
int n;

void pp(int x) {
	if(x == 22) puts("Christmas Eve Eve Eve");
	else if(x == 23) puts("Christmas Eve Eve");
	else if(x == 24) puts("Christmas Eve");
	else if(x == 25) puts("Christmas");
}

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

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <bitset>
#include <utility>
#include <assert.h>
using namespace std;
#define rank rankk
#define mp make_pair
#define pb push_back
#define xo(a,b) ((b)&1?(a):0)
#define tm tmp

//#define LL ll
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef long long ll;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
const int INF=0x3f3f3f3f;
const ll INFF=0x3f3f3f3f3f3f3f3fll;
const int MAX=55;
//const ll MAXN=2e8;
//const int MAX_N=MAX;
//const ll MOD=1e15+37;
//const long double pi=acos(-1.0);
//const double eps=0.00000001;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<typename T>inline T abs(T a) {return a>0?a:-a;}
template<class T> inline
void read(T& num) {
    bool start=false,neg=false;
    char c;
    num=0;
    while((c=getchar())!=EOF) {
        if(c=='-') start=neg=true;
        else if(c>='0' && c<='9') {
            start=true;
            num=num*10+c-'0';
        } else if(start) break;
    }
    if(neg) num=-num;
}
inline ll powMM(ll a,ll b,ll M){
    ll ret=1;
    a%=M;
//    b%=M;
    while (b){
        if (b&1) ret=ret*a%M;
        b>>=1;
        a=a*a%M;
    }
    return ret;
}
void open()
{
//    freopen("1009.in","r",stdin);
    freopen("out.txt","w",stdout);
}
char s[MAX],t[MAX];
int len1,len2;
int pos;
int main()
{
    scanf("%s%s",s,t);
    len1=strlen(s);
    len2=strlen(t);
    pos=-1;
    for(int i=len1-1;i>=len2-1;i--)
    {
        pos=i;
        for(int j=0;j<len2;j++)
        {
            if(s[i-j]!=t[len2-1-j]&&s[i-j]!='?')
            {
                pos=-1;
                break;
            }
        }
        if(pos!=-1)break;
    }
    if(pos==-1)
        return 0*printf("UNRESTORABLE\n");
    else
    {
        for(int i=0;i<len2;i++)
        {
            s[pos-i]=t[len2-1-i];
        }
        for(int i=0;i<len1;i++)
        {
            if(s[i]=='?')s[i]='a';
        }
        printf("%s\n",s);
    }

}

/*

*/


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define dbg(x) cout<<#x<<"="<<x
#define nl cout<<"\n"
#define frn(i,n) for(int i = 0;i < n;i++)
#define fr(i,a,b) for(int i = a;i < b;i++)
#define pb push_back
#define trav(x,c) for(auto &x:c)
using namespace std;

int toint(string s) {
  int ans = 0;
  for(char x: s) ans = ans*10 + (x - '0');
  return ans;
}

int sum(int x) {
  int s = 0;
  while(x) {
    s += x%10;
    x /= 10;
  }
  return s;
} 

int main() {
  int n;
  cin>>n;
  ll a[n];
  frn(i,n) cin>>a[i];
  int l = 0, r = 35;
  int ans = -1;
  while(l <= r) {
    int mid = l + (r-l)/2;
    bool flag = true;
    frn(i,n) {
      if(a[i]%(1LL<<mid)) {
        flag = false;
        break;
      }
    }
    if(flag) {l = mid+1; ans = mid;}
    else r = mid-1;
  }
  cout<<ans;
}

Measured memory_bytes: 256
s = input()
t = input()
for i in range(len(s)-len(t),-1,-1):
	#print (i)
	flg = True
	for j, k in enumerate(list(t)):
		#print (j, k)
		if s[i:i+len(t)][j] == "?":
			continue
		if k != s[i:i+len(t)][j]:
			flg = False
			break
	if flg == True:
		x = s[:i].replace("?","a") + t + s[i+len(t):].replace("?","a")
		print (x)
		exit()
print ("UNRESTORABLE")

Measured memory_bytes: 3064