akhauriyash/Code-Regression huggingface dataset:
// int型のオーバーフローに注意
// 文字列の比較は==ではなく.equalsを使おう
// Stringの入力はnext();が丸い

import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		    Scanner sc = new Scanner(System.in);

		    int c11 = sc.nextInt();
		    int c12 = sc.nextInt();
		    int c13 = sc.nextInt();
		    int c21 = sc.nextInt();
		    int c22 = sc.nextInt();
		    int c23 = sc.nextInt();
		    int c31 = sc.nextInt();
		    int c32 = sc.nextInt();
		    int c33 = sc.nextInt();
		    int count = 0;
		    
		    if(c12 - c11== c22 - c21 && c22 - c21 == c32 - c31) {
		    	if(c13 - c12== c23 - c22 && c23 - c22 == c33 - c32) {
		    		if(c11 - c13== c21 - c23 && c21 - c23 == c31 - c33) {
		    			if(c21 -c11 == c22 -c12 && c22 - c12 == c23 - c13) {
		    				if(c31 -c21 == c32 -c22 && c32 - c22 == c33 - c23) {
		    					if(c11 -c31 == c12 -c32 && c12 - c32 == c13 - c33) {
				    				
				    			}
			    			}else {
			    				count++;
			    			}
		    			}else {
		    				count++;
		    			}
			    	}else {
			    		count++;
			    	}
		    	}else {
		    		count++;
		    	}
		    }else {
		    	count++;
		    }
		    if(count != 0) {
		    	System.out.println("No");
		    }else {
		    	System.out.println("Yes");
		    }
		    
		    sc.close(); }

	public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	}
}


Measured memory_bytes: 25172
A,B= map(int,input().split())
flag=0
def panduan():
    for i in range(1,4):
        result=A*B*i%2
        if result==1:
            global flag
            flag=1
            return flag
    return flag
panduan()
if flag==1:
    print('Yes')
else:
    print('No')

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

class Edge
{
public:
    int from, to;
    string lab;
    Edge(int from0, int to0, string& lab0){
        from = from0;
        to = to0;
        lab = lab0;
    }
};

string solve(int n, vector<Edge>& edges, int s, int g)
{
    int m = edges.size();
    string INF = string(1, 'z' + 1);
    vector<string> powerful(n, INF);
    powerful[g] = "";

    string prev = INF;
    for(int i=0; i<6*n; ++i){
        bool change = false;
        for(int j=0; j<m; ++j){
            int from = edges[j].from;
            int to = edges[j].to;
            string& lab = edges[j].lab;
            if(powerful[to] == INF)
                continue;
            string s = lab + powerful[to];
            if(s < powerful[from]){
                powerful[from] = s;
                change = true;
            }
        }
        if(prev != powerful[s]){
            if(i >= n - 1)
                return "NO";
            prev = powerful[s];
        }
    }
    if(powerful[s] == INF)
        return "NO";
    else    
        return powerful[s];
}

int main()
{
    int n, a, s, g;
    for(;;){
        cin >> n >> a >> s >> g;
        if(n == 0)
            break;
        vector<Edge> edges;
        for(int i=0; i<a; ++i){
            int x, y;
            string lab;
            cin >> x >> y >> lab;
            edges.push_back(Edge(x, y, lab));
        }
        cout << solve(n, edges, s, g) << endl;
    }
}

Measured memory_bytes: 1388
#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, gcd, lcm 
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string
#include <vector> // vector
#include <queue> // queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define print(i) std::cout << (i) << "\n"

#define int long long // at least int64 > 9*10^18
#define all(v) v.begin(), v.end()
#define INF 10101010101010

struct FastIO
{
  FastIO() {
    std::cin.tie(0);
    std::ios_base::sync_with_stdio(0); 
  }
}fastio;
signed main() {
  int a,b,q;
  std::cin >> a >> b >> q;
  std::vector<int> shrines(a);
  std::vector<int> temples(b);
  rep(i,a) std::cin >> shrines[i];
  rep(i,b) std::cin >> temples[i];
  rep(i,q) {
    int x;
    std::cin >> x;
    int sl,sr,tl,tr;
    auto slb = std::lower_bound(all(shrines),x);
    auto tlb = std::lower_bound(all(temples),x);
    if(slb==shrines.end()) sr = INF;
    else sr = *slb-x;
    if(slb==shrines.begin()) sl = INF;
    else sl = x-*(slb-1);
    if(tlb==temples.end()) tr = INF;
    else tr = *tlb-x;
    if(tlb==temples.begin()) tl = INF;
    else tl = x-*(tlb-1);
    int ans = std::min({std::max(sl,tl),std::max(sr,tr),2*sl+tr,sl+2*tr,2*sr+tl,sr+2*tl});
    std::cout << ans << ENDL;
  }
  return 0;
}

Measured memory_bytes: 2944
// Triangle.cc
// 三角形の２辺 a, b とその間の角 C から、
// その三角形の面積 S、周の長さ L, a を底辺としたときの
// 高さ h を求めるプログラムを作成して下さい。
// 【入力】
// a の長さ, b の長さ, Cの大きさ（度）（整数）が空白区切りで与えられます。
// 【出力】
// S, L, h をそれぞれ1行に出力して下さい。0.0001以下の誤差があってもよいものとします。
// 【例】
// 入力：
// 4 3 90
// 出力：
// 6.00000000
// 12.00000000
// 3.00000000
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main( void) {
  double a, b;
  double C;
  double PI = acos(-1);
  double rad;
  double S, L, h;

  cin >> a >> b >> C;

  rad = ( C * PI) / 180;
  h = b * sin( rad);

  S = ( a * b * sin( rad)) /2;

  L = a + b + sqrt( pow( a, 2) + pow( b, 2) - 2 * a * b * cos(rad));

  printf( "%.8lf\n", S);
  printf( "%.8lf\n", L);
  printf( "%.8lf\n", h);

  return 0;
}



Measured memory_bytes: 3576
main :: IO ()
main = do
  [a, b, c] <- map read . words <$> getLine :: IO [Integer]
  let d = a + b
      x = 4 * a * b
      y = c * c + d * d - 2 * c * d
  putStrLn $ if c >= a + b && x < y then "Yes" else "No"


Measured memory_bytes: 508
#include<bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define loop(i, a, b) for(lli i=a; i<b; i++)
#define loopb(i, a, b) for(lli i=a; i>=b; i--)
#define pb push_back
#define umap unordered_map
typedef int lli;
typedef pair<lli, lli> pii;
typedef vector<lli> vll;
typedef tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// use to avoid collision
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
// for pair in unordered_map
struct hash_pair {
    static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
	}
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const{
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        uint64_t x = hash1 ^ hash2;
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
lli M = 1e9 + 7;
lli power(lli x, lli y){
    lli res = 1;
    x = x;
    while (y > 0) {
        if (y & 1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}
lli solve(){
	lli a, p;
	cin>>a>>p;
	a = a*3;
	cout<<(a+p)/2<<"\n";
	return 0;
}
int main(){
	fastio;
	lli t;
	// cin>>t;
	t = 1;
	while(t>0){
		t--;
		solve();
	}
}

Measured memory_bytes: 256
"""
最小共通祖先(LCA, lowest common ancestor)を求める
"""
class LCA_doubling:
    """
    parent: ダブリングテーブル
    depth: 元の深さ
    """
    def __init__(self,g,root): #g: graph 
        def dfs(v,p): #p: parent of v
            if p != -1: self.depth[v] = self.depth[p]+1
            for c,d in g[v]:
                if c == p: continue
                self.parent[0][c] = v
                self.dist[0][c] = d
                dfs(c,v)

        def doubling_make_table(N,logN,Table,Dist):
            for i in range(1,logN):
                for j, Tiij in enumerate(Table[i-1]):
                    if Tiij != -1:
                        Table[i][j] = Table[i-1][Tiij]
                        Dist[i][j] = Dist[i-1][j] + Dist[i-1][Tiij]

        N = len(g)
        self.logN = len(bin(N))-2
        self.parent = [[-1]*N for _ in range(self.logN)]
        self.dist   = [[0]*N for _ in range(self.logN)]
        self.depth = [0]*(N) #ノードの深さ
        dfs(root,-1) #root を根とする木と見て計算
        doubling_make_table(N, self.logN, self.parent, self.dist) #ダブリングのテープル構築


    def getLCA(self,u,v): #u,vのdistを返す
        if self.depth[u] > self.depth[v]: u,v = v,u #vが深い
        d = 0
        dd = self.depth[v] - self.depth[u]
        for k in range(self.logN-1,-1,-1):
            if (dd >> k) & 1:
                d += self.dist[k][v]
                v = self.parent[k][v]
        if u == v: return u, d;
        for k in range(self.logN-1,-1,-1):
            if self.parent[k][u] != self.parent[k][v]:
                d += self.dist[k][u]
                d += self.dist[k][v]
                u,v = self.parent[k][u], self.parent[k][v]
        return self.parent[0][u], d+self.dist[0][u]+self.dist[0][v];

    def getdepth(self,u): #uの深さを返す
        return self.depth[u]



import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

n = int(input())
g = [[] for _ in range(n)]
for i in range(n-1):
    a,b,c = [int(i) for i in readline().split()]
    g[a-1].append((b-1,c))
    g[b-1].append((a-1,c))

LCA = LCA_doubling(g, root=0)
#print(LCA.parent)
#print(LCA.depth)
#print(LCA.dist)

"""
ABC070D

"""
q,k = [int(i) for i in readline().split()]
k -= 1
for _ in range(q):
    a,b = [int(i)-1 for i in readline().split()]
    
    u1,d1 = LCA.getLCA(a,k)
    u2,d2 = LCA.getLCA(b,k)
    print(d1+d2)





Measured memory_bytes: 179932
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define INF INT_MAX;
typedef long long ll;
using namespace std;

int main(){
  int n;cin >> n;
  int ans =1;
  while(ans*2<=n){
    ans*=2;
  }
  cout << ans <<endl;
}


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


using namespace std;


void func147b (){
	string s;
	cin >> s;
	int size = s.size(), c = 0;
	for (int i = 0;i < (int)(s.size() / 2);i++) {
		if (s[i] != s[size - i - 1])c++;
	}
	cout << c << "\n";
}



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



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 100
int main(void){
	int n,m,i,j,z,A[N],B[N],C[1000],tmp,max=0,min=40,cnt=0;
	char s[N],str[N],*line;

	for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
		line=strtok(str," ,");
		sscanf(line,"%d",&m);	
		line=strtok(NULL," ,");	
		sscanf(line,"%d",&n);
		if(m==0 && n==0)
			break;
		A[m]=n;
		B[m]=n;
		if(m>max)
			max=m;
		if(min>m)
			min=m;
		cnt++;
	}
	for(i=min;i<=max;i++){
		for(j=max;j>i;j--){	
			if(B[j] > B[j-1]){
				tmp = B[j-1];
				B[j-1] = B[j];
				B[j] = tmp;
			}
		}
	}
	
	j=0; B[cnt+1]=40;
	for(i=min;i<=cnt;i++){
		if(B[i]!=B[i+1])
			C[B[i]]=j++;
		else
			C[B[i]]=j;
	}
	for( ;fgets(s,sizeof(str),stdin)!=NULL; ){
		sscanf(s,"%d",&z);	
		printf("%d\n",C[A[z]]+1);
	}
	return 0;
}

Measured memory_bytes: 612
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>

// https://atcoder.jp/contests/abc104/tasks/abc104_c

using namespace std;

int main() {

  int D, G;
  int p[10], c[10];
  cin >> D >> G;

  int n = 0;
  for (int i = 0; i < D; i++) {
    cin >> p[i] >> c[i];
    n += p[i];
  }

  int ans = numeric_limits<int>::max();
  for (int bit = 0; bit < (1 << D); bit++) {
    int score = 0;
    int done = 0;
    for (int i = 0; i < D; i++) {
      if (bit & 1 << i) {
        score += 100 * (i + 1) * p[i] + c[i];
        done += p[i];
      }
    }
    if (score < G) {
      for (int i = D - 1; i >= 0; i--) {
        if (bit & 1 << i) {
          continue;
        }
        for (int j = 0; j < p[i]; j++) {
          score += 100 * (i + 1);
          done++;

          if (score >= G)
            goto DONE;
        }
      }
    }
  DONE:
    if (score >= G)
      ans = min(ans, done);
  }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define INF (1<<30)+100
using namespace std;
ifstream fin("");
ofstream fout("");
 
int n, k, x, y, z;

int main() {
	cin>>x>>y>>z;
	swap(x, y);
	swap(x, z);
	cout<<x<<' '<<y<<' '<<z<<'\n';
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){


			String S = scan.next();

			char[]s = new char[S.length()];
			s = S.toCharArray();
			int goukei = 0;

			for(int i = 0;i<S.length();i++) {
				goukei+=(s[i]-'0');
			}

			if(goukei%9==0) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}



		}


	}


}


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

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;
  int res = 0;
  for (int a = 0; a <= A; ++a) {
    for (int b = 0; b <= B; ++b) {
      for (int c = 0; c <= C; ++c) {
        int total = 500*a + 100*b + 50*c; // 合計金額
        if (total == X) ++res; // 合計金額が X に一致したら答えをインクリメント
      }
    }
  }
  cout << res << endl;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
#define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main(int argc, char const *argv[])
{
	FAST_IO
	
	string s, t; cin >> s >> t;
	int si = 0; bool flag = true;
	while(si < s.size()) {
		if(s[si] != t[si]) {
			flag = false; break;
		}
		++si;
	}
	if(flag) cout << "Yes";
	else cout << "No";
	return 0;
}

Measured memory_bytes: 3620
XKD=input().split(" ")
X=int(XKD[0])
K=int(XKD[1])
D=int(XKD[2])

X=abs(X)

if(X>=K*D):
    print(X-K*D)
else:
    k=int((X-X%D)/D)
    if((K-k)%2==0):
        print(X%D)
    else:
        print(abs(X%D-D))

Measured memory_bytes: 9028
#include <stdio.h>

int main()
{
	int n,t[101],m,p[101],x[101],ans,bans=0,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&t[i]);
		bans+=t[i];
	}
	scanf("%d",&m);
	for(i=0;i<m;i++)
	    scanf("%d%d",&p[i],&x[i]);
	for(i=0;i<m;i++)
	{
		ans=bans;
		ans-=t[p[i]-1];
		ans+=x[i];
		printf("%d\n",ans);
    }
	return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {
  
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int P = sc.nextInt();
        long A0 = 0;
        long A1 = 0;
        for (int i = 0; i < N; i++) {
            int a = sc.nextInt();
            if (a%2 == 0) {
                A0++;
            } else {
                A1++;
            }
        }
        long P0 = 0;
        long P1 = 0;
        if (P == 0) {
            P0 = (long) Math.pow(2, A0);
            P1 = (long) Math.pow(2, A1)/2;
            if (P1 == 0) {
                P1 = 1;
            }
            System.out.println(P0*P1);
        } else {
            P0 = (long) Math.pow(2, A0);
            P1 = (long) Math.pow(2, A1)/2;
            System.out.println(P0*P1);
        }
    }
}


Measured memory_bytes: 35864
#include <cmath>
#include <complex>
#include <iostream>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define REP(i,n) FOR(i,0,n)

using namespace std;

typedef complex<double> xy_t;
double dot_product(xy_t a, xy_t b){ return (conj(a) * b).real(); }
double cross_product(xy_t a, xy_t b){ return (conj(a) * b).imag(); }
const double eps = 1e-10;

int main(){
    int n;
    xy_t p[4];
    double x,y;
    cin >> n;
    REP(i,n){
        REP(j,4){
            cin >> x >> y;
            p[j] = xy_t (x,y);
        }
        bool ans = fabs(cross_product(p[0] - p[1], p[2] - p[3])) < eps;
        cout << (ans ? "YES" : "NO") << endl;
    }
}

Measured memory_bytes: 1224
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i==n-1];};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll R[100010], C[100010];
    rep(i,0,N) cin >> R[i] >> C[i];
    map<ll,ll> mr, mc;
    rep(i,0,N){
        mr[R[i]]++;
        mc[C[i]]++;
    }
    if(mr.size() != N || mc.size() != N){
        print(-1);
        return 0;
    }
    map<ll,ll> mr2, mc2;
    rep(i,0,N){
        R[i]--; C[i]--;
        mr2[R[i]] = C[i];
        mc2[C[i]] = R[i];
    }
    ll ans = 0;
    rep(i,0,N){
        if(mr2[i] == i) continue;
        ans++;
        ll col = mr2[i];
        ll row = mc2[i];
        mr2[i] = i;
        mr2[row] = col;
        mc2[i] = i;
        mc2[col] = row;
    }
    print(ans);
}


Measured memory_bytes: 29672
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);

		while (true) {

			final int n = sc.nextInt();
			final int w = sc.nextInt();
			
			if(n == 0 && w == 0){
				break;
			}
			
			int[] h_count = new int[20];
			int v_max = 0;
			int h_max = 0;
			
			for(int i = 0; i < n; i++){
				final int v = sc.nextInt();
				h_count[v/w]++;
				v_max = Math.max(v_max, v);
				h_max = Math.max(h_max, h_count[v/w]);
			}
			
			int m = v_max / w + 1;
			double ans = 0;
			for(int i = 0; i < m; i++){
				double a = (double) (m - i - 1) / (m - 1);
				double b = (double) h_count[i] / h_max;
				ans += a * b;
			}
			ans += 0.01;
			
			System.out.println(ans);
		}
	}

}

Measured memory_bytes: 21840
#include<cstdio>

int n;
int a[100];

int solve(void);

int main(void){
	scanf("%d\n", &n);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}

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

	return 0;
}

int solve(void){
	bool used[100];
	int alice = 0;
	int bob = 0;
	int index_of_max;

	for(int i = 0; i < n; i++){
		used[i] = false;
	}

	for(int i = 0; i < n; i++){
		index_of_max = -1;
		for(int card = 0; card < n; card++){
			if(used[card]){
				continue;
			}

			if(index_of_max == -1){
				index_of_max = card;
			}

			if(a[index_of_max] < a[card]){
				index_of_max = card;
			}
		}

		if(i % 2){
			bob += a[index_of_max];
		}else{
			alice += a[index_of_max];
		}
		used[index_of_max] = true;
	}

	return alice - bob;
}

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

int a = 0;


int main() {
	cin >> a ;
	if (a == 3) {
		cout << "YES\n";
		}
	else if(a == 5) {
		cout << "YES\n";
		}
	else if (a == 7) {
		cout << "YES\n";
		}
	else {
		cout << "NO\n"; 
	}
	return 0;
}

Measured memory_bytes: 256
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B] = input[0].map(Number);
  const S = input[1][0];

  return new RegExp(`^[0-9]{${A}}\-[0-9]{${B}}$`).test(S) ? "Yes" : "No";
};

console.log(main(read()));


Measured memory_bytes: 29632
#include <queue>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
#define ll long long
int main(){
	ll q, k, a, b, acc = 0, l = 0, r = 0, n = 0;
	scanf("%lld", &q);
	vector<ll> v;
	priority_queue<ll> pq1;
	priority_queue<ll, vector<ll>, greater<ll> > pq2;
	for (ll i = 0; i < q; i++){
		scanf("%lld", &k);
		if (k == 1){
			n++;
			scanf("%lld %lld", &a, &b);
			acc += b;
			if (pq2.empty() || a >= pq2.top()){
				pq2.push(a);
				r += a;
			}else{
				pq1.push(a);
				l += a;
			}
			while (pq1.size() < n / 2){
				l += pq2.top();
				r -= pq2.top();
				pq1.push(pq2.top());
				pq2.pop();
			}
			while (pq1.size() > n / 2){
				r += pq1.top();
				l -= pq1.top();
				pq2.push(pq1.top());
				pq1.pop();
			}
		}else if (k == 2){
			if (n % 2 == 0){
				printf("%lld %lld\n", pq1.top(), r - l + acc);
			}else{
				printf("%lld %lld\n", pq2.top(), r - l - pq2.top() + acc);
			}
		}
	}
}

Measured memory_bytes: 3828
var
	N,K,i:Longint;
	inv:Array[1..2002]of Longint;
	B,R,M:int64;
begin
	read(N,K);
	inv[1]:=1;
	M:=1000000007;
	for i:=2 to K+2 do begin
		inv[i]:=M-M div i*inv[M mod i] mod M;
	end;
	B:=1;
	R:=N-K+1;
	for i:=0 to K-1 do begin
		writeln(B*R mod M);
		B:=B*(K-i-1)mod M*inv[i+1]mod M;
		R:=R*(N-K-i)mod M*inv[i+2]mod M;
	end;
end.

Measured memory_bytes: 128
#include<set>
#include<map>
#include<stack>
#include<ctime>
#include<cmath>
#include<queue>
#include<cstdio>
#include<vector>
#include<climits>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
int read(){
	bool f=0;int x=0;char c=getchar();
	while(c<'0'||'9'<c){if(c=='-')f=1;c=getchar();}
	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return !f?x:-x;
}
#define MAXN 5000
#define INF 0x3f3f3f3f
char S[2*MAXN+5],Ans[MAXN+5],T[MAXN+5];
int f[2*MAXN+5],p2[15]={1};
int main(){
	//freopen("reverse.in","r",stdin);
	//freopen("reverse.out","w",stdout);
	for(int i=1;i<=13;i++)
		p2[i]=p2[i-1]*2;
	int n=read(),k=read();
	scanf("%s",S);
	char tmp='z';
	for(int i=0;i<n;i++)
		tmp=min(tmp,S[i]),S[i+n]=S[n-i-1];
	S[2*n]='\0';
	int Maxlen=1;
	for(int i=0;i<2*n;i++)
		f[i]=(S[i]==tmp?f[i-1]+1:0);
	for(int i=n-1;i<2*n;i++)
		Maxlen=max(Maxlen,f[i]);
	for(int i=1;i<k;i++){
		Maxlen*=2;
		if(Maxlen>=n){
			for(int i=1;i<=n;i++)
				putchar(tmp);
			puts("");
			return 0;
		}
	}
	//puts(S);
	for(int i=0;i<n;i++)
		Ans[i]=S[i];
	Ans[n]='\0',T[n]='\0';
	for(int i=n-1;i<=2*n-1;i++)
		if(S[i]==tmp){
			int pos=i,cnt=0;
			while(pos>=i-n+1&&S[pos]==tmp) 
				cnt++,pos--;
			int len=cnt*p2[k-1];
			for(int t=0;t<len;t++)
				T[t]=tmp;
			for(int t=len;t<n;t++)
				T[t]=S[i-cnt-(t-len)];
			if(strcmp(Ans,T)>0)
				memcpy(Ans,T,sizeof(T));
		}
	puts(Ans);
    return 0;
}


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

using namespace std;

const long long MOD = 1e9 + 7;

int main() {
    int H, W, K;
    cin >> H >> W >> K;

    // 1*N のところに好きに線を引く (1-index)
    vector<long long> fr = {1, 1, 2, 3, 5, 8, 13, 21, 34};

    // N*W で K で終了する DP
    vector<vector<long long>> dp(H + 1, vector<long long>(W + 1));
    dp[1][1] = fr[W - 1];
    if (W >= 2) dp[1][2] = fr[W - 2];
    for (int k = 3; k <= W; k++) dp[1][k] = 0;

    for (int h = 2; h <= H; h++) {
        for (int k = 1; k <= W; k++) {
            dp[h][k] = (dp[h - 1][k]*fr[k - 1]%MOD)*fr[W - k]%MOD; // そのまま降りてくるやつ
            if (k >= 2) {//左から
                dp[h][k] += (dp[h - 1][k - 1]*fr[k - 2]%MOD)*fr[W - k]%MOD;
                dp[h][k] %= MOD;
            }
            if (k <= W - 1) {// 右から
                dp[h][k] += (dp[h - 1][k + 1]*fr[k - 1]%MOD)*fr[W - k - 1]%MOD;
                dp[h][k] %= MOD;
            }
        }
    }

    cout << dp[H][K] << endl;
    return 0;
}

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



int main(){
  vector<int> a(3);
  REP(i,3) cin >> a[i];
  sort(a.rbegin(), a.rend());
  int ans = 10*a[0] + a[1] + a[2];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3584
import itertools
N,M = map(int,input().split())
adj = [[0] * (N) for i in range(N)]
for m in range(M):
    a,b = map(int,input().split())
    adj[a-1][b-1] = 1
    adj[b-1][a-1] = 1

ans = 0

for i in itertools.permutations(range(2,N+1)):
    f = 0
    #print(i)
    for n in range(0,N-2):
        #print(i[n]-1,i[n+1]-1)
        if adj[0][i[0]-1] != 1:
            f = 1
            break
        if adj[i[n]-1][i[n+1]-1] != 1:
            #print(adj[i[n]-1][i[n+1]-1])
            f = 1
            break
    if f == 0:
        #print(i)
        ans += 1
print(ans)

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


typedef struct _nbr {
    int num;
    int dist;
} nbr;

typedef struct _edge {
    int p_node;
    int n_node;
    int len;
} edge;

typedef struct _node {
    int color;
    std::vector<nbr> nbr_set;
} node;


int main(void)
{
    int n;
    scanf("%d", &n);
    edge *edge_set = (edge *)malloc(sizeof(edge) * (n - 1));
    for (int i = 0; i < n - 1; ++i) {
        scanf("%d%d%d", &edge_set[i].p_node, &edge_set[i].n_node, &edge_set[i].len);
    }

    node *node_set = (node *)malloc(sizeof(node) * n);
    for (int i = 0; i < n - 1; ++i) {
        nbr x = {edge_set[i].n_node, edge_set[i].len};
        nbr y = {edge_set[i].p_node, edge_set[i].len};
        node_set[edge_set[i].p_node - 1].nbr_set.push_back(x);
        node_set[edge_set[i].n_node - 1].nbr_set.push_back(y);
    }
    /*
     * BFS
     */
    node_set[0].color = 1;
    int *memo = (int *)malloc(sizeof(int) * n);
    memo[0] = 1;
    std::queue<int> q;
    q.push(0);
    while (!q.empty()) {
        int i = q.front();
        q.pop();
        for (auto itr = node_set[i].nbr_set.begin(); itr != node_set[i].nbr_set.end(); ++itr) {
            if (!memo[itr->num - 1]) {
                memo[itr->num - 1] = 1;
                q.push(itr->num - 1);
                if (itr->dist % 2 == 0) {
                    node_set[itr->num - 1].color = node_set[i].color;
                } else {
                    node_set[itr->num - 1].color = node_set[i].color ? 0 : 1;
                }
            } else {
                continue;
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        printf("%d\n", node_set[i].color);
    }

    return EXIT_SUCCESS;
}

Measured memory_bytes: 8832
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cassert>
#define InfL 1000000000
#define InfLL 1000000000000000000LL
#define mod 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=(n-1);(i)>=(0);(i)--)
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<db> vd;

int main() {
	int A[3][3];
	rep(x, 3) {
		rep(y, 3) {
			cin >> A[x][y];
		}
	}
	bool a[3][3];
	int N;
	cin >> N;
	string ans = "No";
	rep(x, 3) {
		rep(y, 3) {
			a[x][y] = false;
		}
	}
	rep(i, N) {
		int B;
		cin >> B;
		rep(x, 3) {
			rep(y, 3) {
				if (B == A[x][y])
					a[x][y] = true;
			}
		}
	}

	rep(x, 3) {
		if (a[x][0] && a[x][1] && a[x][2])
			ans = "Yes";
	}
	rep(y, 3) {
		if (a[0][y] && a[1][y] && a[2][y])
			ans = "Yes";
	}
	if (a[0][0] && a[1][1] && a[2][2])
		ans = "Yes";
	if (a[0][2] && a[1][1] && a[2][0])
		ans = "Yes";

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

Measured memory_bytes: 256
#include<iostream>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

class question {
public:
	int N, K;
	vector<int> A;

	int gcd_vec(vector<int> a, int l, int r) {
		if (l + 1 == r) return a[l];
		int m = (l + r) / 2;
		return gcd(gcd_vec(a, l, m), gcd_vec(a, m, r));
	}

	int gcd(int x, int y) {
		return y == 0 ? x : gcd(y, x%y);
	}

	void ans() {
		cin >> N >> K;
		A.resize(N);
		int mx = 0;
		REP(i, N) {
			cin >> A[i];
			mx = max(mx, A[i]);
		}
		int g = A[0];
		FOR(i, 1, N) g = gcd(g, A[i]);
		string res = "IMPOSSIBLE\n";
		if (K <= mx && K%g == 0) res = "POSSIBLE\n";
		cout << res;
	}

};



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	question q;
	q.ans();
	
	return 0;
}



Measured memory_bytes: 640
n = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(1, len(p) - 1):
    setv = p[(i - 1) : (i + 2)]
    setv_mid = setv[1]
    if sorted(setv)[1] == setv_mid:
        ans += 1

print(ans)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = sc.nextInt();
        sc.close();

        int ans = 0;
        for (int i = 0; i <= a; i++) {
            for (int j = 0; j <= b; j++) {
                for (int k = 0; k <= c; k++) {
                    if (500 * i + 100 * j + 50 * k == x) {
                        ans++;
                    }
                }
            }
        }

        System.out.println(ans);
    }
}

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

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

    string line = string(a, '0') + string(m - a, '1');
    string other = string(a, '1') + string(m - a, '0');

    for(int i = 0; i < b; i += 1)
        cout << line << "\n";
    for(int i = b; i < n; i += 1)
        cout << other << "\n";
}


Measured memory_bytes: 1280
import collections
n, k = map(int, input().split())
a = list(map(int, input().split()))

a_values = collections.Counter(a)

o = len(a_values) - k
values, counts = zip(*a_values.most_common()[::-1])

if o <= 0:
    print(0)
else:
    print(sum(counts[:o]))


Measured memory_bytes: 53528
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define full(a) a.begin(),a.end()
#define rfull(a) a.rbegin(),a.rend()

using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const long long MOD=1e9+7;

void solve(){
    long long x,ans=0;
    cin>>x;
    if(x>=500){
        ans+=(x/500)*1000;
        x%=500;
    }

    if(x>=5){
        ans+=(x/5)*5;
        x%=5;
    }
    cout<<ans<<"\n";

}

int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);

    solve();
    return 0;
}

Measured memory_bytes: 256
import itertools

n,m,x = map(int, input().split())

ca = [list(map(int, input().split())) for i in range(n)]

a = itertools.product(range(2), repeat=n)

#print(list(a))
#print(ca)
cost = 100000000

for pr in list(itertools.product(range(2),repeat=n)):
#	print(pr)
	skill = [0 for i in range(m+1)]
	tcost = 0
	for i in range(n):
		if(pr[i] == 1):
			tcost+=ca[i][0]
			for j in range(1,m+1):
				skill[j]+=ca[i][j]
	
#	print(skill,tcost)
	
	flag = 1
	for j in range(1,m+1):
		if(skill[j] < x):
			flag=0
	if(flag==1):
		cost=min(cost,tcost)
		
if(cost == 100000000):
	print(-1)
else:
	print(cost)


Measured memory_bytes: 69492
A, B, C = map(int, input().split())

m = max(A, B, C)
ans = 0
ans += (m-A)//2
A += (m-A)//2*2
ans += (m-B)//2
B += (m-B)//2*2
ans += (m-C)//2
C += (m-C)//2*2


s = sum([a == m for a in (A, B, C)])
if s == 3:
    pass
elif s == 1:
    ans += 1
else:
    ans += 2
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main(){
  string s;
  int n,a,b;
  cin>>n>>a>>b;
  cin>>s;
  int cnt=0,bc=0;
  for(int i=0;i<n;i++){
    if(cnt>=a+b || s[i]=='c') cout<<"No"<<endl;
    else if(s[i]=='a') {cnt++;cout<<"Yes"<<endl;}
    else if((bc)<b) {
      cnt++;
      bc++;
      cout<<"Yes"<<endl;
    }
    else cout<<"No"<<endl;
  }

  return 0;
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
const int N=200005;
int n,a[N],b[N],x[N],y[N],ans[N],m,k;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&x[i],&y[i]);
		a[x[i]]=y[i];
	}
	m=n+1;
	for(int i=1;i<=n;i++)
	{
		m=min(m,a[i]);
		if(m==n-i+1)
			b[++k]=i;
	}
	for(int i=1;i<=n;i++)
		for(int j=b[i];j>b[i-1];j--)
			ans[j]=b[i]-b[i-1];
	for(int i=1;i<=n;i++)
		printf("%d\n",ans[x[i]]);
	return 0;
}


Measured memory_bytes: 6868
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define yesno(flg) if(flg){cout<<'YES'<<endl;}else{cout<<'NO'<<endl;}
#define vi vector<int>
#define pb push_back
#define i197 1000000007
#define MAX_N 200002
using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<Pii,int> Piii;
typedef pair<int,ll> Pil;
typedef pair<ll,ll> Pll;
typedef pair<string,int> Psi;
typedef pair<Psi,int> Psii;

const int inf=1000000000;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

vi vec[200001];
int x[200001]={};
int dp[200001];
ll a[100001]={};
int main() {
	int n;
	cin>>n;
	printf("%0.10f",(float)((n+1)/2)/(float)n);
	return 0;
}


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

int main() {
  int A, B, M;
  cin >> A >> B >> M;
  vector<int> priceA(A,0);
  vector<int> priceB(B,0);
  map<int, int, int> coupon;
  string priceAtemp, priceBtemp, discount;
  int minPrice = 1000000;
  int sum = 0;

  for(int i=0;i<A;i++){
    cin >> priceAtemp;
    priceA[i] = stoi(priceAtemp);
  }
  for(int i=0;i<B;i++){
    cin >> priceBtemp;
    priceB[i] = stoi(priceBtemp);
  }
  for(int i=0;i<M;i++){
   cin >> priceAtemp >> priceBtemp >> discount;
   sum = priceA[stoi(priceAtemp)-1] + priceB[stoi(priceBtemp)-1] - stoi(discount);
   if (sum<minPrice){
     minPrice = sum;
   }
  }

 int minA = *min_element(priceA.begin(), priceA.end());
 int minB = *min_element(priceB.begin(), priceB.end());
  if ((minA + minB)<minPrice){
    minPrice = minA + minB;
  }

  cout << minPrice << endl;

  return 0;
}


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


void solve(long long N, std::string S){
    int pointer = 0;
    int need_left = 0;
    for(int i = 0; i < S.size(); ++i){
        if(S[i] == '(') pointer++;
        else
        {
            if(pointer == 0) need_left++;
            else pointer--;
        }
    }
    int need_right = pointer;
    string res = "";
    for(int i = 0; i < need_left; ++i) res += '(';
    res += S;
    for(int i = 0; i < need_right; ++i) res += ')';
    cout << res << endl;
}


int main(){
    long long N;
    scanf("%lld",&N);
    std::string S;
    std::cin >> S;
    solve(N, S);
    return 0;
}


Measured memory_bytes: 3708
#include <limits.h>

long long n, m, a[1000], c[1000], dp[1000][2<<12];

#define inf LLONG_MAX

long long min(long long a, long long b){ return a > b ? b : a; }

main(){
	scanf("%lld %lld", &n, &m);
	for(int i=0;i<m;i++){
		long long b, tmp;
		scanf("%lld %lld", &a[i], &b);
		while(b--){
			scanf("%lld", &tmp);
			c[i] |= (1<<(tmp-1));
		}
	}
	
	for(int i=0;i<m;i++)
	for(int j=0;j<(2<<n);j++)
	dp[i][j]=inf;
	
	dp[0][0]=0;
	dp[0][c[0]] = a[0];
	for(int i=0;i<m-1;i++){
		for(int j=0; j<(2<<n);j++){
			if(dp[i][j]!=inf){
				// buy
				dp[i+1][j|c[i+1]] = min(
				  dp[i+1][j|c[i+1]],
				  dp[i][j]+a[i+1]
			  );
			  // not to buy
			  dp[i+1][j] = min(
			  	dp[i+1][j],
			  	dp[i][j]
			  );
			}
		}
	}

	if(dp[m-1][~(~0<<n)]==inf){
		puts("-1");
		return 0;
	}
	printf("%lld\n", dp[m-1][~(~0<<n)]);
}

Measured memory_bytes: 64128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;

int main(){
  ll A,B; cin>>A>>B;
  int K; cin>>K;
  set<int> st;
  for(ll i=A;i<A+K&&i<=B;i++) st.insert(i);
  for(ll i=max(A,B-K+1);i<=B;i++) st.insert(i);
  for(auto s:st) cout<<s<<endl;
  return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

N, K = map(int, input().split())

G = []
G_append = G.append
for i in range(2, N + 1):
    G_append([1, i])

NOW = (N - 1) * (N - 2) // 2

if K > NOW:
    print (-1)
    exit()

flag = True
for i in range(2, N):
    for j in range(i + 1, N + 1):
        if K < NOW:
            G.append([i, j])
            NOW -= 1
        else:
            flag = False
            break
    if not flag:
        break

print (len(G))
for tmp in G:
    print (*tmp, sep = ' ')


Measured memory_bytes: 4120
#pragma GCC optimize("O3")

#include<bits/stdc++.h>
#define sp " "
#define endl "\n"
#define MAX 10e9
#define MAXN 100001
#define mod 1000000007
#define inf_int 2e9
#define inf_ll 2e18
#define e 1e-9
#define vi vector<int>
#define vl vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpl vector<pair<ll,ll>>
#define vpc vector<pair<char,char>>
#define adj_list vector<vl>
#define umap unordered_map<ll, ll>
#define pll pair<ll,pair<ll, ll>>
#define clr(x) memset(x,0,sizeof(x))
#define cy cout << "YES" << endl
#define cn cout << "NO" << endl
#define google cout << "Case #" << ++it << ": " << ans << endl;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
typedef long long int ll;

ll it = 0, ans = 0;

ll spf[MAXN];
void sieve()
{
    spf[1] = 1;
    for (auto i=2; i<MAXN; i++)
  		spf[i] = i;
  	for (auto i=4; i<MAXN; i+=2)
        spf[i] = 2;
    for (auto i=3; i*i<MAXN; i++)
    {
        if (spf[i] == i)
        {
            for (auto j=i*i; j<MAXN; j+=i)
                if (spf[j]==j)
                    spf[j] = i;
        }
    }
	return;
}

vl getFactorization(ll x)
{
    vl ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
}

ll powm(ll x,ll n,ll m)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1) 
			result=(result * x)%m;
        x=(x*x)%m;
        n=n/2;
    }
    return result%m;
}


void check()
{
	ll n, ans = 0;
	cin >> n;
	ll x = powm(10,n,mod)+powm(8,n,mod)-((2*powm(9,n,mod))%mod);
	cout << (x+mod)%mod;
	return ;
}

int32_t main()
{
    fastio
    ll t = 1;
    // cin >> t;
    while(t--)
        check();
    return 0;
}


Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scan = new Scanner(System.in);
        long a=scan.nextLong();
        long b=scan.nextLong();
        if(a*b%2==0){
            System.out.println("Even");
        }else {
            System.out.println("Odd");
        }
    }
}



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

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define ALL(x) (x).begin(), (x).end()

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1e15;

vector<vector<P>> v(100005);
bool visited[100005];
ll x[100005];
bool ok = true;

void dfs(ll n, ll dist) {
  if (visited[n]) {
    if (x[n] != dist) ok = false;
  } else {
    x[n] = dist;
    visited[n] = true;
    for (auto x : v[n]) {
      dfs(x.first, dist + x.second);
    }
  }
}

int main() {
  ll n, m;
  cin >> n >> m;
  ll mn = INF;
  v.resize(n);
  REP(i, m) {
    ll l, r, d;
    cin >> l >> r >> d;
    --l, --r;
    mn = min(mn, l);
    v[l].push_back(P(r, d));
    v[r].push_back(P(l, -d));
  }

  REP(i, n) x[i] = -1;

  REP(i, n) {
    if (visited[i]) continue;
    dfs(i, 0);
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 15616
#include <string>
#include <vector>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <map>
using namespace std;


#define prec(i) cout << fixed << setprecision(i)

void outPut_YN(bool isYes) {
	if(isYes)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

const long long MOD = 1000000007;

long long fact(long long k) {
	long long sum = 1;
	for (long long i = 2; i <= k; i++)
		sum *= i;

	return sum;
}

long long fact_mod(long long k) {
	long long sum = 1;
	for (long long i = 2; i <= k; i++)
		sum = (sum * i) % MOD;

	return sum;
}

int ctoi(char c) {
	if (c >= '0' && c <= '9')
		return c - '0';
	else
		return -1;
}

long long pow_mod(int a, int b) {
	long long ans = 1;
	for (int i = 0; i < b; i++)
		ans = (ans * a) % MOD;

	return ans;
}

long long powll(long long a, long long  b) {
	long long ans = 1;
	for (long long i = 0; i < b; i++)
		ans = ans * a;

	return ans;
}

long long modinv(long long a) {
	long long b = MOD, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= MOD;
	if (u < 0) u += MOD;
	return u;
}

vector<vector<int>> checkTree;
vector<int> turnTree;
vector<bool> isPassed;
int maxTurn;

int func(int pos, int turn) {
	cout << pos << endl;
	if (turn > maxTurn)
		return 0;

	if (checkTree[pos].size() > 0) {
		int max = 0;
		for (int i = 0; i < checkTree[pos].size(); i++) {
			if (!isPassed[checkTree[pos][i]]) {
				int t;
				if((t = func(checkTree[pos][i], turn + 1)) > max)
					max = t;
			}
		}
		isPassed[pos] = true;
		return max;
	}
	else {
		return turn;
	}
		
}


int main()
{
	long long a, b;

	cin >> a >> b;

	string sa, sb;

	for (int i = 0; i < b; i++)
		sa += to_string(a);

	for (int i = 0; i < a; i++)
		sb += to_string(b);

	if (a > b)
		cout << sb << endl;
	else
		cout << sa << endl;

	return 0;
}

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

#define REP(i, a, b) for (int i = (a); i <= (b); ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define FORV(a, A) for (auto &a : A)

using namespace std;

using ll = long long;

void Main()
{
   int N;
   cin >> N;
   vector<tuple<string, int, int>> SP(N);
   string s;
   int p;
   for (int i = 0; i < N; i++)
   {
      cin >> s >> p;
      p = 100 - p;
      SP[i] = tie(s, p, i);
   }
   sort(SP.begin(), SP.end());
   FORV(a, SP)
   {
      cout << get<2>(a) + 1 << endl;
   }
}

int main()
{
   std::cin.tie(nullptr);
   std::ios_base::sync_with_stdio(false);
   std::cout << std::fixed << std::setprecision(15);
   Main();
   return 0;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
m=max(a)
alist=[0]*(m+1)
for i in a:
  for j in range(i,m+1,i):
    alist[j]+=1
cnt=0
for i in a:
  if alist[i]==1:
    cnt+=1
print(cnt)

Measured memory_bytes: 32156
#include<bits/stdc++.h>
using namespace std;
using lint = long long;

signed main(){
  lint N; cin >> N;
  vector<lint> a(N), num(100010), num1(100010);
  for(lint i = 0; i < N; i++){
    cin >> a[i];
    if(i % 2 == 0) num[a[i]]++;
    else num1[a[i]]++;
  }
  lint p = max_element(num.begin(), num.end()) - num.begin();
  lint q = max_element(num1.begin(), num1.end()) - num1.begin();
  lint ans;
  if(p != q){
    ans = N - num[p] - num1[q];
  }
  if(p == q){
    sort(num.begin(), num.end(), greater<lint>());
    sort(num1.begin(), num1.end(), greater<lint>());
    ans = min(N - num[0] - num1[1], N - num[1] - num1[0]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 2688
import sys
input = sys.stdin.readline

N = int(input())

min_price = None
max_profit = None
for i in range(N):

    price = int(input())
    if min_price is not None and (max_profit is None or max_profit < (price - min_price)):
        max_profit = price - min_price

    if min_price is None or min_price > price:
        min_price = price

print(max_profit)



Measured memory_bytes: 5616
from fractions import gcd


def lcm(a, b):
    return a * b // gcd(a, b)


def mod_inv(a, m):
    return pow(a, m-2, m)


MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))

LCM = 1
for a in A:
    LCM = lcm(LCM, a)
LCM %= MOD

ans = 0
for a in A:
    ans += LCM * mod_inv(a, MOD) % MOD
    ans %= MOD

print(ans)


Measured memory_bytes: 6136
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod= 1e+9+7;

int main(){
    int n,m; cin>>n>>m;
    vector<string>a(n);
    vector<string>b(m);
    rep(i,n)cin>>a[i];
    rep(i,m)cin>>b[i];
    int cnt=0;
    int st,sy;
    int ans=0;
    bool bb=false;
    for(int i=0;i<n-m+1;i++){
        for(int j=0;j<n-m+1;j++){
            if(a[i].substr(j,m)==b[cnt]){
                st=j;
                sy=i;
                bb=true;
                ans++;
            }
            if(bb){
                while(a[sy].substr(st,m)==b[cnt]){
                    if(ans==m){
                        cout<<"Yes"<<endl;
                        return 0;
                    }
                    ans++;
                    sy++;
                    cnt++;
                }
                cnt=0;
                bb=false;
                ans=0;
            }
        }
    }
    cout<<"No"<<endl;
}





Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int maxn = 20005;



int main() {
//  freopen("in.cpp","r",stdin);
  int x,y;
  cin>>x>>y;
  x=(x+y)%24;
  cout<<x<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define ll long long
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#pragma comment(linker, "/STACK: 20000000005")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace std;

const int N = 1e6 + 5, MOD = 1e9 + 7;

int n;

int a[N];
int dp[N];

main()
{
    //freopen ("in.in", "r", stdin);freopen ("out.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    dp[0] = 1;
    cin >> n;
    int m;
    cin >> m;
    while (m--){
        int x;
        cin >> x;
        a[x] = 1;
    }
    for (int i = 1; i <= n; i++){
        if (a[i])
            continue;
        dp[i] = dp[i - 1];
        if (i > 1)
            dp[i] += dp[i - 2];
        dp[i] %= MOD;
    }
    cout << dp[n] << endl;
    return 0;
}


Measured memory_bytes: 4736
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if(a==1 && b==2 || b==1 &&a ==2)
        cout<<"3"<<endl;
    else if(a==1 && b==3 || a==3 &&b==1)
                cout<<"2"<<endl;
    else
                cout<<"1"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

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

        if(n == 25)     printf("Christmas\n");
        else if(n == 24)        printf("Christmas Eve\n");
        else if(n == 23)        printf("Christmas Eve Eve\n");
        else    printf("Christmas Eve Eve Eve\n");
        return 0;
}


Measured memory_bytes: 128
N = int(input())
S = [input() for i in range(N)]
a = [0] * 5
for i in range(N):
    if S[i][0] == 'M':
        a[0] += 1
    elif S[i][0] == 'A':
        a[1] += 1
    elif S[i][0] == 'R':
        a[2] += 1
    elif S[i][0] == 'C':
        a[3] += 1
    elif S[i][0] == 'H':
        a[4] += 1

ans = 0
for i in range(1<<5):
    if bin(i).count('1') != 3:
        continue
    tmp = 1
    for j in range(5):
        if i & (1<<j):
            tmp *= a[j]
    ans += tmp
print(ans)

Measured memory_bytes: 9772