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

using namespace std;

typedef long long ll;
typedef complex<double> point;
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define forrit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define maxN 100005
#define MOD 998244353
#define oo 1000000000000000007LL
#define sz(a) (int)a.size()

const double PI = acos(-1.0);

double fRand(double fMin, double fMax)
{
    double f = (double)rand() / RAND_MAX;
    return fMin + f * (fMax - fMin);
}

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, l[maxN], r[maxN], cntL[2*maxN], cntR[2*maxN];

int main () {
    scanf("%d", &n);
    fto(i, 1, n) {
        scanf("%d%d", &l[i], &r[i]);
        l[i] += maxN; r[i] += maxN;
    }

    fto(i, 1, n) {
        ++cntL[r[i]];
        ++cntR[l[i]-1];
    }
    fto(i, 1, 2*maxN-1) cntL[i] += cntL[i-1];
    fdto(i, 2*maxN-2, 0) cntR[i] += cntR[i+1];

    ll ans = 0;
    fto(i, -maxN, -1) {
        ans += 2*min(cntL[i+maxN], cntR[i+maxN]+1);
    }
    fto(i, 0, maxN-1) {
        ans += 2*min(cntL[i+maxN]+1, cntR[i+maxN]);
    }

    printf("%lld", ans);



    return 0;
}


Measured memory_bytes: 2560
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long ll ;
#define rep(i, a, b) for (int i = a; i <= b; ++ i) 
const int mo = 1e9 + 7 ;
const int G[4][4] = {{2, 1, 1, 1}, {1, 1, 0, 1}, {1, 0, 1, 1}, {1, 0, 0, 1}} ;
using namespace std ;
int a[4][4], b[4][4], c[4][4], n, m ;
void upd(int &x, int y) {
	x = (x + y) % mo ;
}
void mul(const int A[4][4], const int B[4][4], int (&ret)[4][4]) {
	rep(i, 0, 3) rep(j, 0, 3) c[i][j] = 0, a[i][j] = A[i][j], b[i][j] = B[i][j] ;
	rep(i, 0, 3) rep(j, 0, 3) rep(k, 0, 3) upd(c[i][j], (ll) a[i][k] * b[k][j] % mo) ;
	rep(i, 0, 3) rep(j, 0, 3) ret[i][j] = c[i][j] ;
}
int main() {
	scanf("%d%d", &n, &m) ;
	int x, las = 0, f[4], tmp[4], ans[4][4], w[4][4] ;
	rep(i, 0, 3) rep(j, 0, 3) ans[i][j] = 0 ;
	rep(i, 0, 3) ans[i][i] = 1 ;
	rep(t, 1, m + 1) {
		if (t <= m) scanf("%d", &x) ; else x = n ;
		int b = x - 1 - las ;
		rep(i, 0, 3) rep(j, 0, 3) w[i][j] = G[i][j] ;
		for ( ; b; b /= 2) {
			if (b & 1) mul(ans, w, ans) ;
			mul(w, w, w) ;
		}
		if (t > m) break ;
		rep(i, 0, 3) rep(j, 0, 3) w[i][j] = G[i][j] ; 
		rep(i, 0, 3) -- w[i][0] ;
		mul(ans, w, ans) ;
		las = x ;
	}
	int res = 0 ;
	rep(i, 0, 3) upd(res, ans[0][i]) ;
	printf("%d\n", (res + mo) % mo) ;
	return 0 ; 
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        s: chars
    }
    // println!("{:?}", s);
    let mut ans:Vec<u64> = vec![0;s.len()];
    let mut rle:Vec<(char, u64)> = vec![];
    let mut ch:char = 'a';
    let mut len = 0;
    let mut ind = vec![];
    for i in 0..s.len() {
        if ch == 'R' && s[i]=='L' {
            ind.push(i);
        }
        if i==0 {
            ch = s[i];
            len = 1;
            continue;
        }
        if ch==s[i] {
            len+=1;
        }
        if ch!=s[i] {
            rle.push((ch, len));
            ch = s[i];
            len = 1;
        }
        if i==s.len()-1 {
            rle.push((ch, len));
        }
    }
    // println!("{:?}", rle);
    for i in 0..rle.len()/2 {
        ans[ind[i]] = rle[2*i].1/2 + (rle[2*i+1].1 + 1)/2; //L
        ans[(ind[i] as i64-1) as usize] = (rle[2*i].1 + 1)/2+rle[2*i+1].1/2; //R
    }
    for i in 0..s.len() {
        if i==s.len()-1 {
            println!("{}", ans[i]);
            continue;
        }
        print!("{} ", ans[i]);
    }
}

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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

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

signed main(){
    int a, b; cin >> a >> b;
    int t = max( a, b );
    cout << t + max( t - 1, min( a, b ) ) << endl;;
}

Measured memory_bytes: 256
/*
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠺⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⠀⠈⢿⣦⣄⣈⣁⣀⣠⣴⣦⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣶⡄⠙⢿⣿⣿⣿⣿⣿⡿⠓⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠙⣿⣿⠿⠛⠛⠛⠛⣿⣿⡄⠀⠈⠉⠉⠉⣁⣀⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⣸⣿⡇⠀⠀⠀⣴⣿⣿⡿⠿⢷⣄⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠠⣤⣤⣴⣾⣿⡿⠁⠀⢀⣾⣿⣿⠏⠀⠀⠈⣿⣧⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣏⠀⠀⣠⣾⣿⣿⠏⠀⠀⠀⠀⢹⣿⡄⠀⠀
⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠻⣿⣿⡟⠻⠿⠛⠁⠀⠀⠀⠀⠀⣾⣿⡇⠀⠀
⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⡄⠀⣄⠀⠀⠀⠀⠀⣰⣿⣿⠇⠀⠀
⠀⠀⠀⢿⡄⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⠇⠀⠹⣷⣤⣤⣤⣾⣿⣿⡟⠀⠀⠀
⠀⠀⠀⠈⢿⣦⣄⣀⠀⠀⣀⣠⣾⣿⣿⡟⠀⠀⠀⠘⠻⣿⣿⣿⠿⠋⠀⠀⠀⠀
⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⡿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠛⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

           KRISHNA ASHOK⠀
*/

#include <bits/stdc++.h>
using namespace std;

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds; 
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> Tree;
// order_of_key(k), find_by_order(k)


#define dbg(x) cout<<#x<<"="<<x<<'\n'
#define ll long long
#define pr pair<int,int>
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define For(i,n) for(int i=0;i<(n);++i)
#define Forr(i,n) for(int i=n-1;i>=0;i--)
#pragma GCC optimization("Ofast")
#pragma GCC optimization("unroll-loops")
#define fin ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
#define sz(a) (int)a.size()
#define Fill(a,b) memset(a,b,sizeof(a));
#define fileio freopen("http://in.in", "r", stdin),freopen("out.out", "w", stdout);
const int INF=1e9;
#define endl '\n'
#define fit(i,x) for(auto i:x)
#define gcd(a,b) __gcd(a,b)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
#define vt vector
#define ppr pair<int,pair<int,int>>



void solve(){
	ll n,m,k;
	cin>>n>>m>>k;
	
	vt<ll> a(n+1,0),b(m+1,0);
	ll y;
	for(int i=0;i<n;i++){
		cin>>y;
		a[i+1]=a[i]+y;
	}
	
	for(int i=0;i<m;i++){
		cin>>y;
		b[i+1]=b[i]+y;
	}
	int ans=0;
	for(int i=0;i<=n;i++){
		if(a[i]>k)break;
		int l=0,r=m+1;
		int val=k-a[i];
		while(l+1<r){
			int mid=(l+r)>>1;
			if(b[mid]<=val)l=mid;
			else r=mid;
		}
		ans=max(ans,i+l);

	}

	cout<<ans<<endl;	

}



int main()
{
    fin;
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int h,w; cin >> h >> w;
    vvl c(10,vl(10));
    rep(i,10) rep(j,10) cin >> c[i][j];
    vvl a(h,vl(w));
    rep(i,h) rep(j,w) cin >> a[i][j];
    
    //ワーシャルフロイド法
    int n=10;
    for(int k=0;k<n;k++){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                chmin(c[i][j],c[i][k]+c[k][j]);
            }
        }
    }

    ll res = 0;
    rep(i,h){
        rep(j,w){
            if(a[i][j] == -1)continue;
            res += c[a[i][j]][1];
        }
    }
    cout << res << endl;
}


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

#define __STDC_FORMAT_MACROS
#define p64 PRId64

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR (i, 0, n)
#define ALL(f, x, ...)                                                         \
    ([&] (decltype ((x)) ALL) {                                                \
        return (f) (begin (ALL), end (ALL), ##__VA_ARGS__);                    \
    }) (x)

using namespace std;
using ll = int64_t;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> h (N, 0);
    REP (i, N) cin >> h[i];
    cout << ALL (accumulate, h, 0, [=] (int pre, int cur) {
        return pre + (K <= cur ? 1 : 0);
    }) << endl;
    return 0;
}

Measured memory_bytes: 3656
N=str(input())
n=len(N)
a=N[n-1]
if a=='2':
  print("hon")
if a=='4':
  print("hon")
if a=='5':
  print("hon")
if a=='7':
  print("hon")
if a=='9':
  print("hon")
if a=='0':
  print("pon")
if a=='1':
  print("pon")
if a=='6':
  print("pon")
if a=='8': 
  print("pon")
if a=='3':
  print("bon")

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

namespace ABC067A___Sharing_Cookies
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            List<int> value = new List<int>();

            foreach (var v in input)
            {
                value.Add(int.Parse(v));
            }


            string result = "Impossible";
            if (value.Exists(x => x % 3 == 0) ||
                value.Sum() % 3 == 0)
            {
                result = "Possible";
            }

            Console.WriteLine(result);

        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;
using vi = vector<int>;

#define in(v) v; cin >> v;
void ins() {}
template<class T,class... Rest>void ins(T& v,Rest&... rest){cin>>v;ins(rest...);}


#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}

// debug
template<class T>ostream& operator<<(ostream& os,const vector<T>& vec){os<<"{";for(size_t i=0;i<vec.size();++i)os<<(i?", ":"")<<vec[i];os<<"}";return os;}
ostream& operator<<(ostream& os,const vector<char>&v){for(size_t i=0;i<v.size();++i)os<<v[i];return os;}
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>& rhs){os<<"("<<rhs.first<<", "<<rhs.second<<")";return os;}

#ifdef LOCAL
void debug() {cerr << "\n";}
template<class First> void debug(const First& first) {cerr<<first<<"\n";}
template<class First, class... Rest> void debug(const First& first, const Rest&... rest) {cerr<<first<<",";debug(rest...);}
void debug2() {cerr << "\n";}
template<class First> void debug2(const First& first) {cerr<<first<<" ";}
template<class First, class... Rest> void debug2(const First& first, const Rest&... rest) {cerr<<first<<" ";debug2(rest...);}
#else
#define debug(...) 42
#define debug2(...) 42
#endif


int N;
double dp[301][301][301];
double dfs(int a, int b, int c) {
  if (a == 0 && b == 0 && c == 0)
    return 0;
  if (dp[a][b][c] != -1)
    return dp[a][b][c];
  double ans = 1.0 * N / (a + b + c);
  if (a > 0) ans += 1.0 * a / (a + b + c) * dfs(a-1, b, c);
  if (b > 0) ans += 1.0 * b / (a + b + c) * dfs(a+1, b-1, c);
  if (c > 0) ans += 1.0 * c / (a + b + c) * dfs(a, b+1, c-1);
  return dp[a][b][c] = ans;
}
int main() {
  in(N);

  rep(i, 301) rep(j, 301) rep(k, 301) dp[i][j][k] = -1;
  vi v(4,0);
  rep(i, N) {
    int in(a);
    ++v[a];
  }
  cout << fixed << setprecision(15) << dfs(v[1], v[2], v[3]) << endl;

  return 0;
}


Measured memory_bytes: 213376
# utf-8:
import numpy as np


def main():
    w, h, n = map(int, raw_input().split())
    sq = np.ones((h, w))
    for _ in range(n):
        x, y, a = map(int, raw_input().split())
        paint(sq, x, y, a, w, h)

    print(int(sq.sum()))



def paint(sq, x, y, a, w, h):
    if a == 1:
        for i in range(x):
            sq[:, i] = 0
    elif a == 2:
        for i in range(w - x):
            sq[:, i + x] = 0
    elif a == 3:
        for i in range(y):
            sq[i, :] = 0
    elif a == 4:
        for i in range(h - y):
            sq[i + y, :] = 0


if __name__ == '__main__':
    main()


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

int main(){

    int n;
    scanf("%d",&n);
    int a[2][n];
    for(int i = 0;i<2*n;i++){
        if(i<n)scanf("%d",&a[0][i]);
        else scanf("%d",&a[1][i-n]);
    }

    int ans[n];
    for(int i=0;i<n;i++){
        ans[i] = 0;
        for(int j = 0;j<n;j++){
            if(j < i){
                ans[i] += a[0][j];
            }
            else if(i == j){
                ans[i] += a[0][j] + a[1][j];
            }
            else{
                ans[i] += a[1][j];
            }
        }
    }
    int MAX = 0;
    for(int i = 0;i<n;i++){
        MAX = max(MAX,ans[i]);
    }

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

    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	ll n;
	cin >> n;
	ll ans = 0;
	for (ll i = 1; i <= n; i++) {
		for (ll j = i; j <= n; j += i) {
			ans += j;
		}
	}
	cout << ans << '\n';
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int dp[250][150],T[250],x[250][3],D,N,MAX;
main(){memset(dp,-1000000,sizeof(dp));
    cin>>D>>N;
    for(int i=1;i<=D;i++){cin>>T[i];}
    for(int i=1;i<=N;i++){
        cin>>x[i][0]>>x[i][1]>>x[i][2];
        if(T[1]>=x[i][0] && T[1]<=x[i][1]){dp[1][x[i][2]]=0;}
    }
    for(int i=2;i<=D;i++){
        for(int j=1;j<=N;j++){
            if(T[i]>=x[j][0] && T[i]<=x[j][1]){
                for(int k=0;k<=100;k++){
                    dp[i][x[j][2]]=max(dp[i][x[j][2]],dp[i-1][k]+abs(x[j][2]-k));
                }
            }
        }
    }
    for(int i=0;i<=100;i++){MAX=max(MAX,dp[D][i]);}
    cout<<MAX<<endl;
    return 0;
}

Measured memory_bytes: 3208
using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] In = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int a = In[0];
            int b = In[1];
            int c = In[2];
            Console.WriteLine((int)Math.Min(b/a,c));
        }
    }
}


Measured memory_bytes: 27896
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main()
{
    int n;
    cin >> n;
    rep(i, 10){
        rep(j, 10){
            if(i*j == n){
                cout << "Yes";
                return 0;
            }
        }
    }
    cout << "No";
    return 0;
}

Measured memory_bytes: 256
var obj = init();
Main();
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");}
function init(){
  var inputFile = myin();
  var returnObj = {
    "list" : inputFile, "index" : 0, "max" : inputFile.length,
    "hasNext" : function(){return (this.index < this.max);},
    "next" : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var N = nextInt();
  var list = new Array(N - 1);
  var output = new Array(N);
  for(var i = 0; i < N - 1; i++){
    var tmp = nextIntArray();
    list[i] = {
      "kyori" : tmp[0],
      "first" : tmp[1],
      "pace" : tmp[2]
    };
  }
  for(var i = 0; i < N - 1; i++){
    var sum = 0;
    for(var j = i; j < N - 1; j++){
      if(sum < list[j]["first"]){
        sum = list[j]["first"];
      }else{
        if(sum % list[j]["pace"] != 0){
          sum += (list[j]["pace"] - (sum % list[j]["pace"]))
        }
      }
      sum += list[j]["kyori"];
    }
    output[i] = sum;
  }
  output[N - 1] = 0;
  myout(myconv(output,9));
}

Measured memory_bytes: 7868
#include<stdio.h>

int main()
{
  int i,j,s,count=0,a[100],n,temp,minj;

  scanf("%d",&n);
  for(s=0;s<n;s++)
    {
      scanf("%d",&a[s]);
    }

  
  for(i=0;i<=n-1;i++)
    {
      minj=i;
      for(j=i;j<=n-1;j++)
	{
	  if(a[j]<a[minj])
	    {
	      minj=j;
	    }
	}
	      temp=a[i];
	      a[i]=a[minj];
	      a[minj]=temp;
	      if(i!=minj) count++;
	    
	
    }

  for(i=0;i<n;i++)
    {
      if(i>0) printf(" ");
      printf("%d",a[i]);
    }
  printf("\n");
  printf("%d\n",count);

  return 0;
}



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

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repone(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define repr(i, n) for (ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for (auto &i : mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template <class T> ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template <class T> istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template <class T> ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll n;
    cin >> n;
    ll ans = 0;
    repone(i, n) {
        if (i % 3 != 0 && i % 5 != 0) ans += i;
    }
    cout << ans << '\n';
}

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


Measured memory_bytes: 3644
#include<iostream>
#include<queue>
#include<string>
using namespace std;

int main(){

  queue<string> x1;
  queue<int> x2;
  string x01;
  int x02;
  int max_datasets=500000;
  int all_time=0;
 
  int n,q;
  string name[max_datasets];
  int time[max_datasets];
  cin>>n>>q;
  for(int i=0;i<n;i++){
    cin>>name[i]>>time[i];
    x1.push(name[i]);
    x2.push(time[i]);
  }
 
  while(x1.size()!=0){
    if(x2.front()<=q){
      all_time += x2.front();
      cout<<x1.front()<<" "<<all_time<<"\n";
      x1.pop();
      x2.pop();
    }
    else{
      x2.front() -= q;
      all_time += q;
      x01=x1.front();
      x02=x2.front();
      x1.pop();
      x2.pop();
      x1.push(x01);
      x2.push(x02);
    }
  }
  return 0;
}



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

int main(){
  int n;
  string count = "Three";
  cin >> n;
  vector<string> S(n);
  rep(i,n){
    cin >> S[i];
  }
  rep(i,n){
    if (S[i] == "Y"){
      count = "Four";
      break;
    }
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <map>
#include <set>
#include <sstream>
#include <iostream>
#include <limits>
#include <algorithm>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <cmath>


using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int>> vii;
typedef stringstream ss;
const int mii = numeric_limits<int>::min();
const int mai = numeric_limits<int>::max();
const ll mil = numeric_limits<long long>::min();
const ll mal = numeric_limits<long long>::max();

#define REP(i, a, b) for(long long i=a; i<=b; ++i)
#define RREP(i, a, b) for(long long i=a; i>=b; --i)
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)

int main(int argc, char **argv) {
    ll n, a, b;
    cin >>n>>a>>b;

    ll res = n%(a+b);

    ll o = (n/(a+b))*a;
    o+=min(a, res);

    cout << o << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)

int main() {
    
    int n;
    string op;
    int tmp;
    list<int> lst;
    
    scanf("%d", &n);
    rep (i, n) {
        cin >> op;
        if (op[0] == 'i') {
            scanf("%d", &tmp);
            lst.push_front(tmp);
        }
        else if (op[6] == 'F') {
            lst.pop_front();
        }
        else if (op[6] == 'L') {
            lst.pop_back();
        }
        else if (op[0] == 'd') {
            scanf("%d", &tmp);
            for (auto itr = lst.begin(); itr != lst.end(); itr++) {
                if (*itr == tmp) {
                    lst.erase(itr);
                    break;
                }
            }
        }
    }
    list<int>::iterator it, ed;
    for(it = lst.begin(), ed = --lst.end(); it != ed; ++it) cout << *it << " ";
    cout << *it << endl;
    
    return 0;
}



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

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

Measured memory_bytes: 256
#include<stdio.h>

int main(){
    int K;
    int A, B;
    int cnt;
    int flag = 0; //0:NG 1:OK

    scanf("%d", &K);
    scanf("%d %d", &A, &B);

    if(A % K == 0|| B % K == 0){
        flag = 1;
    }

    cnt = (A / K) * K + K;

    while(cnt >= A && cnt <= B){
        if(flag == 1){
            break;
        }
        if(cnt % K == 0){
            flag = 1;
        }
        cnt += K;
    }

    if(flag == 1){
        puts("OK");
    }else{
        puts("NG");
    }

    return 0;
}


Measured memory_bytes: 1664
h,w = map(int,input().split())

table = []
table.append(["#" for _ in range(w+2)])
for i in range(h):
    s = input()
    table.append(["#"]+list(s)+["#"])
table.append(["#" for _ in range(w+2)])

# yoko = []#[None for _ in range(w)] for _ in range(h)]
yoko_cnt = []
for i in range(1,h+1):
    cnt = 0
#     start = 0
    yoko = []
    for j in range(1,w+2):
        if table[i][j] == "#":
            if cnt != 0:
                yoko.append(cnt)
            yoko.append(0)
            cnt = 0
            continue
        else:
            cnt += 1
    yoko_cnt.append(yoko[:-1])

# yoko = []#[None for _ in range(w)] for _ in range(h)]
tate_cnt = []
for i in range(1,w+1):
    cnt = 0
#     start = 0
    tate = []
    for j in range(1,h+2):
        if table[j][i] == "#":
            if cnt != 0:
                tate.append(cnt)
            tate.append(0)
            cnt = 0
            continue
        else:
            cnt += 1
    tate_cnt.append(tate[:-1])

yoko_cnt_mod = []
for l in yoko_cnt:
    hoge = []
    for i in l:
        if i == 0:
            hoge.append(0)
        else:
            hoge.extend([i for _ in range(i)])
    yoko_cnt_mod.append(hoge)
# yoko_cnt_mod = [[0 if i == 0 else i for _ in range(i) for i in l] for l in yoko_cnt  ]

tate_cnt_mod = []
for l in tate_cnt:
    hoge = []
    for i in l:
        if i == 0:
            hoge.append(0)
        else:
            hoge.extend([i for _ in range(i)])
    tate_cnt_mod.append(hoge)
# yoko_cnt_mod = [[0 if i == 0 else i for _ in range(i) for i in l] for l in yoko_cnt  ]

result = 0
for i in range(h):
    for j in range(w):
        tt = tate_cnt_mod[j][i]
        yy = yoko_cnt_mod[i][j]
        
        if tt == 0 or yy ==0:
            continue
        else:
            c = tt + yy - 1
            if result < c:
                result = c
                
print(result)

Measured memory_bytes: 315272
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    MOD = 1000000007
    
    color = [0] * N
    can_use = [0] * (N + 1)
    can_use[0] = 3
    for i in range(N):
        color[i] = can_use[A[i]]
        can_use[A[i]] -= 1
        can_use[A[i] + 1] += 1
    ans = 1
    for c in color:
        ans = ans * c % MOD
    print(ans)


if __name__ == '__main__':
    solve()


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

using namespace std;

int main(){
	int N, K;
	scanf("%d %d", &N, &K);
	int h[N];
	int r[N];
	for(int i=0; i<N; i++){
		scanf("%d", &h[i]);
		r[i] = INT_MAX;
	}

	r[0] = 0;
	for(int i=0; i<N; i++){
		for(int j=i+1; j<i+K+1 && j<N; j++){
			r[j] = min(r[j], abs(h[i]-h[j]) + r[i]);
		}
	}

	printf("%d\n", r[N-1]);
}



Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
  long n,k,mn;
  cin >> n >> k;
  mn = n;
  if(n % k > 0){
    mn = min(n - (n / k * k),abs(n - (n / k * k + k)));
  }else{
    mn = 0;
  }
  
  cout << mn << endl;
}

Measured memory_bytes: 256
N = int(input())
li = [int(i) for i in input().split()]

is_approved = True
for l in li :
    if (l % 2 != 0) :
        continue

    if (l % 3 == 0 or l % 5 == 0) :
        continue

    is_approved = False
    break

if (is_approved) :
    print("APPROVED")
else :
    print("DENIED")



Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		var sc = new Scanner(System.in);
		String str = sc.nextLine();
		if (str.equals("ABC")){
			System.out.println("ARC");
		}
		if (str.equals("ARC")) {
			System.out.println("ABC");
		}

	}

}


Measured memory_bytes: 35760
#include<bits/stdc++.h>
using namespace std;
#define  md     1000005
#define  pi     2*acos(0.0)
#define  ll    long long int
#define  pb    push_back
#define  sortt(v) sort(v.begin(),v.end())
#define  no    cout<<"No\n"
#define  yes   cout<<"Yes\n"
//-------------------------------------
#define  lwr(a,n,k) lower_bound(a,a+n,k)-a;
#define  upr(a,n,k) upper_bound(a,a+n,k)-a;
//-------------------------------------------
#define  input(n,a)    for(i=0;i<n;i++)cin>>a[i];
#define  print(a)      for(auto it:a)cout<<it<<' ';
//------loops---------//
#define  rep(n) for(i=0;i<n;i++)
#define  fo(n)  for(i=1;i<=n;i++)
//vector<int>v;
/*int lcm(int a,int b)
{
   return a*(b/__gcd(a,b));
}
bigint(string s)
{
    int r=0;
    for(int i=0;i<s.length();i++)
    {
        r=(r*10+(s[i]-'0'));
        r=r%md;
    }
    return r;
}*/


int main()
{
  ll a,b;
  string s;
  cin>>a>>s>>b;
  if(s=="+")
  {
       cout<<a+b<<endl;
  }
  else cout<<a-b<<endl;

}












Measured memory_bytes: 3604
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

int main() {
  int64_t N, K;
  std::cin >> N >> K;
  std::vector<bool> sunuke(N);

  for (int64_t i = 0; i < K; ++i) {
    int64_t d;
    std::cin >> d;
    for (int64_t j = 0; j < d; ++j) {
      int64_t okashi_motteru_sunuke_no;
      std::cin >> okashi_motteru_sunuke_no;
      --okashi_motteru_sunuke_no;  // to 0 start
      sunuke.at(okashi_motteru_sunuke_no) = true;
    }
  }
  int64_t answer = 0;
  for (const auto &elem : sunuke) {
    if (elem == false) ++answer;
  }
  std::cout << answer << std::endl;
}


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm(a, b) (a)/__gcd((a),(b))*(b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

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

vector<int> Div(int n) {
    vector<int> ret;
    for(int i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);

            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for(int i = 0; i < n; ++i) cin >> v[i];
    sort(all(v), greater<>());
    int sum = 0;
    for(int i = 0; i < k; ++i) sum += v[i];
    cout << sum << endl;
    return 0;
}



Measured memory_bytes: 256
n = int(input())
lst1 = list(map(int,input().split()))
s = sum(lst1)
abs_ = 10**18
now = 0
i = 0
while True:
    now += lst1[i]
    if i >= n-1:
        break
    else:
        abs_ = min(abs_,abs(now-(s-now)))
    i += 1

print(abs_)


Measured memory_bytes: 76880
#include <bits/stdc++.h>
using namespace std;
#define N 500005
int n,m;char a[N];
struct BIT
{
	int v[N];
	void upd(int x,int _v) {for(;x<=n;x+=x&-x) v[x]+=_v;}
	int qSm(int x) {int res=0;for(;x;x-=x&-x) res+=v[x];return res;} 
}BT[26];
int main()
{
	scanf("%d %s",&n,a+1);
	for(int i=1;i<=n;++i) BT[a[i]-'a'].upd(i,1);scanf("%d",&m);
	for(int i=1,op,l,r,x,res;i<=m;++i)
	{
		char c[2];scanf("%d",&op);
		if(op==1) scanf("%d %s",&x,c),BT[a[x]-'a'].upd(x,-1),BT[c[0]-'a'].upd(x,1),a[x]=c[0];
		if(op==2)
		{
			res=0;scanf("%d %d",&l,&r);
			for(int j=0;j<26;++j) if(BT[j].qSm(r)>BT[j].qSm(l-1)) ++res;printf("%d\n",res);
		}
	}return 0;
}

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


#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


int n;
vector<string> in;


string connect(string& a, string& b){
  for(int i=max(a.size(),b.size());i>=1;i--){
    bool ok = true;
    for(int j=0;j<i;j++){
      if(a[a.size()-i+j]!=b[j])ok=false;
    }
    if(ok)return a+b.substr(i);
  }
  return a+b;
}


bool input(){
  cin>>n;
  if(n==0)return false;
  in.clear();
  rep(i,n){
    string a;
    cin>>a;
    in.push_back(a);
  }

  for(int i=0;i<in.size();i++){
    for(int j=0;j<in.size();j++){
      if(i==j)continue;
      if(in[j].find(in[i])!=-1){
	in.erase(in.begin()+i);
	i--;
	break;
      }
    }
  }

  //rep(i,in.size())cout<<in[i]<<endl;

  return true;
}


string small(string& a, string& b){
  if(a=="")return b;
  if(b=="")return a;
  if(a.size()==b.size())return min(a,b);
  if(a.size()<b.size())return a;
  return b;
}


const int N = 10;

string memo[N+1][(1<<N)];

string gbit(int n, int state){
  string s = "";
  rep(i,n){
    if((state&(1<<i))>0)s+="1";
    else s+="0";
  }
  reverse(s.begin(),s.end());
  return s;
}

string saiki(int pos, int state){
  if(memo[pos][state]!=""){
    return memo[pos][state];
  }

  string ans = "";
  for(int i=0;i<in.size();i++){
    if((state&(1<<i))==0){
      string s1 = saiki(i,state|(1<<i));
      string s2 = connect(s1, in[pos]);
      ans = small(ans,s2);
    }
  }

  if(ans=="")ans = in[pos];

  //cout<<pos<<" "<<gbit(in.size(),state)<<" "<<ans<<endl;


  return memo[pos][state]=ans;
}

string solve(){
  rep(i,N)rep(j,(1<<N))memo[i][j]="";

  string ans = "";
  for(int i=0;i<in.size();i++){
    string s = saiki(i,(1<<i));
    ans = small(ans, s);
  }
  return ans;
}


int main(){
  while(input())cout<<solve()<<endl;
}

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

using namespace std;

typedef long double ld;
typedef long long ll;

#define sz(x) (int)(x).size()
#define pb push_back
#define mp make_pair
#define f first
#define s second

template<typename T, typename U> bool ckmin(T &a, U b){ return b < a ? a = b, true : false; }
template<typename T, typename U> bool ckmax(T &a, U b){ return b > a ? a = b, true : false; }

const int INF = 1e8;

int mn = INF;
string s, t;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> s >> t;
    for(int i = 0; i < sz(s); ++i){
        if(i + sz(t) > sz(s)) break;
        int cur = 0;
        for(int j = i; j < i + sz(t); ++j){
            if(s[j] != t[j - i]) cur++;
        }
        ckmin(mn, cur);
    }
    cout << mn;
    return 0;
}

Measured memory_bytes: 3656
import numpy as np
N, K = (int(i) for i in input().split())  
h = np.array([int(i) for i in input().split()])
 
dp = np.empty(N, dtype='int')
 
for i in range(N):
  if i == 0:
    dp[i] = 0
  elif i - K < 0:
    dp[i] = np.min(np.abs(h[i] - h[:i]) + dp[:i])
  else:
    dp[i] = np.min(np.abs(h[i] - h[i-K:i]) + dp[i-K:i])
 
print(dp[N-1])

Measured memory_bytes: 23116
from collections import defaultdict
d = defaultdict(int)
N = int(input())
A = list(map(int, input().split()))
for a in A:
    d[a] += 1
s = sum(A)
Q = int(input())

for i in range(Q):
    b, c = map(int, input().split())
    b_cnt = d[b]
    d[b] = 0
    d[c] += b_cnt
    s += (c-b) * b_cnt
    print(s)


Measured memory_bytes: 24192
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

int main(){
  char c; cin >> c;
  ll a = c - 'a';
  // cout << a << endl;
  if(a >= 0) cout << "a" << endl;
  else cout << "A" << endl;


}


Measured memory_bytes: 3632
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

c = [inpl() for i in range(3)]

for a1 in range(101):
	b1 = c[0][0]-a1
	b2 = c[0][1]-a1
	b3 = c[0][2]-a1
	a2 = c[1][0]-b1
	a3 = c[2][0]-b1

	if c[1][1] != a2+b2: continue
	if c[1][2] != a2+b3: continue
	if c[2][1] != a3+b2: continue
	if c[2][2] != a3+b3: continue

	break
else:
	print('No')
	sys.exit()

print('Yes')


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

int main() {
  int n, k;
  cin >> n >> k;
  vector<ll> h(n);
  rep(i,n) cin >> h[i];
  sort(h.begin(), h.end());
  ll ans = 1e9+7;
  rep(i,n-k+1) {
    ll tmp = h[i+k-1] - h[i];
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3956
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws java.lang.Exception {
		Scanner scanner = new Scanner(System.in);
		int max = scanner.nextInt();
      	scanner.nextLine();
		String input = scanner.nextLine();
		String[] inputArray = input.split(" ");
		int minDiff = 10000;
		for(int i=1; i < max; i++){
			int s1 = 0;
			int s2 = 0;
			for(int j=0; j < max; j++){
				if (i > j){
					s1 += Integer.parseInt(inputArray[j]);
				}else{
					s2 += Integer.parseInt(inputArray[j]);
				}

			}
			int diff = s1 - s2;
			if(diff < 0){
				diff = diff * -1;
			}
			minDiff = Math.min(minDiff, diff);
		}

	    System.out.println(minDiff);
	    scanner.close();
	}
}


Measured memory_bytes: 24148
//“Make it work, make it right, make it fast.” – Kent Beck
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dd;
const int siz = 1e6 + 5;
const int MOD = 1e9 + 7;
#define endl '\n'
#define deb(x) cout << #x << " = " << x << endl;
const int N = 20;
const int inf = 1e9+5;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int n, m;
string b[N];
int bfs(int i, int j){
	queue<pair<int, int >>q;
	q.push(make_pair(i, j));
	int dist[N][N];
	memset(dist, inf, sizeof dist);
	dist[i][j] = 0;
	int maxi = 0;
	while(!q.empty()){
		auto t = q.front();
		q.pop();
		maxi = max(maxi, dist[t.first][t.second]);
		for(int ii = 0; ii < 4; ii++){
			int x = t.first + dx[ii], y = t.second + dy[ii];
			if(x < 0 || x >= n || y < 0 || y >= m || b[x][y] == '#')
				continue;
			if(dist[x][y] <= dist[t.first][t.second]+1) continue;
			dist[x][y] = dist[t.first][t.second]+1;
			q.emplace(x, y);
		}
	}
	
	return maxi;
}



void solve(){
	cin >> n >> m;
	for(int i = 0; i < n; i++){
			b[i].clear();
			cin >> b[i]; 
	}

	int maxi = 0;
	for(int i = 0;  i < n; i++){
		for(int j = 0; j < m; j++){
			if(b[i][j] == '.')
			maxi = max(maxi, bfs(i, j));
		}
		
	}
	cout << maxi << endl;
}

int main(){
	#ifndef RAY
		//freopen("input.txt", "r", stdin);
	#endif
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		int t = 1;
		//cin >> t;
		while(t--){
			solve();
		}
	return 0;
}
	


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>
#include <functional>
#include <chrono>
#include <cstring>
#include <limits.h>

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<lint> vl;
typedef pair<lint,lint> pll;

#define mpr make_pair


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

    lint n; cin>>n;
    vl a(3);
    for (lint i=0; i<3; ++i){
        cin>>a[i];
    }

    vector<string> ops(n);
    for (auto &s:ops) cin>>s;


    vi ans;
    for (int i=0; i<n; ++i){
        int x = ops[i][0]-'A';
        int y = ops[i][1]-'A';
        if (a[x] >= a[y]){
            if (a[x] == a[y] && a[x] == 1 && i<n-1){
                int nx = ops[i+1][0]-'A';
                int ny = ops[i+1][1]-'A';
                if (x == nx || x== ny){
                    ans.push_back(x);
                    a[x]++;
                    a[y]--;
                    continue;
                }

            }
            ans.push_back(y);
            a[x]--;
            a[y]++;
        }else{
            ans.push_back(x);
            a[x]++;
            a[y]--;
        }

        if (a[x]<0 || a[y]<0){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes\n";
    for (int i=0; i<n; ++i){
        cout<<(char)(ans[i] + 'A')<<"\n";
    }


}


Measured memory_bytes: 7024
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using lint = long long;
int main() {
	string N;
	cin >> N;
	cou((N == "AAA" || N == "BBB" ? "No" : "Yes"));
	rep(i, 1000) {
		rep(j, 1000) {
			rep(k, 135) {
				N = "処理";
			}
		}
	}
}

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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int n, c;
  cin >> n >> c;
  vint a(c), b(c), d(c), o(c);
  vector<char> s(c);
  vint vec;
  rep(i, c) {
    string cons;
    cin >> cons;
    if(cons.find("<=") != string::npos) {
      sscanf(cons.c_str(), "%lld<=%lld%c%lld", &a[i], &b[i], &s[i], &d[i]);
      --a[i], --b[i]; o[i] = 0;
    } else if(cons.find(">=") != string::npos) {
      sscanf(cons.c_str(), "%lld>=%lld%c%lld", &a[i], &b[i], &s[i], &d[i]);
      --a[i], --b[i]; o[i] = 1;
    } else {
      sscanf(cons.c_str(), "%lld*%lld%c%lld", &a[i], &b[i], &s[i], &d[i]);
      --a[i], --b[i]; o[i] = -1;
      vec.push_back(i);
    }
  }
  int sz = vec.size();
  auto bellman_ford = [&]() -> int {
    vector<Tapris> es;
    reps(i, 1, n) es.emplace_back(i, 0, 0);
    rep(i, c) {
      if(o[i]) swap(a[i], b[i]);
      es.emplace_back(b[i], a[i], 0);
      if(s[i] == '+') es.emplace_back(b[i], a[i], -d[i]);
      else es.emplace_back(a[i], b[i], d[i]);
      if(o[i]) swap(a[i], b[i]);
    }
    vint mincost(n, inf);
    mincost[0] = 0;
    rep(i, n-1) {
      for(Tapris e : es) {
	int u, v, w;
	tie(u, v, w) = e;
	if(mincost[u] != inf && mincost[u]+w < mincost[v]) {
	  mincost[v] = mincost[u]+w;
	}
      }
    }
    for(Tapris e : es) {
      int u, v, w;
      tie(u, v, w) = e;
      if(mincost[u] != inf && mincost[u]+w < mincost[v]) {
	return -1;
      }
    }
    return *max_element(all(mincost));
  };
  int ans = -inf;
  rep(bit, 1<<sz) {
    rep(i, sz) o[vec[i]] = (bit>>i)&1;
    chmax(ans, bellman_ford());
  }
  if(ans >= inf) cout << "inf" << endl;
  else cout << ans << endl;

  return 0;
}



Measured memory_bytes: 3312
using System;
class p
{
  static void Main()
  {
    string[] input = Console.ReadLine().Split(' ');
    int[] arr = new int[] { int.Parse(input[0]), int.Parse(input[1]), int.Parse(input[2]) };
    Array.Sort(arr);
    Console.WriteLine(arr[0] + arr[1] == arr[2] ? "Yes" : "No");
  }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second
// 多倍長
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using boost::rational;
using boost::multiprecision::cpp_int;

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

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

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;


vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (char ch: s) {
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        }
        else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}


vector<vector<ll>> g;

int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    ll n, m;
    cin >> n >> m;
    g.resize(n);
    vector<ll> ans(n);
    rep(i, m){
        ll a,b;
        cin >> a >> b;
        --a, --b;
        g[a].pb(b);
        g[b].pb(a);
    }
    queue<ll> q;
    q.push(0);
    ans[0] = -1;
    while(!q.empty()){
        ll now = q.front();
        q.pop();
        for(auto next : g[now]){
            if(ans[next]) continue;
            ans[next] = now + 1;
            q.push(next);
        }
    }
    print("Yes");
    REP(i, 1, n) print(ans[i]);


}



Measured memory_bytes: 12928