akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
using namespace std;

vector<vector<int>> v(250010);
int main() {
	int H, W; cin >> H >> W;
	int a[510][510];
	for(int i=0; i<H; ++i){
	    for(int j=0; j<W; ++j) cin >> a[i][j];
	}
	int N=0;
	for(int i=0; i<H; ++i){
	    for(int j=W-1; j>0; --j){
	        if(a[i][j]%2){
	            v[N]={i+1, j+1, i+1, j};
	            ++a[i][j-1];
	            ++N;
	        }
	    }
	}
	for(int i=0; i<H-1; ++i){
	    if(a[i][0]%2){
	        v[N]={i+1, 1, i+2, 1};
	        ++a[i+1][0];
	        ++N;
	    }
	}
	cout << N << endl;
	for(int i=0; i<N; ++i){
	    cout << v[i][0];
	    for(int j=1; j<4; ++j) cout << ' ' << v[i][j];
	    cout << endl;
	}
	return 0;
}


Measured memory_bytes: 12928
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;

vector<int> v[100010];
int n;
int h=0;

int dfs(int x){

  int ma=0;
  vector<int> d;
  for(int i=0;i<v[x].size();i++){
    int tmp=dfs(v[x][i]);
    d.push_back(tmp);
  }
  sort(d.begin(),d.end());
  reverse(d.begin(),d.end());
  for(int i=0;i<d.size();i++){
    ma=max(ma,d[i]+i+1);
  }
  //cout<<x<<" "<<ma<<endl;
  return ma;
}

int main(){
  //int n;
  cin>>n;
  //vector<int> v[n+1];

  for(int i=2;i<=n;i++){
    int a;
    cin>>a;
    v[a].push_back(i);
  }

  cout<<dfs(1)<<endl;
  return 0;
}


Measured memory_bytes: 13568
fun main(args: Array<String>) {
    val N = nextInt()
    val A = listOfInt()
    val map = mutableMapOf<Int, Long>()
    A.forEach { a ->
        val c = map.getOrElse(a, { 0 })
        map[a] = c + 1
    }
    var total = 0L
    for ((v, c) in map) {
        total += c * (c - 1) / 2
    }
    val ans = LongArray(N)
    A.forEachIndexed { index, a ->
        val c = map.getOrElse(a, { 0 })
        var t = c * (c - 1) / 2 - (c - 1) * (c - 2) / 2
        ans[index] = total - t
    }
    println(ans.joinToString("\n"))
}

fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun nextInt(offset: Int = 0) = nextInt() + offset
fun nextLong() = java.lang.Long.parseLong(next())
fun nextLong(offset: Long = 0L) = nextLong() + offset
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
fun listOfInt(offset: Int = 0) = listOfString().map { Integer.parseInt(it) + offset }
fun listOfLong() = listOfString().map { java.lang.Long.parseLong(it) }
fun listOfLong(offset: Long = 0L) = listOfString().map { java.lang.Long.parseLong(it) + offset }
fun listOfDouble() = listOfString().map { it.toDouble() }


Measured memory_bytes: 110480
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<ll, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
ll a[100100];
ll res[100100];

void solve() {
    priority_queue<P> que;
    for (int i = 0; i < n; i++) {
        que.push(P(a[i], i));
    }
    P p = que.top(); que.pop();
    int num = 1, idx = p.second;
    ll v = p.first;
    do {
        while (!que.empty() && que.top().first == v) {
            idx = min(idx, que.top().second);
            que.pop();
            num++;
        }
        ll nv = (que.empty() ? 0LL : que.top().first);
        res[idx] += (v - nv) * num;
        v = nv;
    } while (!que.empty());
    
    for (int i = 0; i < n; i++) {
        cout << res[i] << endl;
    }
}

void input() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
}

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

    input();
    solve();
}


Measured memory_bytes: 4336
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int, int>> vpii;
typedef pair<int, int> pii;
#define PB push_back
#define EB emplace_back
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define N 112345
vector<int> g[N*3];
priority_queue<pii, vector<pii>, greater<pii>> que;
bool u[N*3]={};
int d[N*3]={};

int main(){
	int n, m; scanf("%d%d", &n, &m);
	REP(i, m){
		int a, b; scanf("%d%d", &a, &b);
		REP(ii, 1){
			REP(j, 3){
				int k = (j+1)%3;
				g[a + N*j].EB( b + N*k );
			}
			swap(a, b);
		}
	}
	fill(d, d+N*3, -3);
	int s, t; scanf("%d%d", &s, &t);
	que.emplace(0, s);
	while(que.size()){
		pii tp = que.top(); que.pop();
		int i = tp.second;
		if(u[i]) continue;
		d[i] = tp.first;
		u[i] = true;
		DEBUG("%d[%d], %d\n", (i-1)%N+1, (i-1)/N, d[i]);
		for(int &e : g[i]){
			que.emplace(d[i]+1, e);
		}
	}
	// int ans = d[t];
	printf("%d\n", d[t]/3);
}


Measured memory_bytes: 19200
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<bool> vb;

int main() {
  char n;
  cin >> n;
  cout << (char)(n + 1) << endl;
}

Measured memory_bytes: 256
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define in(x1) cin >> x1
#define in2(x1, x2) cin >> x1 >> x2
#define in3(x1, x2, x3) cin >> x1 >> x2 >> x3
#define inN(x, N) rep(i, N) in(x[i])
#define outl(x) cout << x << endl
#define out2l(x, y) cout << x << " " << y << endl 

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    ll K;
    in(K);

    ll tmp = 0;

    reps(i, 1, 1000000)
    {
        tmp *= 10;
        tmp += 7;
        tmp %= K;

        if (tmp == 0)
        {
            outl(i);
            return 0;
        }
    }

    outl(-1);
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define PI 3.1415926535
#define EPS (1e-10)

int main()
{
    string s;
    cin >> s;
    if(s[2] == s[3]){
        if(s[4] == s[5]){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
R,C,*T = list(map(int, open(0).read().split()))
r = [0] * C
for i in range(0, len(T), C):
    for j in range(C):
        print(T[i+j], end="")
        print(" ", end="")
        r[j] += T[i+j]
    print(sum(T[i:i+C]))
r.append(sum(r))
print(" ".join(map(str, r)))


Measured memory_bytes: 6668
N=int(input())

A=list(map(int,input().split()))

def ea(a,b):
    s=0
    while True:
        c=a%b
        if c==0:
            break
        a=b
        b=c
        
    return b

for i in range(N-1):
    A[i+1]=ea(A[i],A[i+1])

print(A[N-1])
        


Measured memory_bytes: 15020
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define ALL(v) v.begin(), v.end()
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define chmax(x, a) x = max(x, a)
#define chmin(x, a) x = min(x, a)

int main() {
    int N; cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    sort(ALL(A));
    ll ans = A[N-1];
    int cnt = 1;
    int i = N-2;
    while (i >= 0 && cnt < N-1) {
        ans += A[i];
        cnt++;
        if (cnt >= N-1) break;
        ans += A[i];
        cnt++;
        i--;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4836
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

if sum(A) < sum(B):
    print(-1)
    exit(0)

C = [A[i] - B[i] for i in range(N)]

has_shortage = False

for i in range(N):
    if C[i] < 0:
        has_shortage = True
        break

if has_shortage is False:
    print(0)
    exit(0)

C = sorted(C, reverse=True)
i = 0
j = N-1
ans = 2
while C[j] < 0:
    if -C[j] > C[i]:
        C[j] += C[i]
        C[i] = 0
        i += 1
        ans += 1
        continue
    else:
        C[i] += C[j]
        # C[j] = 0
        j -= 1
        ans += 1
        continue

ans -= 1
print(ans)


Measured memory_bytes: 19068
#include<stdio.h>
#include<string.h>

int main(void){
  int a,b,i;
  char s[200001];
  scanf("%s",s);
  for(i=0;s[i]!='A';i++);
  a=i;
  for(i=strlen(s)-1;s[i]!='Z';i--);
  b=i;
  printf("%d\n",b-a+1);
  return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define MAX_V 100000
#define INF 1<<29
using namespace std;
struct edge{int to,cap,rev;};
vector<edge>G[MAX_V];
int level[MAX_V];
int iter[MAX_V];
void add_edge(int from,int to,int cap){
  G[from].push_back((edge){to,cap,(int)G[to].size()});
  G[to].push_back((edge){from,0,(int)G[from].size()-1});
}
void bfs(int s){
  memset(level,-1,sizeof(level));
  queue<int>q;
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int v=q.front();q.pop();
    for(int i=0;i<(int)(G[v].size());i++){
      edge &e=G[v][i];
      if(e.cap>0&&level[e.to]<0){
        level[e.to]=level[v]+1;
        q.push(e.to);
      }
    }
  }
}
int dfs(int v,int t,int f){
  if(v==t)return f;
  for(int &i=iter[v];i<(int)(G[v].size());i++){
    edge &e=G[v][i];
    if(e.cap>0&&level[v]<level[e.to]){
      int d=dfs(e.to,t,min(f,e.cap));
      if(d>0){
        e.cap-=d;
        G[e.to][e.rev].cap+=d;
        return d;
      }
    }
  }
  return 0;
}
int max_flow(int s,int t){
  int flow=0;
  while(1){
    bfs(s);
    if(level[t]<0)return flow;
    memset(iter,0,sizeof(iter));
    int f;
    while((f=dfs(s,t,INF))>0){
      flow+=f;
    }
  }
}
int main(){
  int x,y,m;
  cin>>x>>y>>m;
  while(m--){
    int a,b;
    cin>>a>>b;
    add_edge(a+1,b+x+1,1);
  }
  for(int i=0;i<x;i++){
  	add_edge(0,i+1,1);
  }
  for(int i=0;i<y;i++){
  	add_edge(x+i+1,x+y+1,1);
  }
  cout<<max_flow(0,x+y+1)<<endl;
}


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

int main() {
    string s;
    cin>>s;
    if (s[0]==s[1] && s[1]!=s[2]&&s[2]==s[3]) printf("Yes\n");
    else if(s[0]==s[2]&&s[2]!=s[1]&&s[1]==s[3]) printf("Yes\n");
    else if(s[0]==s[3]&&s[3]!=s[1]&&s[1]==s[2]) printf("Yes\n");
    else printf("No\n");
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int i, a, n, ans=0;
  scanf("%d", &n);
  
  for(i=1; i<=n; i++){
    scanf("%d", &a);
    if(a != i) {
      ans++;
      if(ans > 2){
        printf("NO");
        return 0;
    }
  }
  }
  printf("YES");
  return 0;
}

Measured memory_bytes: 128
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (X, Y) = (input[2], input[3])
let maxX = readIntSplit(by: " ").sorted().reversed()[0]
let minY = readIntSplit(by: " ").sorted()[0]
for Z in X+1...Y {
    if maxX < Z && minY >= Z {
        print("No War")
        break
    }
    if Z == Y {
        print("War")
    }
}


Measured memory_bytes: 7400
#include <bits/stdc++.h>
using namespace std;
int main()
{
	char c;
  	cin>>c;
  	if(c=='A') cout<<"T"<<endl;
  	else if(c=='T') cout<<"A"<<endl;
  	else if(c=='G') cout<<"C"<<endl;
  	else cout<<"G"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b){if(a < b){ a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b){if(a > b){ a = b; return 1;} return 0;}

const int INF = 100000; 

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

    cout << max((n-1) * (m-1), 0) << endl;
    
    return 0;
}


Measured memory_bytes: 256
/*
Author : N_o_o_B
Created : December 28 2019 17:33:32 
*/
#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;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
//typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define trav(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;

    ll n,a,b;
    cin >> n >> a >> b;
    if((b-a)%2==0){
        cout << (b-a)/2 << endl;
        return 0;
    }
    ll ans = INF;
    ans = min(ans, a - 1 + (b - (a-1))/2);
    ans = min(ans, n - b + (n - (a + (n-b)) + 1)/2);
    cout << ans << endl;
    time_taken();
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
  char S[10],T[10],U[10];
  int A,B;
  scanf("%s%s",&S,&T);
  scanf("%d%d",&A,&B);
  scanf("%s",&U);
  if(strcmp(S,U)==0)
  {
    printf("%d %d",A-1,B);
  }
  if(strcmp(T,U)==0)
  {
    printf("%d %d",A,B-1);
  }
}


Measured memory_bytes: 128
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<String> one = nextStrArray();
		String s1 = one.get(0);
		String s2 = one.get(1);
		String s3 = one.get(2);
		myout(s1.substring(0, 1).toUpperCase() + s2.substring(0, 1).toUpperCase() + s3.substring(0, 1).toUpperCase());
	}
	//Method addition frame start



	//Method addition frame end
}


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

namespace AtCoder.Abc
{
    class QuestionC
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var n = int.Parse(Console.ReadLine());
            int[] cc = new int[10000+1];
            cnt(cc);
            for (int i = 1; i <= n; i++)
            {
                Console.WriteLine(cc[i]);
            }

            // 10000 1+1+z*z+1+z+z
            Console.Out.Flush();
        }

        public static int calc(int x, int y, int z)
        {
            return (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (x * z);
        }

        public static void cnt(int[] cc)
        {
            int m = 100;
            for (int x = 1; x < m; x++)
            {
                for (int y = 1; y < m; y++)
                {
                    for (int z = 1; z < m; z++)
                    {
                        var d = calc(x, y, z);
                        if (d<=10000)
                        {
                            cc[d]++;
                        }
                    }
                }
            }
        }
    }
}


Measured memory_bytes: 27368
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <bitset>

#define PB push_back
#define MP make_pair
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define INF (1<<30)
#define LLINF (1<<60)
#define MOD 1000000007
#define REP(i, n) for(int i=0;i<n;i++)
using ll = long long;
using namespace std;

int main() {
    int n, a[100005], MAX=0, MAXpos, ans;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (MAX < a[i]) {
            MAX = a[i];
            MAXpos = i;
        }
    }
    if (MAX % 2 == 0) {
        int center = MAX / 2, diff = INF;
        for (int i = 0; i < n; i++) {
            if (i != MAXpos) {
                if (abs(center - a[i]) < diff) {
                    ans = a[i];
                    diff = abs(center - a[i]);
                }
            }
        }
    }
    else {
        int centerleft = MAX / 2, centerright = MAX / 2 + 1, diff = INF;
        for (int i = 0; i < n; i++) {
            if (i != MAXpos) {
                if (abs(centerleft - a[i]) < diff || abs(centerright - a[i]) < diff) {
                    ans = a[i];
                    diff = min(abs(centerleft - a[i]), abs(centerright - a[i]));
                }
            }
        }
    }
    cout << MAX << ' ' << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#include <stdio.h>
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFINITY 100000000

int n, M[MAX][MAX];

void dijkstra(){
  int i, u, v;
  int minv;
  int d[MAX], color[MAX];

  for(i = 0; i < n; i++){
    d[i] = INFINITY;
    color[i] = WHITE;
  }

  d[0] = 0;
  color[0] = 0;
  while(1){
    minv = INFINITY;
    u = -1;
    for(i = 0; i < n; i++){
      if(minv > d[i] && color[i] != BLACK){
	u = i;
	minv = d[i];
      }
    }
    if(u == -1) break;
    color[u] = BLACK;
    for(v = 0; v < n; v++){
      if(color[v] != BLACK && M[u][v] != INFINITY){
	if(d[v] > d[u] + M[u][v]){
	  d[v] = d[u] + M[u][v];
	  color[v] = GRAY;
	}
      }
    }
  }

  for(i = 0; i < n; i++){
    printf("%d %d\n", i, (d[i] == INFINITY ? -1 : d[i]));
  }
    
}

int main(){
  int i, j, k, c, u, v;
  
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
      M[i][j] = INFINITY;
    }
  }
  for(i = 0; i < n; i++){
    scanf("%d %d", &u, &k);
    for(j = 0; j < k; j++){
      scanf("%d %d", &v, &c);
      M[u][v] = c;
    }
  }

  dijkstra();
  
  return 0;
}



Measured memory_bytes: 2108
#include <iostream>
using namespace std;
int main() {
  int n, a, b = 0x40000000, ans = 0;
  cin >> n;
  for (int i = n; i--; ) {
    cin >> a;
    a &= -a;
    b = a < b ? a : b;
  }
  for (;b;b>>=1,ans++);
  cout << ans-1 << endl;
}

Measured memory_bytes: 256
use std::io::Read;
use std::cmp::{min, max};

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

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

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let k: usize = iterator.next().unwrap().parse().unwrap();
    let mut a: Vec<isize> = (0..n).map(|_| iterator.next().unwrap().parse().unwrap()).collect();

    for _ in 0..min(k, 50) {
        let mut b: Vec<isize> = vec![0; n];
        for i in 0..n {
            let l: isize = max(0, i as isize - a[i] as isize);
            let r: isize = min(n as isize - 1, i as isize + a[i] as isize);
            b[l as usize] += 1;
            if r + 1 < n as isize {
                b[r as usize + 1] -= 1;
            }
        }
        for i in 1..n {
            b[i] += b[i - 1];
        }
        a = b.clone();
    }

    let mut result = String::new();
    for i in 0..n {
        result.push_str(&format!("{} ", a[i]));
    }
    return result.trim().to_string();
}


Measured memory_bytes: 9356
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

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

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end
int P[100000];
int Y[100000];
vector<int> yd[100001];

int main() {
    unsigned int N,M;

    cin >> N >>M;

    rep(i,M){
        cin >> P[i] >>Y[i];
        yd[P[i]].push_back(Y[i]);
    }

    rep(i,N){
        sort(yd[i+1].begin(), yd[i+1].end());
    }

    rep(i,M){
        auto sentou=yd[P[i]].begin();
        auto saigo=yd[P[i]].end();
        printf("%012lld\n", ll(P[i])*1000000
        +int(lower_bound(sentou, saigo, Y[i])-sentou+1));
    }
    return 0;
}



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

int abs(int x){return x>0?x:(-x);}
int min(int a,int b){return a>b?b:a;}

int main(void){
	int H, W;
	int mi;
	int A[30][30];
	
	cin >> H >> W;
	for(int i = 0; i < H; i++){
	    for(int j = 0; j < W; j++){
	        cin >> A[i][j]; 
	    }
	}

    mi = (1 << 30);
	for(int i = 0; i < H; i++){
	    for(int j = 0; j < W; j++){
	        int sum = 0;
	        for(int l = 0; l < H; l++){
	            for(int m = 0; m < W; m++){
	                sum += min(abs(l-i), abs(m - j)) * A[l][m];
	            }
	        }
	        mi = min(mi, sum);
	    }
	}
	cout << mi << endl;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[5][5],b[50],c[5][5]={};
	for(int i=0;i<3;i++){
		for(int j=0;j<3;j++){
			cin>>a[i][j];
		}
	}
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>b[i];
		for(int k=0;k<3;k++){
			for(int j=0;j<3;j++){
				if(b[i]==a[k][j]){
					c[k][j]=1;
				}
			}
		}
	}
	for(int i=0;i<3;i++){
		for(int j=0;j<3;j++){
			if(c[0][j]==1 && c[1][j]==1 && c[2][j]==1){
				cout<<"Yes"<<endl;
				return(0);
			}
			if(c[i][0]==1 && c[i][1]==1 && c[i][2]==1){
				cout<<"Yes"<<endl;
				return(0);
			}
			if(c[0][2]==1 && c[1][1]==1 && c[2][0]==1){
				cout<<"Yes"<<endl;
				return(0);
			}
			if(c[1][1]==1 && c[0][0]==1 && c[2][2]==1){
				cout<<"Yes"<<endl;
				return(0);
			}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using pii=pair<int,int>;
using ll=long long;

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); 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; }

int main() {

	int k,n;
	cin >> k >> n;
	vector<int> a(n);
	rep(i,n) cin >> a[i];
	ll mini = 1e9;
	ll temp;
	rep(i,n) {
		if(i == 0) {
			temp = max(a[1]-a[0], k-a[n-1]+a[0]);
		}
		else if (i == n-1) {
			temp = max(a[n-1]-a[n-2], k-a[n-1]+a[0]);
		}
		else {
			temp = max(a[i] - a[i-1], a[i+1] - a[i]);
		}
		chmin(mini, k - temp);
	}
	cout << mini << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;

int group[114514];
int groupnum[114514];
vector<int> R[114514];

void DFS(int e,int g) {
  group[e] = g;
  for (int i = 0; i < R[e].size(); i++) {
    if (group[R[e][i]] == -1) {
      group[R[e][i]] = g;
      groupnum[g]++;
      DFS(R[e][i],g);
    }
  }
  return ;
} 

int main() {
  int N,M,K;
  cin >> N >> M >> K;
  for (int i = 0; i < N; i++) {
    group[i] = -1;
    groupnum[i] = 1;
  }
  vector<int> Rblock[N];
  for (int i = 0; i < M; i++) {
    int a,b;
    cin >> a >> b;
    a--; b--;
    R[a].push_back(b);
    R[b].push_back(a);
  }
  for (int i = 0; i < K; i++) {
    int c,d;
    cin >> c >> d;
    c--; d--;
    Rblock[c].push_back(d);
    Rblock[d].push_back(c);
  }
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (group[i] == -1) {
      DFS(i,cnt);
      cnt++;
    }
  }

  for (int i = 0; i < N; i++) {
    int res = groupnum[group[i]];
    res -= R[i].size();
    res -= 1;
    for (int j = 0; j < Rblock[i].size(); j++) {
      if (group[i] == group[Rblock[i][j]]) {
        res--;
      }
    }
    cout << res << " ";
  }
  return 0;
}

Measured memory_bytes: 13312
let lines = require("fs").readFileSync("/dev/stdin","utf-8").trim().split("\n");
const args = lines.shift().split(" ").map(Number);
const n = args[0];
const q = args[1];
let processes = [];
for(let line of lines){
    let process = line.split(" ");
    process[1] = parseInt(process[1]);
    processes.push(process);
}
let time = 0;
while(processes.length!==0){
    let process = processes.shift();
    process[1] -= q;
    if(process[1]<=0){
        time+=q+process[1];
        console.log(process[0]+" "+time);
    }else{
        time+=q;
        processes.push(process);
    }
}


Measured memory_bytes: 65672
fun main(args: Array<String>) = yorukatsu8b()

fun yorukatsu8b() {
    val (n, k) = readLine()!!.split(' ').map { it.toInt() }

    var answer = 1

    for (i in 0 until n) answer *= if (i == 0) k else k - 1

    println(answer)
}



Measured memory_bytes: 38088
#include<bits/stdc++.h>
#define ll long long

using namespace std;
const ll inf = 1e18;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  ll s = 1;
  ll a[n];
  for(int i = 0; i < n; ++i){
    cin >> a[i];
    if(a[i] == 0){
      cout<<0;
      return 0;
    }
  }
  for(ll x : a){
    if(inf/x < s){
      cout<<-1;
      return 0;
    }
    s*=x;
  }
  cout<<s;
    
}


Measured memory_bytes: 4436
import pprint
s = input()
t = input()
candidate = []
for i in range(len(s) - len(t) + 1):
    can = True
    for j in range(len(t)):
        if s[i + j] == "?" or s[i + j] == t[j]:
            continue
        else:
            can = False
            break
    if can:
        res = []
        for j in range(i):
            if s[j] == "?":
                res.append("a")
            else:
                res.append(s[j])
        for j in range(len(t)):
            res.append(t[j])
        for j in range(len(s) - len(t) - i):
            if s[j + len(t) + i] == "?":
                res.append("a")
            else:
                res.append(s[j + len(t) + i])
        candidate.append("".join(res))

if len(candidate) != 0:
    candidate.sort()
    #pprint.pprint(candidate)
    print(candidate[0])

else:
    print("UNRESTORABLE")


Measured memory_bytes: 3572
import sys
from collections import defaultdict
sys.setrecursionlimit(200000)
input = sys.stdin.readline

N,  = map(int, input().split())
A = list(input().strip())
B = list(input().strip())

for i in range(N):
    f = True
    t = A[i:i+N]
    for j in range(len(t)):
        if t[j] != B[j]:
            f = False
            break

    if f:
        print(N + i)
        exit()

print(N * 2)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,n) for (int i = 0; i < (n); ++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; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin >> n;
    vector<vector<int>> a(2,vector<int>(n)),b(2,vector<int>(n));
    rep(i,2){
        rep(j,n){
            cin >> a[i][j];
        }
    }
    b[0][0]=a[0][0];
    rep(i,2){
        rep(j,n){
            if(i==0){
                chmax(b[i+1][j],b[i][j]+a[i+1][j]);
            }
            if(j!=n-1){
                chmax(b[i][j+1],b[i][j]+a[i][j+1]);
            }
        }
    }
    cout << b[1][n-1] << endl;
}

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

#define ll long long int
#define vi vector<int>
#define ii pair< int , int >
#define vii vector<ii>
#define FOR(i, n) for(ll i = 0; i < (ll)n; i++)
int MAX(int a, int b){return (a > b) ? a:b;}
int MIN(int a, int b){return (a < b) ? a:b;}
int ABS(int x){return (x > 0) ? x:-x;}
int left(int x){return (x<<1);}
int right(int x){return (x<<1)+1;}
int lsone(int x){return (x&(-x));}

const int INF = 1e9 + 9, maxVal = 1e5+5;
const int maxn = 105;

int n, maxW, w[maxn], v[maxn];
int ans[maxn][maxVal];
bool found[maxn][maxVal];

int dp(int pos, int val){
	if(val < 0) return INF;
	if(pos == n){
		if(val == 0) return 0;
		else return INF;
	}
	if(found[pos][val]) return ans[pos][val];
	found[pos][val] = true;
	ans[pos][val] = min(dp(pos+1, val), dp(pos+1, val-v[pos])+w[pos]);
	return ans[pos][val];
}

int main(){
	scanf("%d %d", &n, &maxW);
	for(int i = 0; i < n; i++){
		scanf("%d %d", &w[i], &v[i]);
	}
	int finalAns = 0;
	for(int i = 0; i < maxVal; i++){
		if(dp(0, i) <= maxW){
			finalAns = i;
		}
	}
	printf("%d\n", finalAns);
}

Measured memory_bytes: 51456
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define F first
#define S second
#define INF ll(1e18)
#define MOD 998244353
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

#define MAXN 100005

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	ll h1,m1,h2,m2,k; cin>>h1>>m1>>h2>>m2>>k;
	
	ll cnt=0;
	while(h1!=h2 || m1!=m2){
		cnt++;
		m1++;
		if(m1==60){
			m1=0;
			h1=(h1+1)%24;
		}
	}
	
	cout<<cnt-k<<'\n';
	
	return 0;
}


Measured memory_bytes: 3612
N, M, K = map(int, input().split())

mod = 998244353

ans = 0

facts = [1 for i in range(N+1)]
invs = [1 for i in range(N+1)]

def inv(x):
    return pow(x, mod-2, mod)

for i in range(1, N+1):
    facts[i] = facts[i-1] * i % mod
    invs[i] = inv(facts[i])

def comb(n, r):
    return facts[n] * invs[r] * invs[n-r] % mod

for i in range(K+1):
    d = M * pow(M-1, N-i-1, mod) * comb(N-1, i)
    ans = (ans + d % mod) % mod

print(ans)


Measured memory_bytes: 24508
"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const s = spi[0];
    if (s[2] === s[3] && s[4] === s[5])
        console.log("Yes");
    else
        console.log("No");
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 30572
from collections import Counter
from itertools import product
N, C = map(int, input().split())
D = [None]
for _ in range(C):
    D.append([None] + list(map(int, input().split())))
c3 = [Counter() for _ in range(3)]
for i in range(N):
    c = list(map(int, input().split()))
    for j in range(3):
        c3[j].update(c[(j-i)%3::3])
dis3 = [[] for _ in range(3)]
for c, i in product(range(1, C + 1), range(3)):
    dis = 0
    for c0, cnt in c3[i].items():
        dis += D[c0][c] * cnt
    dis3[i].append(dis)
ans = 10 ** 9
for c0, c1 in product(range(C), repeat=2):
    if c0 == c1:
        continue
    tmp = dis3[0][c0] + dis3[1][c1]
    tmp += min(dis3[2][c2] for c2 in range(C) if c2 not in (c0, c1))
    if tmp < ans:
        ans = tmp

print(ans)


Measured memory_bytes: 3436
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<random>
#include<set>
#include<queue>

using namespace std;

long long dp[3][100100] = {};
const long long INF = 1LL << 60;
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define dump(a) cout << a << endl; 

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

/**
* @fn
* 最大値を取ります.Vector<int>を渡すこと.
*/
long long int imax(vector<int> a) {
	int MAX = -10000000;
	for (int i = 0; i < a.size(); i++) {
		if (MAX < a.at(i)) MAX = a.at(i);
	}
	return MAX;
}

/**
* @fn
* 最小値を取ります.Vector<int>を渡すこと.
*/
long long int imin(vector<int> a) {
	int MIN = 1000000000;
	for (int i = 0; i < a.size(); i++) {
		if (MIN > a.at(i)) MIN = a.at(i);
	}
	return MIN;
}

/**
* @fn
* 自然数について、桁数を求める
*/
Int getDigit(Int num) {
	return (Int)(log10(num)) + 1;
}


int get2Digit(Int num) {
	int cnt = 0;
	while (num > 0) {
		if (num % 2 != 0) {
			return cnt;
		}
		cnt++;
		num /= 2;
	}
}

long long int absmin(vector<int> a, long long int b) {
	int mini = 100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (mini > abs(a.at(i) - b)) {
			mini = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}


long long int absmax(vector<int> a, long long int b) {
	int max = -100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (max < abs(a.at(i) - b)) {
			max = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}

int gcd(int a, int b)
{
	if (a < b) swap(a, b);
	if (b < 1) return -1;
	if (a % b == 0) return b;
	return gcd(b, a % b);
}

void haerobatya(int start, int end, char level) {
	if (start > end) swap(start, end);
	for (int i = start; i <= end; i++) {
		if (i < 100) {
			cout << "https://atcoder.jp/contests/abc0" << i << "/tasks/abc0" << i << "_" << level << endl;
		}
		else {
			cout << "https://atcoder.jp/contests/abc" << i << "/tasks/abc" << i << "_" << level << endl;
		}
	}
}

long long int cntmod(long long int warareru, long long int mod) {
	long long int i = 0;
	for (i = 0; true; i++) {
		if (warareru % mod == 0 && warareru >= mod) {
			warareru /= mod;
		}
		else {
			return i;
		}
	}
}

void ansYes(bool a) {
	if (a == true) cout << "Yes" << endl;
	else cout << "No" << endl;
}

void ansYES(bool a) {
	if (a == true) cout << "YES" << endl;
	else cout << "NO" << endl;
}


Int euclidean_gcd(Int a, Int b) {
	while (true) {
		if (a < b) swap(a, b);
		if (!b) break;
		a %= b;
	}
	return a;
}

typedef pair<int, int> pai;


//ここまでライブラリ
//ここから本文
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	ansYes(a <= c && c <= b);
}

Measured memory_bytes: 256
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        String a = sc.next();

        if (Character.isUpperCase(a.charAt(0))) {
          System.out.println("A");
        } else {
          System.out.println("a");
        }        
    }
}

Measured memory_bytes: 35768
import sys
count = 1
while True:
    x, y = sys.stdin.readline().strip().split()
    if x == '0' and y == '0':
        break
    elif int(x) < int(y):
        print("%s %s" % (x, y))
    else:
        print("%s %s" % (y, x))
    count += 1

Measured memory_bytes: 7652
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;

long check(vector<long>* suu,long d){
  return 0;
}
int main(){
  long n,m,d,ii,jj;
  cin >> n >> m >> d;
  long num;
  long p=1;  
  if(d==0){
	num = n * (m-1);
  }
  else{

//	p = 1;
//	num = 0;
//	while(p <= n){
//	  num +=1;
//	  p += d;
//	  //cout << "num:" << num << "p:" << p << endl;
//	}
//	cout << "num:" << num << "p:" << p << endl;
	
	num = (n-d) * (m-1) * 2;
  }
  double numd = num;
  double ans ;
  //cout << "num:" << num << "p:" << p << endl;
  //cout << numd/(n*n) << endl;
  ans = numd/(n*n);
  printf("%0.10lf\n",ans);
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
set <vector<int>> st;
void printArr(int a[],int n) 
{ 
	vector<int>v;
    for (int i=0; i<n; i++) 
        v.push_back(a[i]);
    // printf("\n"); 
    st.insert(v);
}
void heapPermutation(int a[], int size, int n) 
{ 
    // if size becomes 1 then prints the obtained 
    // permutation 
    if (size == 1) 
    { 
        printArr(a, n); 
        return; 
    } 
  
    for (int i=0; i<size; i++) 
    { 
        heapPermutation(a,size-1,n); 
  
        // if size is odd, swap first and last 
        // element 
        if (size%2==1) 
            swap(a[0], a[size-1]); 
  
        // If size is even, swap ith and last 
        // element 
        else
            swap(a[i], a[size-1]); 
    } 
} 

int main()
{
	int n;
	cin>>n;
	int x;
	int a[n];
	std::vector<int> v1,v2;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		a[i]=i+1;
		v1.push_back(x);
	}
	heapPermutation(a,n,n);
	for(int i=0;i<n;i++)
	{
		cin>>x;
		v2.push_back(x);
	}
	int i=0,g,h,k;
	for(auto itr: st)
	{
		i++;
		if(itr==v1)
			g=i;
		if(itr==v2)
			h=i;
	}
	k=abs(g-h);
	cout<<k<<"\n";
}

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;


int main() {
    string s;
    cin >> s;
    if (s[0] != 'A') {
        cout << "WA" << endl;
        return 0;
    }
    int c = 0;
    FOR(i, 2, s.size() - 1) {
        if (s[i] == 'C') {
            c++;
        }
    }
    if (c != 1) {
        cout << "WA" << endl;
        return 0;
    }
    c = 0;
    REP(i, s.size()) {
        if (s[i] < 'a') {
            c++;
        }
    }
    if (c != 2) {
        cout << "WA" << endl;
    } else {
        cout << "AC" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn =2e5+10;
const int mod=1e9+7;
ll a[maxn];
ll suf[maxn];




int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(int i=n;i>=1;i--)
    {
        suf[i]=suf[i+1]+a[i];
        suf[i]%=mod;
    }
    ll ans=0;
    for(int i=1;i<=n;i++)
    {
        ll temp=a[i]*suf[i+1];
        temp%=mod;
        ans+=temp;
        ans%=mod;

    }
    cout<<ans<<'\n';





}


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

void fnInput(int &rnTrkSiz, vector<int> &rvnLod)
{
  int nLodSiz;
  cin >> nLodSiz >> rnTrkSiz;

  rvnLod.resize(nLodSiz);
  for (int i = 0; i < nLodSiz; i++)
    cin >> rvnLod[i];
}

int fnSimuAlloc(const vector<int> &cnrvnLod, int nTrkSiz, int nLimLod)
{
  int nCurLod;
  int nCntTrk = 0;

  for (int i = 0; i < cnrvnLod.size();    )
  {
    if (cnrvnLod[i] > nLimLod)  return 0;

    nCntTrk++;
    nCurLod = 0;
    while (i < cnrvnLod.size())
    {
      nCurLod += cnrvnLod[i];
      if (nCurLod > nLimLod)  break;

      i++;
    }
  }
  return (nCntTrk <= nTrkSiz);
}

void fnAlloc(const vector<int> &cnrvnLod, int nTrkSiz, int &rnMinLod)
{
  const int nMINLOD = 0;
  const int nMAXLOD = 1000000000;

  int nLow  = nMINLOD;
  int nHigh = nMAXLOD;
  rnMinLod  = nMAXLOD;

  while (nLow < nHigh)
  {
    int nLimLod = (nLow + nHigh) / 2;
    if (fnSimuAlloc(cnrvnLod, nTrkSiz, nLimLod))
    {
      rnMinLod = min(rnMinLod, nLimLod);
      nHigh = nLimLod;
    }
    else
      nLow = nLimLod + 1;
  }
}

void fnReSult(int nMinLod)
{
  cout << nMinLod << endl;
}

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

  int nTrkSiz, nMinLod = 0;
  vector<int> vnLod;

  fnInput(nTrkSiz, vnLod);
  fnAlloc(vnLod, nTrkSiz, nMinLod);
  fnReSult(nMinLod);

  return 0;
}

Measured memory_bytes: 3368
#include<bits/stdc++.h>
using namespace std;
const int N=3e5+5;
int n,a[N],b[N];
void work(){
	puts("No");
	exit(0);
}
void check(int l,int r){
	for(int i=l,ml=0,mr=0;i<=r;i++)
		if(a[i]<i){
			if(ml>a[i]||a[i]>r||a[i]<l)	work();
			ml=max(ml,a[i]);
		}
		else	if(a[i]>i){
			if(mr>a[i]||a[i]>r||a[i]<l)	work();
			mr=max(mr,a[i]);
		}
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)	scanf("%d",&a[i]),b[i]=a[i]==i;
	for(int i=2;i<n;i++)	if(!b[i-1]&&!b[i]&&!b[i+1])	work();
	for(int l=1;l<=n;l++)
		if(!b[l]){
			int r=l,now=1;
			while(r<=n&&b[r]^now)	++r,now^=1;
			check(l,--r),l=r;
		}
	puts("Yes");
	return 0;
}


Measured memory_bytes: 2560