akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define int long long
#define FILE_IO freopen("input.txt","r",stdin)/#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for(auto &it : t)cout<<it<<" ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

void solve(){
   int n, m;
   cin >>  n >> m;
   int a[n], b[n], c[m], d[m];
   for(int i = 0; i < n; i++) cin >> a[i] >> b[i];
   for(int i = 0; i < m; i++) cin >> c[i] >> d[i];
   
   int idx, mn;
   for(int i = 0; i < n; i++){
	   idx  = 0, mn = INF;
	   for(int j = 0; j < m; j++){
		    int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
		    if (mn > dist){
			  mn = dist;
			  idx = j;	
			} 
		  }
		 cout << idx + 1 << endl; 
	  }
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{

    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int MT[] ={0,0,0,0,0,0,0};
        int LT[] ={0,0,0,0,0,0,0};

        for(int n = 0;n < 7;n++){
            MT[n] = sc.nextInt();
            LT[n] = sc.nextInt();
        }

        for(int i = 0;i < 7;i++){
            MT[i] = MT[i] - LT[i];
            System.out.println(MT[i]);
    	}
    }
}

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

int main() {
  string S;
  cin >> S;
  int len0[S.size()], ans=0;
  for(int i=0;i<S.size();i++) {
    if(i == 0) {
      if(S[i] == 'A' || S[i] == 'T' || S[i] == 'C' || S[i] == 'G') {
        len0[i] = 1;
      }
      else len0[i] = 0;
    }
    else {
      if(S[i] == 'A' || S[i] == 'T' || S[i] == 'C' || S[i] == 'G') {
        len0[i] = len0[i-1] + 1;
      }
      else len0[i] = 0;
    }
    ans = max(len0[i], ans);
  }
  for(int i=S.size()-1;i>=0;i--) {
    if(i == S.size()-1) {
      if(S[i] == 'A' || S[i] == 'T' || S[i] == 'C' || S[i] == 'G') {
        len0[i] = 1;
      }
      else len0[i] = 0;
    }
    else {
      if(S[i] == 'A' || S[i] == 'T' || S[i] == 'C' || S[i] == 'G') {
        len0[i] = len0[i+1] + 1;
      }
      else len0[i] = 0;
    }
    ans = max(len0[i], ans);
  }
  cout << ans << endl;
}

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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,0,n)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define pb push_back

using namespace std;

using ll = long long;
using P = pair<int,int>;

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll LINF=1LL<<60, lmod = 1e9+7;

const int MAX_N = 100005;

ll a[MAX_N];

int main(){
  ll N,L; cin >> N >> L;
  ll re = 0LL; int r = 0;
  rep(i,N) scanf("%lld",a+i);
  rep(i,N-1){
    ll t = a[i] + a[i+1];
    if(t>re){
      re = t;
      r = i;
    }
  }
  if(re<L) cout << "Impossible" << endl;
  else{
    cout << "Possible" << endl;
    REP(i,1,r+1) cout << i << endl;
    RREP(i,N-1,r+1) cout << i << endl;
  }
  return 0;
}

Measured memory_bytes: 1536
package main

import (
	"bufio"
	"fmt"
	"os"
	"reflect"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func solve(a int64, b int64, k int64) (int64, int64) {
	if (k <= a) {
		a -= k
		return a, b
	}
	if (k <= a + b) {
		b = a + b - k
		a = 0
		return a, b
	}

	return 0, 0
}

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush()

	a := nextInt()
	b := nextInt()
	k := nextInt()
	aa, bb := solve(a, b, k)
	fmt.Fprintf(out, "%d %d\n", aa, bb)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextStringAsBytes(n int64) []byte {
	sc.Scan()
	return []byte(sc.Text())
}

func nextInt() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int64) []int64 {
	ret := make([]int64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextFloats(n int64) []float64 {
	ret := make([]float64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextFloat()
	}
	return ret
}
func nextStrings(n int64) []string {
	ret := make([]string, n)
	for i := int64(0); i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func containStr(arr []string, target string) bool {
	for _, v := range arr {
		if v == target {
			return true
		}
	}
	return false
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "orz")
	}
}

// mapからkeysとvaluesを返す
func splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {
	switch reflect.TypeOf(m).Kind() {
	case reflect.Map:
		s := reflect.ValueOf(m)
		for _, v := range s.MapKeys() {
			keys = append(keys, v)
			values = append(values, s.MapIndex(v))
		}
	default:
		fmt.Fprintln(out, "orz")
	}
	return
}


Measured memory_bytes: 640
#!/usr/bin/env python3
s = input().strip()

def is_kaibun(ss):
    if len(ss) % 2:
        return ss[: len(ss) // 2] == ss[len(ss) // 2 + 1:][:: -1]
    else:
        return ss[: len(ss) // 2] == ss[len(ss) // 2:][:: -1]

if is_kaibun(s) and is_kaibun(s[:len(s) // 2]) and is_kaibun(s[(len(s) + 3) // 2 - 1:]):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
import numpy as np

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

_ac = np.array([0 for i in range(n)])
_wa = np.array([0 for i in range(n)])

for i in range(m):
  _p, s = input().split()
  p = int(_p)
  
  if s == "AC":
    _ac[p - 1] = 1
  elif s == "WA" and _ac[p - 1] == 0:
    _wa[p - 1] += 1

ac = _ac
wa = _ac * _wa

print(str(ac.sum()) + " " + str(wa.sum()))

Measured memory_bytes: 21548
//----------------------------templates
    #pragma GCC optimize ("Ofast")
    #ifdef ONLINE_JUDGE
        #pragma GCC target ("avx512f")
    #else
        #pragma GCC target ("avx2")
    #endif
    //----------------------------
    #include <bits/stdc++.h>
    using namespace std;

    typedef long long ll;
    typedef unsigned long long ull;
    #define int ll

    #define FOR(i,j,n) for (int i=(int)(j);i<(n);i++)
    #define REP(i,n) for (int i=0;i<(int)(n);i++)
    #define REPS(i,n) for (int i=1;i<=(int)(n);i++)
    #define REPN(i,n) for (int i=(int)(n)-1;i>=0;i--)
    #define REPNS(i,n) for (int i=(int)(n);i>0;i--)

    #define I(n) scanf("%lld", &(n))
    #define LL(n) scanf("%lld", &(n))
    #define pb(n) push_back((n))
    #define mp(i,j) make_pair((i),(j))
    #define eb(i,j) emplace_back((i),(j))
    #define y0 y3487465
    #define y1 y8687969
    #define j0 j1347829
    #define j1 j234892
    #define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() )

    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())

    typedef vector<int> vi;
    typedef pair<int,int> pi;
    typedef vector<pi> vpi;
    typedef vector<vi> vvi;
    typedef vector<vpi> vvpi;
    typedef vector<vvi> vvvi;

    const int mod = 1000000007;

//--------------------------------------------

int n;
vi a;
map<int,int> balls;
int ret;

signed main(){
    I(n);
    a.resize(n);
    REP(i,n){
        I(a[i]);
        balls[a[i]]++;
    }
    for(auto p : balls) ret += p.second * (p.second-1) / 2;
    for(auto ai : a){
        printf("%lld\n", ret - (balls[ai]-1));
    }
}

Measured memory_bytes: 11008
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
using namespace std;
long long int a[100002];
int main()
 {
	long long int n,i,j,k=0,l=1,m=0;
	string s;
	cin>>n;   
	for(i=0;i<n;i++)
	   {
	       cin>>j;
	       a[j]++;
	   }
	if(n==1)
	  {
	      cout<<"1";
	      return 0;
	  }    
	k=a[1]+a[2];   
	for(i=0;i<99999;i++)
	   {
	       if(a[i]+a[i+1]+a[i+2]>k)
	         k=a[i]+a[i+1]+a[i+2];
	   }
	cout<<k;   
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int stnum;
  double wei;
  double hig;
  double BMI;
  while(scanf("%d,%lf,%lf",&stnum,&wei,&hig)!=EOF){
    BMI=wei/hig/hig;
    if(BMI>=25){
      cout<<stnum<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1228
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main()
{
	string W;

	string T;

	int count = 0;

	cin >> W;

	for (int i = 0; i < W.size(); i++)
	{
		if ('A' <= W[i] && W[i] <= 'Z')
		{
			W[i] += 32;
		}
	}

	while (1)
	{
		cin >> T;

		if (T == "END_OF_TEXT")break;

		for (int j = 0; j < T.size();j++)
		{
			if('A'<=T[j]&&T[j]<='Z')
			{
				T[j] += 32;
			}
		}

		if (T.size()==W.size()&&T.find(W) != string::npos)
		{
			count++;
		}
	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 3156
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


int main(){
  int n, v[SIZE], rv[SIZE];
  ll sumv[SIZE], sumrv[SIZE];
  ll c, x[SIZE], rx[SIZE];
  ll maxS[SIZE], maxrS[SIZE];

  scanf("%d%lld",&n, &c);

  for(int i=0;i<n;i++){
    scanf("%lld%d",x+i, v+i);
    rv[n-1-i] = v[i];
    rx[n-1-i] = c - x[i];
  }

  ll ans = 0;

  sumv[0] = v[0];
  sumrv[0] = rv[0];
  maxS[0] = v[0] - x[0]*2;
  maxrS[0] = rv[0] - rx[0]*2;
  ans = max(ans, sumv[0] - x[0]);
  ans = max(ans, sumrv[0] - rx[0]);   

  for(int i=1;i<n;i++){
    sumv[i]  = sumv[i-1] + v[i];
    sumrv[i] = sumrv[i-1] + rv[i];
    maxS[i]  = max(sumv[i]  - x[i]*2, maxS[i-1]);
    maxrS[i] = max(sumrv[i] - rx[i]*2, maxrS[i-1]);
    ans = max(ans, sumv[i]  - x[i]);
    ans = max(ans, sumrv[i] - rx[i]);
  }
  
  for(int i=0;i<n-1;i++){
    ans = max(ans, sumv[i]  - x[i] + maxrS[n-i-2]);
    ans = max(ans, sumrv[i] - rx[i] + maxS[n-i-2]);
  }

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



Measured memory_bytes: 5760
//
// Created by moono on 2018/10/27.
//

#include <iostream>
#include <string>
using namespace std;


int main() {
//    string S = "aaaaaaaaaaaaaaab", T = "aaaaaaaaaaaaaaab";
    string S, T;
    cin >> S;
    cin >> T;

    for (int i = 0, len = S.size(); i < len; ++i) {

        //
        bool is_same = true;
        int n = 0, j = i;
        while(n < len){
            if(S[j] != T[n]){
                is_same = false;
                break;
            }

            if(++j == len) j = 0;
            n++;
        }

        //
        if(is_same){
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
    return 0;
}

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

bool check(vector<ll> h, ll c, ll a, ll b) {
  ll d = a-b;
  ll cnt = 0;
  for(auto x : h) {
    x -= b*c;
    if(x>0) {
      cnt += (x+d-1)/d;
    }
  }
  return c>=cnt;
}

int main() {
  ll n, a, b;
  cin >> n >> a >> b;
  vector<ll> h(n, 0);
  for(int i=0; i<n; i++) {
    cin >> h[i];
  }
  ll ok = 1e9;
  ll ng = 0;
  while(abs(ok-ng)>1) {
    ll m = (ok+ng)/2;
    if(check(h, m, a, b)) {
      ok = m;
    } else {
      ng = m;
    }
  }
  cout << ok << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <queue>
#define rep(i, a, n) for(int i = int(a);i < int(n);++i)
#define repe(i, a, n) for(int i = int(a);i <= int(n);++i)
#define repr(i, a, n) for(int i = int(a);i > int(n);--i)
#define reper(i, a, n) for(int i = int(a);i >= int(n);--i)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define pb push_back
#define EPS (1e-20)
#define INF 2147483647
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using namespace std;


int N;
VI value;
int dp[100010];


void makeValue(){
	rep(i, 1, 7)
		value.pb((int)pow(6, i)), value.pb((int)pow(9, i));
	value.pb(1);
	sort(ALL(value));
	value.pop_back();
}


void makeDP(){
	fill(&dp[0], &dp[N+1], 999999);
	dp[0] = 0;

	repe(i, 0, N){
		rep(j, 0, SIZE(value)){
			if(i-value[j] >= 0){
				dp[i] = min(dp[i-value[j]]+1, dp[i]);
			}
		}
	}
}


int main(){
	cin >> N;

	makeValue();
	makeDP();

	cout << dp[N] << endl;

	return 0;
}

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

using ll = long long;
using namespace std;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
ll MOD=1e9+7;


int main(){
  int a,b;
  cin>>a>>b;
  cout << a*b << endl;
  return 0;
}



Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define maxn 200100
#define pii pair<int,int>
#define fi first
#define se second
#define ll long long

using namespace std;

int n,a[maxn],b[maxn];
ll ans=0;
set<pii> s;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen("in.txt","r",stdin);
    cin>>n;
    for (int i=0;i<n;i++) cin>>a[i];
    for (int i=0;i<n;i++) {
        cin>>b[i];
        s.insert(pii(b[i],i));
    }
    /*for (set<pii>::iterator it=s.begin(); it!=s.end(); ++it)
    cout << ' ' << it->fi;
    cout<<endl;*/
    while (!s.empty()) {
        int id = s.rbegin()->se;
        s.erase(--s.end());
        //cout<<s.size()<<" "<<id<<" "<<b[id]<<endl;
        if (a[id]==b[id]) continue;
        ll tmp = b[(id+1)%n] + b[(id-1+n)%n];
        if (b[id]<a[id] || (b[id]-a[id])<tmp) {
            cout<<-1;
            return 0;
        }
        ans += (b[id]-a[id])/tmp;
        if ((b[id]-a[id])%tmp==0) b[id]=a[id];
        else {
            b[id] = b[id] - (b[id]-a[id])/tmp * tmp;
            s.insert(pii(b[id],id));
        }

    }
    cout<<ans;
}


Measured memory_bytes: 11264
#[allow(unused)]
use std::io::Write;

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn main() {
    let (n, k): (usize, isize) = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s = s.trim_right().to_owned();
        let mut ws = s.split_whitespace();
        let a = ws.next().unwrap().parse().unwrap();
        let b = ws.next().unwrap().parse().unwrap();
        (a, b)
    };

    let mut a: Vec<isize> = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s = s.trim_right().to_owned();
        s.split_whitespace().map(|x| x.parse().unwrap()).collect()
    };

    let mut f: Vec<isize> = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s = s.trim_right().to_owned();
        s.split_whitespace().map(|x| x.parse().unwrap()).collect()
    };

    a.sort();
    f.sort();
    f.reverse();

    let mut left = -1;
    let mut right = 10isize.pow(12);
    while left + 1 < right {
        let mid = (left + right) / 2;
        let sum: isize = (0..n).map(|i| std::cmp::max(a[i] - (mid / f[i]), 0)).sum();
        let ok = sum <= k;
        if ok {
            right = mid;
        } else {
            left = mid;
        }
    }

    println!("{}", right);
}


Measured memory_bytes: 12900
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	string s;
	cin>>s;
	int n=s.size();
	vi co(n+2);
	vvi to(n+1,vi(26,inf));
	vi f(26,inf);
	vi used(26);
	int c=0;
	for(int i=n-1;i>=0;i--){
		int now=s[i]-'a';
		co[i]+=co[i+1];
		if(used[now]==0){
			used[now]=1;
			c++;
			if(c==26){
				c=0;
				if(i)co[i-1]++;
				used=vi(26);
			}
		}
		rep(j,26)to[i+1]=f;
		f[now]=i;
	}
//	if(c==26)co[0]++;
	to[0]=f;
	int now=0;
	while(1){
		int mi=inf,mii,h=true;
		rep(i,26)if(to[now][i]!=inf){
			if(mi>co[to[now][i]]){
				mi=co[to[now][i]];
				mii=i;
			}
		}else if(h){
			cout<<(char)(i+'a');h=false;
		}
		if(!h)break;
		cout<<(char)(mii+'a');
		now=to[now][mii]+1;
	}
	cout<<endl;
}









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

int H,W; char a[20][20];

void dfs(int x, int y){
    if (a[x][y]!='#') return;
    a[x][y]='.';
    if (a[x+1][y]=='#') dfs(x+1,y);
    else dfs(x,y+1);
}

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

    int i,j;
    for (i=1; i<=H; i++)
        for (j=1; j<=W; j++) cin >> a[i][j];

    if (a[1][1]!='#' || a[H][W]!='#'){
        cout << "Impossible\n";
        return 0;
    }

    dfs(1,1);
    for (i=1; i<=H; i++)
        for (j=1; j<=W; j++)
        if (a[i][j]!='.'){
            cout << "Impossible\n";
            return 0;
        }

    cout << "Possible\n";
    return 0;
}


Measured memory_bytes: 256
use proconio::input;
use std::cmp;

fn main() {
  input! {
    n: usize,
    mut a: [i64; n],
  }

  let INF_LL: i64 = 1_000_000_000_000_000_000;
  let mut dp: [[i64; 2]; 5] = [[-INF_LL; 2]; 5];
  dp[2][0] = 0;
  // dp[i][j] := select - not is i and (selected i-1 if j == 1))

  for x in a {
    let mut dp2: [[i64; 2]; 5] = [[-INF_LL; 2]; 5];
    for j in 0..5 as usize {
      for k in 0..2 as usize {
        if j > 0 {
          dp2[j - 1][0] = std::cmp::max(dp2[j - 1][0], dp[j][k]);
        }
        if j < 4 && k == 0 {
          dp2[j + 1][1] = std::cmp::max(dp2[j + 1][1], dp[j][k] + x);
        }
      }
    }
    dp = dp2;
  }
  let sa: i32 = n as i32 /2 - (n as i32  - n as i32/2);
  println!("{}", std::cmp::max(dp[(sa+2) as usize][0], dp[(sa+2) as usize][1]));
}


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

using namespace std;

typedef long long ll;
const int maxn = (int) 1e5 + 1;

string s;
ll cur, ans;
int main(){
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == 'W'){
            ans += cur;
        }
        else {
            cur++;
        }
    }
    cout << ans;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
const ll INF = 1e18;
#define print(x) cout << (x) << endl;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    int a;
    cin >> n;
    vector<vector<int>> A(n, vector<int>(2));
    for (int i = 0; i < n; i++) {
        cin >> a;
        A.at(i).at(0) = a;
        A.at(i).at(1) = i;
    }
    sort(A.begin(), A.end());
    for (int i = 0; i < n; i++) {
        cout << A.at(i).at(1) + 1 << " ";
    }
    cout << endl;
}

Measured memory_bytes: 6272
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define kill() return puts("INF"),0
using namespace std;
using ll = long long;
using pr = pair<int, int>;
using pir = pair<int, pr>;
using pri = pair<pr, int>;

int N, M, R, C;
pri A[1005];
pir B[1005];
vector<int> cx, cy;
vector<vector<int>> v;
vector<vector<bool>> chk1, chk2;
queue<pr> q;
ll ans;

int xidx(int x) {
	return lower_bound(all(cx), x) - cx.begin() + 1;
}

int yidx(int y) {
	return lower_bound(all(cy), y) - cy.begin() + 1;
}

int main() {
	scanf("%d %d", &N, &M);
	for(int i=1, x, y, z; i<=N; i++) {
		scanf("%d %d %d", &x, &y, &z);
		A[i] = pri(pr(x, y), z);
		cx.push_back(x), cx.push_back(y);
		cy.push_back(z);
	}
	for(int i=1, x, y, z; i<=M; i++) {
		scanf("%d %d %d", &x, &y, &z);
		B[i] = pir(x, pr(y, z));
		cx.push_back(x);
		cy.push_back(y), cy.push_back(z);
	}
	cx.push_back(0), cy.push_back(0);
	sort(all(cx)), sort(all(cy));
	cx.resize(unique(all(cx)) - cx.begin());
	cy.resize(unique(all(cy)) - cy.begin());
	R = sz(cx), C = sz(cy);
	v.resize(R + 2), chk1.resize(R + 2), chk2.resize(R + 2);
	for(int i=0; i<R+2; i++) v[i].resize(C + 2), chk1[i].resize(C + 2), chk2[i].resize(C + 2);
	for(int i=1; i<=N; i++) {
		A[i].first.first = xidx(A[i].first.first);
		A[i].first.second = xidx(A[i].first.second);
		A[i].second = yidx(A[i].second);
		for(int j=A[i].first.first+1; j<=A[i].first.second; j++) chk1[j][A[i].second] = 1;
	}
	for(int i=1; i<=M; i++) {
		B[i].first = xidx(B[i].first);
		B[i].second.first = yidx(B[i].second.first);
		B[i].second.second = yidx(B[i].second.second);
		for(int j=B[i].second.first+1; j<=B[i].second.second; j++) chk2[B[i].first][j] = 1;
	}
	int sx = xidx(0), sy = yidx(0);
	v[sx][sy] = 1, q.push(pr(sx, sy));
	while(!q.empty()) {
		int x = q.front().first, y = q.front().second; q.pop();
		if(x == 1 || x == R + 1 || y == 1 || y == C + 1) kill();
		ans += 1LL * (cx[x-1] - cx[x-2]) * (cy[y-1] - cy[y-2]);
		if(!v[x-1][y] && !(chk2[x-1][y])) {
			v[x-1][y] = 1;
			q.push(pr(x - 1, y));
		}
		if(!v[x+1][y] && !(chk2[x][y])) {
			v[x+1][y] = 1;
			q.push(pr(x + 1, y));
		}
		if(!v[x][y-1] && !(chk1[x][y-1])) {
			v[x][y-1] = 1;
			q.push(pr(x, y - 1));
		}
		if(!v[x][y+1] && !(chk1[x][y])) {
			v[x][y+1] = 1;
			q.push(pr(x, y + 1));
		}
	}
	printf("%lld\n", ans);
}

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

using namespace std;

const int N = 5e5 + 5;
const long long k = sqrt(N);

struct Query {
    long long l;
    long long r;
    long long id;
} Q[N];

long long a[N], f[N];
long long res = 0, ans[N];

void add(long long x) {
    res -= f[a[x]] > 0;
    f[a[x]]++;
    res += f[a[x]] > 0;
}

void remove(long long x) {
    res -= f[a[x]] > 0;
    f[a[x]]--;
    res += f[a[x]] > 0;
}

int main() { 
    long long n, m;
    scanf("%lld %lld", &n, &m);
    for (long long i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
    }
    for (long long i = 0; i < m; i++) {
        scanf("%lld %lld", &Q[i].l, &Q[i].r);
        --Q[i].l, --Q[i].r;
        Q[i].id = i;
    }
    sort(Q, Q + m, [&](Query x, Query y) {
        long long k_x = x.l / k, k_y = y.l / k;
        if (k_x == k_y) return x.r < y.r;
        return k_x < k_y;
    });
    long long l = 0, r = -1;
    for (long long i = 0; i < m; i++) {
        while (l > Q[i].l) add(--l);
        while (r < Q[i].r) add(++r);
        while (l < Q[i].l) remove(l++);
        while (r > Q[i].r) remove(r--);
        ans[Q[i].id] = res;
    }
    for (long long i = 0; i < m; i++) {
        printf("%lld\n", ans[i]);
    }
}


Measured memory_bytes: 27236
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] chars = sc.next().toCharArray();
        for (char c : chars) {
            if(c == '1') {
                System.out.print(9);
            } else if(c == '9') {
                System.out.print(1);
            } else {
                System.out.println(c);
            }
        }
        System.out.println();
    }
}

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

int main(){
    ll h,n,p;
    cin>>h>>n;
    ll sum=0;
    for (ll i=0; i<n; i++){
        cin>>p;
        sum+=p;
       
    }
    
    if (sum>=h) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    
}

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

int main() {
    map<int, int> data;
    int N, K;
    cin >> N >> K;
    for (int i = 0; i < N; i++) {
        int d;
        cin >> d;
        for (int j = 0; j < d; j++) {
            int A;
            cin >> A;
            if (!data.count(A)) {
                data[A] = i + 1;
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < N; i++) {
        if (!data.count(i + 1)) {
            ans++;
        }
    }
    cout << ans << endl;
}

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


def print_ans(X):
    """Test Case
    >>> print_ans(30)
    Yes
    >>> print_ans(25)
    No
    >>> print_ans(35)
    Yes
    >>> print_ans(-10)
    No
    """
    if X >= 30:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    X = int(input().rstrip())
    print_ans(X)


Measured memory_bytes: 9104
#include <bits/stdc++.h>
#define rep(i , n) for (int i = 0; i < (int)(n); i++)
const int INF = 1<<29;
using namespace std;
using ll = long long;
int main(){
    int N , sum = 0;
    string S;
    cin >> N >> S;
    for(int i = 0; i < N; i++){
        if(S[i] == 'E'){
            sum++;
        }
    }
    int t = sum;
    for(int i = 0; i < N; i++){
        if(S[i] == 'E'){
            sum--;
        }
        if(S[i] == 'W'){
            sum++;
        }
        t = min(t , sum);
    }
    cout << t << endl;
}


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

int main() {
  ll n,m;
  cin >> n >> m;
  vector<P> v[n];
  for(int i=0; i<m; i++) {
    int x,y,z;
    cin >> x >> y >> z;
    x--,y--;
    v[x].push_back(P(y,z));
    v[y].push_back(P(x,z));
  }
  ll v0,A,B,C;
  cin >> v0 >> A >> B >> C;
  ll d[n][50];
  for(int i=0; i<n; i++)for(int j=0; j<C; j++) d[i][j]=1LL<<59;
  d[0][v0]=0;
  priority_queue<PP,vector<PP>,greater<PP> > que;
  que.push(PP(0,P(0,v0)));
  while(!que.empty()) {
    PP p=que.top();que.pop();
    ll x=p.second.first,t=p.second.second,c=p.first;
    if(d[x][t]<c) continue;
    for(int i=0; i<v[x].size(); i++) {
      ll y=v[x][i].first,cc=v[x][i].second;
      ll s=(A*t+B)%C;
      if(d[y][s]<=d[x][t]+cc*t) continue;
      d[y][s]=d[x][t]+cc*t;
      que.push(PP(d[y][s],P(y,s)));
    }
  }
  for(int i=0; i<n-1; i++)for(int j=0; j<C; j++)d[i][j]=1LL<<59;
  for(int i=0; i<C; i++) que.push(PP(d[n-1][i],P(n-1,i)));
  while(!que.empty()) {
    PP p=que.top();que.pop();
    ll x=p.second.first,t=p.second.second,c=p.first;
    if(d[x][t]<c) continue;
    for(int i=0; i<v[x].size(); i++) {
      ll y=v[x][i].first,cc=v[x][i].second;
      ll s=(A*t+B)%C;
      if(d[y][s]<=d[x][t]+cc*t) continue;
      d[y][s]=d[x][t]+cc*t;
      que.push(PP(d[y][s],P(y,s)));
    }
  }
  ll ans=1LL<<59;
  for(int i=0; i<C; i++) ans=min(ans,d[0][i]);
  cout << ans << endl;
  return 0;
}


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

int main(){
  string s;
  cin >> s;
  if(s == "Sunny"){
    cout << "Cloudy" << endl;
  }
  if(s == "Cloudy"){
    cout << "Rainy" << endl;
  }
  if(s == "Rainy"){
    cout << "Sunny" << endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int n;

	scanf("%d", &n);

	switch (n) {
	case 0:
		puts("1");
		break;
	case 1:
		puts("2");
		break;
	case 2:
		puts("1");
		break;
	default:
		puts("0");
	}

	return 0;
}

Measured memory_bytes: 580
al = [chr(ord("a") + i) for i in range(26)]


def num_al(x):
    a = word.count(chr(ord("a") + x))
    return a


mylist = []
while True:
    try:
        x = input()
        mylist.append(x)
    except EOFError:
        break

abc = "".join(mylist)
word = abc.lower()

for i in range(26):
    print(f"{al[i]} : {num_al(i)}")



Measured memory_bytes: 5576
N = int(input())
lis = list(map(int,input().split()))
l = []
i = 0
x = 0
while(True):
  if i == N-1:
    x += 1
    l.append(x)
    break
  if lis[i] != lis[i+1]:
    x += 1
    l.append(x)
    x = 0
  else:
    x += 1
  i += 1
s = 0
for i in l:
  s += (i//2)
print(s)

Measured memory_bytes: 3060
#include <stdio.h>
#include <ctype.h>

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  for ( ; ; )
  {
    const int ch = getchar ( );

    if ( ch == EOF )  break ;

    putchar ( isupper ( ch ) ? ( ( ch + 'Z' - 2 * 'A' - 2 ) % ( 'Z' - 'A' + 1 ) ) + 'A'
                             : ch );
  }

  return ( 0 );
}

Measured memory_bytes: 0
from sys import stdin
import numpy as np

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
  
N = int(input())

lst_div = make_divisors(N)
#lst_plus1 = list(map(lambda x: x+1, lst_div))
#lst_toomit = list(lst_div & lst_plus1)
#print(lst_toomit)

ans = 0
for i in range(len(lst_div)):
  if (lst_div[i]-1 not in lst_div) and (lst_div[i]*(lst_div[i]-1) > N):
    ans += lst_div[i]-1

print(ans)

Measured memory_bytes: 12520
from collections import Counter
N = int(input())
Ac = Counter(list(map(int, input().split())))
sticks = sorted({k:v for k, v in Ac.items() if v >= 2}.items())[::-1]
if len(sticks) == 0:
    print(0)
else:
    if sticks[0][1] >= 4:
        print(sticks[0][0]**2)
    else:
        print(sticks[0][0]*sticks[1][0])


Measured memory_bytes: 68760
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Map = map<string,ll>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
ll INF=1LL<<60;
ll MOD=1000000007;

int main(){
    ll A;
    cin >> A;
    ll B;
    cin >> B;
    ll T;
    cin >> T;
    cout<<B*(T/A)<<endl;
    return 0;
}


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

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

  map<int, int> countMap;

  for (int i = 0; i < N; i++) {
    int num;
    cin >> num;
    countMap[num + 1]++;
    countMap[num]++;
    countMap[num - 1]++;
  }

  int ans = 0;
  for (auto c : countMap) {
    ans = max(ans, c.second);
  }

  cout << ans << endl;
}

Measured memory_bytes: 4736
# -*- coding:utf-8 -*-

def reac(H,W):
    for i in range(H):
        for l in range(W):
            print('#',end='')
        print('')
            
data = []
while True:
    try:
        di = input()
        if di == '0 0':
            break
        data.append(di)
    except:
        break

for i in range(len(data)):
    x = data[i]
    h = x.split()
    reac(int(h[0]),int(h[1]))
    print('')

Measured memory_bytes: 9116
/*
    g++ -std=c++14 -O2 -Wall a.cpp -o a && a
    g++ -std=c++14 -O2 -Wall a.cpp -o a && a < in.txt > out.txt
    */

//  io
#include <iostream>
//#include <fstream> //http://www.cplusplus.com/reference/fstream/fstream/
//#include <cstdio>
#include <iomanip> //http://www.cplusplus.com/reference/iomanip/
#include <limits>
//  util
#include <string>
#include <cstring>
#include <algorithm>
//#include <utility>
//#include <functional> //http://www.cplusplus.com/reference/functional/
//#include <cstdlib>
#include <cmath>
//#include <complex>
//#include <random>
//#include <bitset>
//  containers https://en.cppreference.com/w/cpp/container
#include <vector>
#include <queue>
#include <set>
//#include <map>
//#include <unordered_set>
//#include <unordered_map>
//  time
//#include <ctime>
//#include <chrono>
//                  https://en.cppreference.com/w/cpp/header/chrono
//                  http://www.cplusplus.com/reference/chrono/

using namespace std;
typedef vector<int> arri;
typedef vector<float> arrf;
typedef pair<int, int> pairi;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 0x7fffffffffffffff;
const ll infneg = -0x7fffffffffffffff;

//file input routed to stdinout
/*
    std::ifineam inFile("input.txt");
    std::ofineam outFile("output.txt");
    std::cin.rdbuf(inFile.rdbuf());
    std::cout.rdbuf(outFile.rdbuf());
    */

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

    if (a == b)
    {
        cout << 0;
    }
    else if ((a + b) % 2 == 0)
    {
        cout << (a + b) / 2;
    }
    else
    {
        cout << "IMPOSSIBLE";
    }
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] xs = new int[n];
        for (int i = 0; i < n; i++) xs[i] = input.nextInt();
        
        // sort
        for (int i = 1; i < n; i++) {
            print(xs);
            int v = xs[i];
            for (int j = i; j > 0; j--) {
                if (xs[j-1] <= v) {
                    xs[j] = v;
                    v = -1;
                    break;
                }
                xs[j] = xs[j-1];
            }
            if (v != -1) xs[0] = v;
        }
        print(xs);
    }
    private void print(int[] xs) {
        StringBuilder sb = new StringBuilder();
        for (int x : xs) sb.append(x).append(' ');
        System.out.println(sb.toString().trim());
    }
}

Measured memory_bytes: 21640
n,m,x=map(int,input().split())
book_list=[list(map(int,input().split())) for _ in range(n)]
ans=-1
for i in range(2**n):
    result=[0]*(m+1)
    for j in range(n):
        if (i>>j)&1:
            for k in range(m+1):
              result[k]+=book_list[j][k]
    if min(result[1:m+1])>=x:
      if ans==-1:
        ans=result[0]
      else:
        ans=min(ans,result[0])
print(ans)

Measured memory_bytes: 9132
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define FLASH cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define FILEIO freopen("/home/aman/Desktop/Kachda/input.txt", "r", stdin); //freopen("/home/aman/Desktop/Kachda/output.txt", "w", stdout);
using namespace std;
 
int n, dp[2][1<<21];
bool a[21][21];

signed main()
{
	
    FLASH
 
    cin>>n;
    for(int i = 0; i < n; i++){
    	for(int j = 0; j < n; j++){
	    	cin>>a[i][j];
	    	if(i == 0 and a[i][j])
	    		dp[i&1][1<<j] = 1;
    	}
    }
    
    for(int i = 1; i < n; i++){
    	dp[i&1][0] = 1;
    	for(int j = 1; j < (1<<n); j++){
    		dp[i&1][j] = 0;
    		if(__builtin_popcount(j) != i + 1) continue;
    		for(int k = 0; k < n; k++){
    			if(a[i][k] and (j&(1<<k))){
    				dp[i&1][j] += dp[!(i&1)][j^(1<<k)];
    				dp[i&1][j] %= mod;
    			}
    		}
    	}
    }
 
    cout<<dp[!(n&1)][(1<<n) - 1];
}

Measured memory_bytes: 33024
import sys
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra
read = sys.stdin.read

N, *ab = map(int, read().split())
a, b = zip(*zip(*[iter(ab)] * 2))

graph = csr_matrix(([1] * (N - 1), (a, b)), shape=(N + 1, N + 1))
distance = dijkstra(graph, directed=False, indices=[1, N])
d1 = distance[0]
dn = distance[1]

Fennec = -1
for i, j in zip(d1, dn):
    if i <= j:
        Fennec += 1

if Fennec > N - Fennec:
    print('Fennec')
else:
    print('Snuke')

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n,m;
  cin>>n>>m;
  ll ans = n*(n-1)/2+m*(m-1)/2;
  cout<<ans<<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "C:\Users\navodit\Desktop\mycodes\pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  





void solve(){
	string s ;cin >> s;
	if(s=="ABC") cout << "ARC";
	else cout << "ABC" ;
}
signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
 
 
 
 
int main() {
    int n,k;
    string s;
    cin>>n>>k>>s;

    int count=0;

    rep(i,n-1){
        if(s[i]==s[i+1])count++;
    }
    int maxi=min(count+2*k,n-1);
    cout<<maxi;
}




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

int main() {
  int count = 0;
  vector<char>vec(3);
  for(int i = 0;i<3;i++){
  cin >> vec.at(i) ;  
  }
if( vec.at(0) == 'R' && vec.at(1) == 'R' && vec.at(2) == 'R'){
 count = 3;
}
else if(vec.at(0) == 'R' && vec.at(1) == 'R'){
 count = 2;
}
else if(vec.at(1) == 'R' && vec.at(2) == 'R'){
 count = 2;
}
else if(vec.at(0) == 'R' || vec.at(1) == 'R' || vec.at(2) == 'R'){
 count = 1;
}
else{
 count = 0;
}  
  cout << count << endl;
}


Measured memory_bytes: 3592
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans,l=0,0
for i in range(40)[::-1]:
  b=1<<i
  c=sum(bool(x&b) for x in a)
  if l+b<=k and c<n-c:
    l+=b
    ans+=b*(n-c)
  else:
    ans+=b*c
print(ans)

Measured memory_bytes: 14208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    int p[n];
    rep(i, 0, n) cin >> p[i];
    int ans = 0;
    rep(i, 1, n - 1) {
        vector<int> v;
        v.push_back(p[i - 1]);
        v.push_back(p[i]);
        v.push_back(p[i + 1]);
        sort(all(v));
        if (v[1] == p[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>

//#include<bits/stdc++.h>

using namespace std;


int main() {

	string p;
	cin >> p;
	cout << "ABC" << p << endl;
	
	
	return 0;
	
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
const int MAXN = 25;
int P[MAXN];
int N;

int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &P[i]);
  }
  int ret = 0;
  for (int i = 2; i < N; ++i) {
    int mn = *std::min_element(P+i-1, P+i+2);
    int mx = *std::max_element(P+i-1, P+i+2);
    if ((P[i] != mn) && (P[i] != mx)) ++ret;
  }
  printf("%d\n", ret);
  return 0;
}

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

vector<string> split(const string &s, char delimiter)
{
	vector<string> ret;
	size_t now = 0, find;
	while ((find = s.find_first_of(delimiter, now)) != string::npos)
	{
		ret.push_back(string(s, now, find - now));
		now = find + 1;
	}
	ret.push_back(string(s, now, s.size() - now));
	return ret;
}
int main()
{
	string s;
	int bin[] = {0,0,0,0};
	while (cin >> s)
	{
		vector<string> ss = split(s, ',');
		if (ss[1].size() == 2)
		{
			bin[2]++;
		}
		else if (ss[1][0] == 'A')
		{
			bin[0]++;
		}
		else if (ss[1][0] == 'B')
		{
			bin[1]++;
		}
		else
		{
			bin[3]++;
		}
	}
	for (int i = 0; i < 4; i++)cout << bin[i] << endl;
	return 0;
}

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

using namespace std;

int a;
int b;
int c;
int d;

int main() {
    cin >> a >> b >> c >> d;
    if(abs(a - c) <= d) puts("Yes");
    else if(abs(a - b) <= d && abs(c - b) <= d) puts("Yes");
    else puts("No");
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;

class Program
{
	static void Main(string[] args)
	{
		int i, j;
		Int64 n = Int64.Parse(Console.ReadLine());
		Int64 val = 2;
		Int64 tmp = n;
		List<Int64> primeList = new List<Int64>();

		//素因数分解
		while(val * val <= n)
		{
			if (tmp % val == 0)
			{
				tmp /= val;
				primeList.Add(val);
			}
			else
			{
				val++;
			}
		}
		if (tmp != 1) {
			primeList.Add(tmp);
		}

		if ( primeList.Count == 0)
		{
			Console.WriteLine(0);
			return;
		}

		//同じ素数が何個あるかのリスト
		List<Int64> pcountList = new List<Int64>();
		tmp = primeList[0];
		Int64 tmpCount = 0;
		for (i = 0; i < primeList.Count; i++)
		{
			if (tmp != primeList[i])
			{
				tmp = primeList[i];
				pcountList.Add(tmpCount);
				tmpCount = 1;

			}
			else
			{
				tmpCount++;
			}
		}
		pcountList.Add(tmpCount);

		Int64 result = 0;

		for(i = 0; i < pcountList.Count; i++)
		{
			tmp = pcountList[i];
			for (j = 1; j <= pcountList[i]; j++)
			{
				tmp -= j;
				if(tmp >= 0)
				{
					result++;
				}
				else
				{
					break;
				}
			}
		}

		Console.WriteLine(result);
		return;
	}
}

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

#define MAX 100000
#define INF (INT32_MAX/2)

int N;
int a[MAX];
int b[MAX];
int c[MAX];

int dp[MAX + 1][3];

int main() {
	cin >> N;
	for( int i = 0; i < N; i++ ) {
		cin >> a[i] >> b[i] >> c[i];
	}

	for( int i = 0; i < N; i++ ) {
		dp[i + 1][0] = max( dp[i + 1][0], max( dp[i][1] + a[i], dp[i][2] + a[i] ) );
		dp[i + 1][1] = max( dp[i + 1][1], max( dp[i][0] + b[i], dp[i][2] + b[i] ) );
		dp[i + 1][2] = max( dp[i + 1][2], max( dp[i][0] + c[i], dp[i][1] + c[i] ) );
	}
	int ans = max( dp[N][0], max( dp[N][1], dp[N][2] ) );

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
 
using namespace std;
 
priority_queue<pair<int, int> > q;
map<int, int> d;
int n, m;
 
main(){
  cin >> n >> m;
  for(int i=0;i<n;i++) q.push(make_pair(0, -n));
  for(int i=0;i<m;i++){
    int a, b;
    cin >> a >> b;
    d[a] += b;
    q.push(make_pair(d[a], -a));
    while(1){
      pair<int, int> p = q.top();
      if(p.first == d[-p.second]){
        cout << -p.second << ' ' << p.first << endl;
        break;
      }
      q.pop();
    }
  }
}

Measured memory_bytes: 21180
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<queue>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int> >;
using pii = pair<int, int>;
using ppi = pair<pii, int>;

int f_dir[2][4] = {{-1, 0, 1, 0}, {0, 1, 0, -1}}; //↑→↓←
int e_dir[2][8] = {{-1, -1, -1, 0, 0, 1, 1, 1}, {-1, 0, 1, -1, 1, -1, 0, 1}};
bool is_in_field(int y, int x, int h, int w){
  return (y >= 0 && y < h && x >= 0 && x < w);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  ll n, k;
  cin >> n >> k;
  cout << min(n%k, k - (n%k)) << endl;

  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}


Measured memory_bytes: 256