akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;


//namespace _5_C

class Program
{
    static void Main(string[] args)
    {
        while (true)
        {
            //???????????????3????????????????????????????????????
            string readData = Console.ReadLine();

            //???????????¨??????????????????????????????H,W???????????????????????????
            string[] readDataValues = readData.Split(' ');
            int H = int.Parse(readDataValues[0]);
            int W = int.Parse(readDataValues[1]);

            //H,W??¨??????0?????´???????????????
            if (H == 0 && W == 0)
            {
                break;
            }

            for(int i = 1; i<=H; i++)
            {
                
                    for (int j = 1; j <= W; j++)
                    {
                    if (i % 2 == 1)
                    {
                        if (j % 2 == 1)
                        {
                            Console.Write("#");
                        }
                        else
                        {
                            Console.Write(".");
                        }
                    }
                    else
                    {
                        if (j % 2 == 1)
                        {
                            Console.Write(".");
                        }
                        else
                        {
                            Console.Write("#");
                        }
                    }
                
                }
                Console.WriteLine();
            }
            Console.WriteLine();

        }
        
    }
}

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def check(l, r):
    # 左だけ行く
    if r <= 0:
        return -l
    # 右だけ行く
    elif l >= 0:
        return r
    # 両方行く
    else:
        # 短い方を先に行って往復
        return min(-l, r) * 2 + max(-l, r)

N, K = MAP()
A = LIST()

ans = INF
for i in range(N):
    if i+K > N:
        break
    l = A[i]
    r = A[i+K-1]
    ans = min(ans, check(l, r))
print(ans)


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

int main() {
    string N;
    cin >> N;
    int n = N.size();

    vector<vector<int>> dp(n+1, vector<int>(2, 0));
    dp[0][1] = 1;

    for (int i = 0; i < n; i++)
    {
        int d = N[i] - '0';
        dp[i+1][0] = min(dp[i][0] + d, dp[i][1] + 10 - d);
        dp[i+1][1] = min(dp[i][0] + d + 1, dp[i][1] + 9 - d);
    }

    cout << dp[n][0] << endl;
}

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

void yakusuu(int num, vector<int> &kouho)
{
	for (int i = 1; i * i <= num; i++) {
		if (num % i == 0) {
			kouho.push_back(i);
			kouho.push_back(num / i);
		}
	}
}

int main()
{
	int64_t n;
	cin >> n;
	int64_t sum = 0;
	int64_t abs_min = 1000000001;
	int cnt_minus = 0;
	for (int i = 0; i < n; i++) {
		int64_t a_in;
		cin >> a_in;
		
		sum += abs(a_in);
		abs_min = min(abs_min, abs(a_in));
		if (a_in < 0) {
			cnt_minus++;
		}
	}

	int64_t ans;
	if (cnt_minus % 2 == 0) {
		ans = sum;
	} else {
		ans = sum - abs_min * 2;
	}

	cout << ans << endl;
}

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

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = LLONG_MAX;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

#define int long long

inline void my_io() {

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	cout << fixed << setprecision(16);

	//cout << setprecision(10) << scientific << ans << endl;
}

signed main() {
	ll r;

	cin >> r;

	cout << 3 * r * r << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;

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

  cout << min(c, b/a) << endl;

  return 0;
}



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

int main() {
  string s;
  cin >> s;
  string ans;
  if (s == "ABC") {
      ans = "ARC";
  } else if (s == "ARC") {
      ans = "ABC";
  } else {
      ans = "Error";
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define rep(i,n) REP(i, 0, n)
int sea[200][200], land[200][200], z[1000];
ll dp[1000][200];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M, R, x, y, t;
    char _c;
    while(cin >> N >> M && N){
        rep(i, N) rep(j, N)
          sea[i][j] = land[i][j] = i == j ? 0: INF;
        rep(i, M){
            cin >> x >> y >> t >> _c; --x; --y;
            if(_c == 'L')
              land[x][y] = land[y][x] = min(land[x][y], t);
            else
              sea[x][y] = sea[y][x] = min(sea[x][y], t);
        }
        cin >> R;
        rep(i, R){
            cin >> z[i];
            --z[i];
        }
        
        rep(k, N) rep(i, N) rep(j, N){
            sea[i][j] = min(sea[i][j], sea[i][k] + sea[k][j]);
            land[i][j] = min(land[i][j], land[i][k] + land[k][j]);
        }
        
        rep(i, 1000) rep(j, 200) dp[i][j] = INF;
        dp[0][z[0]] = 0;
        REP(i, 1, R) rep(j, N){
            dp[i][j] = min(dp[i][j], dp[i - 1][j] + (ll)land[z[i - 1]][z[i]]);
            rep(k, N)
              dp[i][k] = min(dp[i][k], dp[i - 1][j] + (ll)land[z[i - 1]][j] + (ll)sea[j][k] + (ll)land[k][z[i]]);
        }
        
        ll ans = INF;
        rep(i, N) ans = min(ans, dp[R - 1][i]);
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
#define ll long long int
#define db double
#define pb push_back
#define mpr make_pair
#define andl "\n"
#define f first
#define s second
#define mset(x,y) memset(x,y,sizeof(x))
#define fr(i,n) for(long long int i=0;i<n;i++)
#define trace(it,x) for(auto it = (x).begin(); it != (x).end(); it++)
#define mod 1000000007
#define fastio ios::sync_with_stdio (false); cin.tie (0); cout.tie (0);
#define runtime cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
using namespace std;
 
// convert number to string to_string(x);
// convert string to number stoi();
 
// ll mulmod(ll x,ll y)
// {
//     return ((x%mod)*(y%mod))%mod;
// }
 
// ll binpow(ll x, ll y)
// {
//     ll z = 1;
//     while(y > 0)
//     {
//         if(y % 2 == 1)
//             z = mulmod(z, x);
//         x = mulmod(x, x);
//         y /= 2;
//     }
//     return z;
// }
 
// ll ncr(ll n,ll r)
// {
//     return mulmod(fact[n],binpow(mulmod(fact[n-r],fact[r]),mod-2));
// }
 
// ll pwr(ll n,ll m)
// {
//   if(n==1 || m==0)
//     return 1;
 
//   ll x=pwr(n,m/2);
//   if(m%2==0)
//     return x*x;
//   else
//     return n*x*x;
// }
 
// ll pwr(ll n,ll m,ll b)
// {
//   if(n==1 || m==0)
//     return 1;
 
//   ll x=pwr(n,m/2,b);
//   if(m%2==0)
//     return ((x%b)*(x%b))%b;
//   else
//     return ((n%b)*(((x%b)*(x%b))%b))%b;
// }
 
void solve()
{
  return ;
}
 
int main()
{
  fastio
  
  ll n,x,y;
  cin >> n;
  
  ll mnp=1e10,mxp=-1e10,mnn=1e10,mxn=-1e10;
  fr(i,n)
  {
  	cin >> x >> y;
  	mnp=min(mnp,x+y);
  	mxp=max(mxp,x+y);
  	mnn=min(mnn,x-y);
  	mxn=max(mxn,x-y);
  }
  cout << max(mxp-mnp,mxn-mnn);
 
  runtime
}

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

int main() {
    int64_t N,M;
    cin >> N >> M;
    vector<int64_t> A(N),B(N);
    for ( int64_t i = 0; i < N; ++i){
        cin >> A[i] >> B[i];
    }
    
    vector<vector<int64_t>> AB(N,vector<int64_t>(2));
    for ( int64_t i = 0; i < N; ++i){
        AB[i][0] = A[i];
        AB[i][1] = B[i];
    }
    
    sort(AB.begin(),AB.end());
    
    
    int64_t count = 0;
    int64_t ans = 0;
    for ( int64_t i = 0; i < N; ++i){
        int64_t cost = AB[i][0];
        int64_t num = AB[i][1];
        if ( count + num <= M ){
            count = count + num;
            ans = ans + cost * num;
        } else {
            ans = ans + cost * ( M - count );
            break;
        }
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 10340
N, K, C = map(int, input().split())
S = input()

L = []
R = []
holiday = 0

for i in range(N):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    L.append(i)
    holiday = C
holiday = 0
for i in range(N-1, -1, -1):
  if holiday:
    holiday -= 1
  elif S[i] == 'o':
    R.append(i)
    holiday = C
R = R[::-1]
out = set(L) and set(R)
if len(L) == K:
  for l, r in zip(L, R):
    if l == r: print(l+1)

Measured memory_bytes: 35360
I = input().split(" ")
A, B, C, X, Y = int(I[0]), int(I[1]), int(I[2]), int(I[3]), int(I[4])
AB = C * 2
if A + B >= AB:
    if A >= AB and B >= AB:
        if X >= Y:
            print(X * AB)
        else:
            print(Y * AB)
    elif A >= AB and B <= AB:
        if X >= Y:
            print(X * AB)
        else:
            print(X * AB + (Y - X) * B)
    elif A <= AB and B >= AB:
        if X >= Y:
            print((X - Y) * A + Y * AB)
        else:
            print(Y * AB)
    else:
        if X >= Y:
            print((X - Y) * A + Y * AB)
        else:
            print(X * AB + (Y - X) * B)

else:
    print(X*A + Y*B)
        

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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) cin >> vec.at(i);

  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());

  int A = 0;
  for (int i = 0; i < N; i+=2) A += vec.at(i);
  int B = 0;
  for (int i = 1; i < N; i+=2) B += vec.at(i);

  cout << A - B << endl;
}

Measured memory_bytes: 256
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("YES")
#define p_no() p("NO")

template < typename T >
void vprint(T &V){
	for(auto v : V){
    	cout << v << " ";
	}
	cout << endl;
}

const ll mod = 1e9 + 7;
const ll inf = 1e18;

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

    // input
    ll H, W, h, w;
    cin >> H >> W >> h >> w;

    ll num = H*W - h*W - w*H + h*w;
    p(num);
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int ans=0;
  string s;
  cin>>s;
	int n=s.length();
  for(int i=0;i<n/2;i++)
    if(s[i]!=s[n-1-i])ans++;
  cout<<ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 絶対値求めやつ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i = 0; i < (n);i++)
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
using namespace std;
#define INF 2000000000
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; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
//input power
string s;

int main(){
	bool a;
	cin >> s;
	for(char i = 'a'; i <= 'z' ; i++){
		 a = true;
		rep(j,s.size()){
			if(i==s[j]){
				a = false;
			}
		}
		if(a){
			cout<<i<<endl;
			break;
		}
	}
	if(!a){
		cout<<"None"<<endl;
	}
	}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define DAU  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PLEC return 0;
using namespace std;
int64_t n, s;
int main() {
    DAU
    cin >> n;
    s = 2 * (n / 500) * 500;
    n %= 500;
    s += n - n % 5;
    cout << s;
    PLEC
}


Measured memory_bytes: 256
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < s.length(); i++){
		    if(s.charAt(i) == '0'){
		        cnt0++;
		    }else{
		        cnt1++;
		    }
		}
		result = s.length() - max(0, abs(cnt0 - cnt1));

		// 出力
		System.out.println(result);
        
	}
}


Measured memory_bytes: 24276
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	aa := make([]int64, n)

	var x, sum int64
	mod := int64(1e9 + 7)

	im1 := IntMap{}
	x = 1

	for i := 0; i < n; i++ {
		aa[i] = getNextInt64(scanner)
		sum += inv(aa[i])
		sum %= mod
		d := int(aa[i])
		prime := false
		for prime == false {
			prime = true
			for j := 2; j*j <= d; j++ {
				k := 0
				for d > 0 && d%j == 0 {
					k++
					d /= j
				}
				if k != 0 {
					prime = false
					for ii := 0; ii < minint(im1.get(j), k); ii++ {
						x *= inv(int64(j))
						x %= mod
					}

					im1[j] = maxint(im1.get(j), k)
				}
			}
		}
		x *= aa[i]
		x %= mod
		for ii := 0; ii < minint(im1.get(d), 1); ii++ {
			x *= inv(int64(d))
			x %= mod
		}

		im1[d] = maxint(im1.get(d), 1)
	}

	fmt.Fprintln(writer, (x*sum)%mod)
}

func inv(n int64) int64 {
	var ii [64]int64
	mod := int64(1e9 + 7)
	ii[0] = n
	for i := 1; i < 64; i++ {
		ii[i] = (ii[i-1] * ii[i-1]) % mod
	}
	var ans int64
	ans = 1
	m := int64(mod - 2)
	for i := 62; i >= 0; i-- {
		for m >= 1<<uint(i) {
			ans = (ans * ii[i]) % mod
			m -= 1 << uint(i)
		}
	}

	return ans
}

// IntMap ...
type IntMap map[int]int

func (m IntMap) get(key int) int {
	if _, ok := m[key]; ok {
		return m[key]
	}
	return 0
}

func (m IntMap) increment(key int) {
	m[key] = m.get(key) + 1
}

func minint(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func maxint(a, b int) int {
	if a > b {
		return a
	}
	return b
}


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


int main() {
  int n; cin >> n; 
  vector<int> b(n-1); rep(i,n-1)cin >> b[i];
  int sum = b[0]; //a[0] はb[0]
  //a[1]からa[n-1]をたす
  rep(i,n-2){
    sum += min(b[i] ,b[i+1]);
  }
  //a[n-1] = b[n-2]
  sum += b[n-2];
  cout << sum << endl;
  
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){

    int x, a, b, c, y=0;
    
        scanf("%d", &a);
        scanf("%d", &b);
        scanf("%d", &c);
        
        for(int x = a; x <= b; x++) {
            if(c%x == 0){
                y=y+1;
            }
        }
        printf("%d\n", y);
        
        return 0;
}



Measured memory_bytes: 2104
n,m,q = map(int,input().split())
g = []
for i in range(q):
  a,b,c,d = map(int,input().split())
  g.append([a,b,c,d])
MAX = 0
def check(x):
  ten = 0
  for i in range(q):
    a,b,c,d = g[i]
    if x[b-1]-x[a-1] == c:
      ten += d
  return ten
def dfs(s):
  global MAX
  if len(s) == n:
    MAX = max(check(s),MAX)
    return
  for i in range(s[-1],m+1):
    s.append(i)
    dfs(s)
    s.pop()
for i in range(1,m+1):
  dfs([i])
print(MAX)


Measured memory_bytes: 9232
main :: IO()
main = do
    n <- readLn
    print $ getsolve n
    
getsolve :: Int -> Int
getsolve n
    | n == 0		= 0
    | n < 10		= 1 + getsolve (n-1)
    | n < 100		= getsolve (n - 1)
    | n < 1000		= 1 + getsolve (n-1)
    | n < 10000		= getsolve (n-1)
    | n < 100000	= 1 + getsolve (n-1)
    | otherwise		= getsolve (n-1)

Measured memory_bytes: 1276
#include<bits/stdc++.h>
#define ll long long int
#define l(i,a,b) for(ll i=a;i<b;i++)
#define PI 3.14159265358979323846
using namespace std;
int main(){
	ll a;
	cin>>a;
	if(a>=30) cout<<"Yes\n";
	else cout<<"No\n";
}

Measured memory_bytes: 3628
a=b=0;require("fs").readFileSync("/dev/stdin","utf8").trim().split('\n').map(function(i){c=i.split(',');x=c[0],y=c[1],z=c[2];z*z-y*y-x*x?y-x?0:b++:a++});console.log(a+'\n'+b)

Measured memory_bytes: 7644
/*
    And I know I may end up failing too
*/




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

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int>pii;
typedef unsigned long long ull;

#define dbg          cout<<"Freak"<<endl;
#define dbgg(i)      cout<<i<<endl;
#define N            1e9+7
#define pb           push_back
#define pf           push_front
#define pi           acos(-1)
#define all(x)       x.begin(),x.end()
#define fast         ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define INF          0x3f3f3f3f

struct hash_pair
{
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1> {}(p.first);auto hash2 = hash<T2> {}(p.second);return hash1 ^ hash2;
    }
};

ll t;
ll mod=N;
ll BigMod(ll base,ll pow,ll mod)
{
    if(pow==0||base==1)return 1;
    else if(pow==1)return base;
    else if(pow%2)return BigMod(base,pow-1,mod)*base%mod;
    else {ll x=(BigMod(base,pow/2,mod)%mod);x=(x*x)%mod;return x;}
}



int main()
{
    fast;
    ll a,b,c,d,e,f,g,i,j;
    ll n,m,k;
    char ch;
    cin>>ch;
    if(ch>='A'&&ch<='Z')cout<<'A'<<endl;
    else cout<<'a'<<endl;
    return 0;
}


Measured memory_bytes: 3564
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>

#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <numeric>

#define LOG(FMT...) fprintf(stderr, FMT)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v)
    is >> x;
  return is;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  if (!v.empty()) {
    os << v.front();
    for (int i = 1; i < v.size(); ++i)
      os << ' ' << v[i];
  }
  return os;
}

int main() {
#ifdef LBT
  freopen("test.in", "r", stdin);
  int nol_cl = clock();
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; ++i) {
    int x, l;
    cin >> x >> l;
    a[i] = make_pair(x - l, x + l);
  }
  sort(a.begin(), a.end(), [&](const pair<int, int>& lhs, const pair<int, int>& rhs){ return lhs.second < rhs.second; });
  int cur = numeric_limits<int>::min();
  int ans = 0;
  for (const auto& pr : a) {
    int l, r;
    tie(l, r) = pr;
    if (l >= cur) {
      ++ans;
      cur = r;
    }
  }
      cout << ans;

#ifdef LBT
  LOG("Time: %dms\n", int ((clock()
          -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <atcoder/dsu>

using namespace std;
using namespace atcoder;

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

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl;

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[";
  REP(i, SZ(v)) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}

template<class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  return os << "(" << p.first << " " << p.second << ")";
}

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

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
const ld eps = 1e-9;

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

  int n, q; cin >> n >> q;
  dsu uf(n);
  REP(_, q) {
    int t; cin >> t;
    if(t == 0) {
      int u, v; cin >> u >> v;
      uf.merge(u, v);
    } else {
      int u, v; cin >> u >> v;
      cout << uf.same(u, v) << endl;
    };
  }

  return 0;
}

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

void selectionSort(vector<int> A, int N) {
    int count = 0;
    for (int i = 0; i < N; i++) {
        int minj = i;
        for (int j = i; j < N; j++) {
            if (A[j] < A[minj]) {
                minj = j;
            }
        }
        if(i != minj){
            swap(A[i], A[minj]);
            count++;
        }
    }
    for (int i = 0; i < N; i++) {
        cout << A[i];
        if (i != N - 1){
            cout << " ";
        }
    }
    cout << endl;
    cout << count << endl;
}

int main() {

    int n;
    cin >> n;

    vector<int> A(n);
    for (int i = 0; i < n; i++) {
        cin >> A[i];
    }

    selectionSort(A, n);

    return 0;

}


Measured memory_bytes: 3168
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        long ans = 0;
        // 文字列切り出し
        for(int i = 1; i <= k; i++) {
            for(int j = 1; j <= k; j++) {
                for(int h = 1; h <= k; h++) {
                    ans += gcd(i, gcd(j, h));
                }
            }
        }
        
        System.out.println(ans);
    }

    // 最大公約数
    static int gcd(int a, int b) {
        return b>0 ? gcd(b, a%b) : a;
    }
}


Measured memory_bytes: 35756
#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  long long x[n],y[m],ansx=0,ansy=0;
  for(int i=0;i<n;i++){
    cin>>x[i];
    }
  for(int i=0;i<m;i++){
    cin>>y[i];
    }
  for(int i=0;i<n-1;i++){
      ansx=(ansx+(x[i+1]-x[i])*(i+1)*(n-i-1)) %1000000007;
    }
  for(int j=0;j<m-1;j++){
    ansy=(ansy+(y[j+1]-y[j])*(j+1)*(m-j-1)) %1000000007;
    }
  long long ans=(ansx*ansy)%1000000007;
  cout <<ans<<endl;
  return 0;
  }

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

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

    int ans = -1;
    rep(i, 1, 100000) {
        int x = (int)(i * 0.08);
        int y = (int)(i * 0.1);
        if (x == a && y == b) {
            ans = i;
            break;
        }
    }

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

Measured memory_bytes: 256
//ABC047B
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
#include <unordered_map>
using namespace std;

int main(){
	int w, h, n;
	cin >> w >> h >> n;
	int x, y, a;
	int l = 0, r = w, u = h, s = 0;
	for(int i=0;i<n;i++){
		cin >> x >> y >> a;
		if(a == 1){
			l = max(l,x);
		}else if(a == 2){
			r = min(r,x);
		}else if(a == 3){
			s = max(s,y);
		}else{
			u = min(u,y);
		}
	}
	int ans = max(0,r-l)*max(0,u-s);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;
ll MEMO[2001][2001][4];
// 0: Left, 1: Up, 2: Right, 3:Down
int main() {
  ll H, W;
  cin >> H >> W;
  vector<string> map(H);
  for (int i = 0; i < H; i++) {
    cin >> map[i];
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (map[i][j] == '#') continue;
      MEMO[i][j][0] = (j == 0) ? 1 : (MEMO[i][j - 1][0] + 1);
      MEMO[i][j][1] = (i == 0) ? 1 : (MEMO[i - 1][j][1] + 1);
    }
  }
  for (int i = H - 1; i >= 0; i--) {
    for (int j = W - 1; j >= 0; j--) {
      if (map[i][j] == '#') continue;
      MEMO[i][j][2] = (j == W - 1) ? 1 : (MEMO[i][j + 1][2] + 1);
      MEMO[i][j][3] = (i == H - 1) ? 1 : (MEMO[i + 1][j][3] + 1);
    }
  }
  ll ans = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (map[i][j] == '.')
        ans = max(ans, MEMO[i][j][0] + MEMO[i][j][1] + MEMO[i][j][2] +
                           MEMO[i][j][3] - 3);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 129408
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) {

		// ストリームを作成する
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));

		while (true) {
			int[] imaginedArray = readPair(reader);
			// 終了判定
			if (imaginedArray == null) {
				return;
			}
			int[] choseArray = readPair(reader);

			// ヒットとブローを判定する
			int hit = 0;
			int blow = 0;
			for (int i = 0; i < choseArray.length; i++) {

				// ヒット判定
				if (choseArray[i] == imaginedArray[i]) {
					hit++;
					continue;
				}

				// ブロー判定
				for (int j = 0; j < imaginedArray.length; j++) {
					if (choseArray[i] == imaginedArray[j]) {
						blow++;
						break;
					}
				}

			}
			System.out.println(hit + " " + blow);
		}

	}

	/**
	 * ストリームから1行読み込んで、4つ1組の数値として返す。
	 *
	 * @param reader
	 *            入力ストリーム
	 * @return 4つ1組の数値
	 */
	private static int[] readPair(BufferedReader reader) {
		int[] result = new int[4];
		try {
			String line = reader.readLine();
			if (line == null || line.isEmpty()) {
				return null;
			}
			String[] array = line.split(" ");
			result[0] = Integer.parseInt(array[0]);
			result[1] = Integer.parseInt(array[1]);
			result[2] = Integer.parseInt(array[2]);
			result[3] = Integer.parseInt(array[3]);
		} catch (IOException e) {
			throw new RuntimeException();
		}
		return result;
	}

}

Measured memory_bytes: 16924
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

ans = 0

while A < B:
    flag=True
    if A<0:
        ans += C*(abs(A))
        A+=abs(A)
        flag=False
    elif A==0:
        ans+=D
        flag=True
    if flag:
        ans += E*(B-A)
        A+=(B-A)
print(ans)


Measured memory_bytes: 5588
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
#define rreps(i, n) for(int i=((int)(n)); i>0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define pl(s) cout << (s) << "\n";
#define pls(...) {bool space = false; for(auto i : __VA_ARGS__) (cout << (space?" ":"") << i), space = true; cout << "\n";}
#define plexit(s) {cout << (s) << "\n"; exit(0);}
#define yes(s) cout << ((s)?"Yes":"No") << "\n";
#ifdef __LOCAL
#include <dump.hpp>
#define dump(...) DUMPOUT << "  " << string(#__VA_ARGS__) << ": " << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" << endl << "    ", dump_func(__VA_ARGS__)
#else
#define dump(...)
#endif
template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
struct IOInit { IOInit() { cin.tie(nullptr); ios::sync_with_stdio(false); dump("READY"); /*cout << unitbuf;*/} } IO_INIT;
using ll = long long; using ull = unsigned long long; using ld = long double;
template<typename T = int> using V = vector<T>; template<typename T = int> using P = pair<T, T>;
using Vi = V<int>; using Vl = V<ll>; using Vd = V<ld>; using VVi = V<Vi>; using VVl = V<Vl>; using Pi = P<int>; using Pl = P<ll>; using Pd = P<ld>;
constexpr ll MOD = 1000000007; constexpr int INF = (1 << 30) - 1; constexpr ll INFL = 1LL << 60; constexpr ld EPS = 1e-12; constexpr ld PI = 3.141592653589793238462643383279;



signed main(void) {
  int n; cin >> n;
  int m = 3;
  VVi a(n, Vi(m));
  rep(i,n) {
    rep(j,m) cin >> a[i][j];
  }
  VVi dp(n+1, Vi(m)); // $1日目に$2を選択したときの最大コスト

  rep(i,n) {
    rep(j,m) {
      rep(k,m) {
        if (j == k) continue;
        chmax(dp[i+1][k],dp[i][j]+a[i][k]);
      }
    }
  }
  int ans = 0;
  rep(j,m) chmax(ans, dp[n][j]);
  //dump(dp);
  pl(ans)
  return 0;
}


Measured memory_bytes: 14216
#include<iostream>
#include<cstdio>
using namespace std;
bool leap(int Y){
  if(Y%4==0)
    return( (Y%100==0)?( (Y%400==0)?true:false ):true ); 
  else return false;
}
int days(int Y,int M){
  if(M==2){
    if( leap(Y) ) return 29;
    else return 28;
  }
  else if(M==4 || M==6 || M==9 || M==11) return 30;
  else return 31;
}
int main(){
  int Y,M,D,aY,aM,aD;
  int cont=0;
  while(cin>>Y>>M>>D>>aY>>aM>>aD){
    if(Y<0 || M<0 || D<0 || aY<0 || aM<0 || aD<0) break;
    for(;;){
      if(Y==aY && M==aM && D==aD) break;
      D += 1;
      if(D > days(Y,M) ){
	D = 1;
	M += 1;
      }
      if(M > 12){
	M = 1;
	Y += 1;
      }
      cont++;
	}
    cout<<cont<<endl;
    cont = 0;
  }
}

Measured memory_bytes: 0
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define DEBUG true
#ifdef ONLINE_JUDGE
#undef DEBUG
#define DEBUG false
#endif 

using namespace std;

#define MAXN ((int)2e5+5)
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9 + 9)
#define ll long long
#define _ << " " <<
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define TRACE(x) if(DEBUG) cerr << #x << " = " << x << endl;
#define TRACE2(x,y) if(DEBUG) cerr << #x << " = " << x << " | " << #y << " = " << y << endl;
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl "\n"
#define pii pair<int,int>
#define mid ((l+r)/2)

int n,m;
string s;

vector <int> ans;

void check()
{
	for (int i = 0; i < s.size(); ++i)
		if(s[i] == '1')
		{
			int t = 0;
			while(s[i+t] == '1') t++;


			i = i + t - 1;

			if(t >= m)
			{
				cout << "-1\n";
				exit(0);
			}
		}
}

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);
	cin >> n >> m >> s;
	check();


	vector <int> v;
	for (int i = 0; i < s.size(); ++i)
		if(s[i] == '0')
			v.pb(i);



	int cur = n;

	vector <int> ans;

	while(cur > 0)
	{
		auto it = lower_bound(all(v), cur - m);
		int index = it - v.begin();
		TRACE2(cur, v[index]);
		ans.pb(cur - v[index]);
		cur = v[index];
	}

	reverse(all(ans));

	for (auto i : ans)
		cout << i << " ";
}

Measured memory_bytes: 1480
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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(){
    string tmp;
    cin>>tmp;
    queue<char> a,b,c;

    rep(i,tmp.size()){
        a.push(tmp[i]);
    }
    cin>>tmp;
    rep(i,tmp.size()){
        b.push(tmp[i]);
    }
    cin>>tmp;
    rep(i,tmp.size()){
        c.push(tmp[i]);
    }
    char now=a.front();
    a.pop();
    while(1){
        if(now=='a'){
            if(a.empty()){
                cout<<"A"<<endl;
                return 0;
            }
            else{
                now=a.front();
                a.pop();
            }
        }
        else if(now=='b'){
            if(b.empty()){
                cout<<"B"<<endl;
                return 0;
            }
            else{
                now=b.front();
                b.pop();
            }
        }
        else if(now=='c'){
            if(c.empty()){
                cout<<"C"<<endl;
                return 0;
            }
            else{
                now=c.front();
                c.pop();
            }
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for(int i = 1, i##_len = (n); i < i##_len; ++i)
#define ALL(x) (x).begin(), (x).end()
#define PRINT(A) std::cout << (#A) << ":" << (A) << std::endl;

typedef long long int ll;
const int MOD = 1e9 + 7;
const int INF = 1e9;

using namespace std;

int r[30][100010];
int N, C;

int main() {
  cin >> N >> C;
  REP(i, N) {
    int a, b, c;
    cin >> a >> b >> c;
    a--;
    c--;
    r[c][a]++;
    r[c][b]--;
  }

  REP(c, C) REPS(i, 100001) { r[c][i] += r[c][i - 1]; }
  REP(c, C) REP(i, 100001) if(r[c][i]) r[c][i] = 1;

  int ans = 0;
  REP(i, 100001) {
    int cur = 0;
    REP(c, C) cur += r[c][i];
    ans = max(ans, cur);
  }

  cout << ans << endl;
}


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

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

    int sum = 0;
    for (int i = 0; i < N.length(); i++)
    {
        sum += N.at(i) - '0';
    }
    if (sum % 9 == 0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3688
#include<bitset>
#include<math.h>
#include<limits.h>
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<list>
#include<queue>
#include<algorithm>
#include<functional>
#include<map>
#include<set>
#include<utility>
#include<initializer_list>
#include<tuple>
#include<regex>
using namespace std;
#define ull unsigned long long
#define ll long long
#define rep(i, a, n) for(int i=(a);i<(int)(n);i++)
#define repc(i, a, n) for(int i=(a);i<=(int)(n);i++)
#define all(t) t.begin(), t.end()
#define rall(t) t.rbegin(), t.rend()
#define mat(type, row, col, init) vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout<<(cond? "Yes":"No")<<endl;
#define YES(cond) cout<<(cond? "YES":"NO")<<endl;
#define DBG(str) cerr<<(str)<<endl;
int main() {
	ll n;
	cin >> n;
	vector<ll>a(n);
	rep(i, 0, n)cin >> a[i];
	sort(all(a));
	ll ai = a[n - 1];
	vector<ll>b(a.begin(), a.end() - 1);
	ll z = ai / 2;
	auto index = lower_bound(b.begin(), b.end(), z);
	int d = distance(b.begin(), index);
	int mi = INT_MAX;
	ll ans = -1;
	for (int i = max(0,d - 1); i <= min(d+2 ,(int)b.size()-1); i++) {
		int con = abs(b[i] - z);
		if (con<= mi) {
			mi = con;
			ans = b[i];
		}

	}
	cout << ai << " " << ans;

	return 0;
}





Measured memory_bytes: 1792
#include<bits/stdc++.h>
#include<cmath>
#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;
const ll MOD = 1000000007;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll 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; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
#define fs first
#define sc second
 
template<typename T>
T gcd(T a,T b){return b?gcd(b,a%b):a;}

const int INF = 1e9;
const ll LLINF = 1e16;
 
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...));
}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
 
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

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


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


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    //auto a = make_v<ll>(n, m);
    ll n;
    cin >> n;
    vector<ll> x(n);
    rep(i,n) cin >> x[i];
    sort(all(x));
    ll ans = LLINF;
    REP(i, 1 ,x[n - 1] + 1){
      ll sum = 0;
      rep(j,n){
        sum += (x[j] - i) * (x[j] - i);
      }
      chmin(ans, sum);
    }
    print(ans);
}


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

using namespace std;

#define DUMP(x) std::cout << (#x) << " = " << (x) << "\n"

void Main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) {
    cin >> x;
  }
  auto itr = max_element(a.begin(), a.end());

  vector<int> b = a;
  sort(b.begin(), b.end());
  auto itr2 = max_element(b.begin(), b.end() - 1);

  for (int i = 0; i < n; ++i) {
      if(a[i] == *itr){
          cout << *itr2 << "\n";
      }
      else{
          cout << *itr << "\n";
      }
  }
}

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


Measured memory_bytes: 3200
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>
//#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pil = std::pair<int, long long>;
using pli = std::pair<long long, int>;
using plpii = std::pair<long long, std::pair<int, int>>;
using pdd = std::pair<double, double>;

const long long INF = 1000000000000000001;
const long long _MOD = 1000000007;
const long long MOD = 998244353;
const int ALPHABET = 27;
const double pi = 3.14159265358979;

using namespace std;
//namespace mp = boost::multiprecision;

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

	int h, w, m;
	cin >> h >> w >> m;
	pii* hw = new pii[m];
	rep(i, m) cin >> hw[i].first >> hw[i].second;

	pii* line = new pii[h];
	pii* raw = new pii[w];
	rep(i, h) {
		line[i].first = 0;
		line[i].second = i;
	}
	rep(i, w) {
		raw[i].first = 0;
		raw[i].second = i;
	}

	rep(i, m) {
		line[hw[i].first - 1].first += 1;
		raw[hw[i].second - 1].first += 1;
	}

	sort(line, line + h);
	sort(raw, raw + w);

	int ans = line[h - 1].first + raw[w - 1].first;
	if (ans == h * w) {
		--ans;
	}
	else {
		int max_line = line[h - 1].first, max_raw = raw[w - 1].first;
		set<int> _line, _raw;
		rrep(i, h - 1) {
			if (line[i].first == max_line) _line.insert(line[i].second);
			else break;
		}
		rrep(i, w - 1) {
			if (raw[i].first == max_raw) _raw.insert(raw[i].second);
			else break;
		}

		int num = 0;
		rep(i, m) {
			auto p = _line.find(hw[i].first - 1);
			auto q = _raw.find(hw[i].second - 1);

			if (_line.find(hw[i].first - 1) != _line.end() && _raw.find(hw[i].second - 1) != _raw.end()) ++num;
		}

		if (_line.size()*_raw.size() == num) --ans;
	}

	cout << ans << "\n";

	return 0;
}


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

long long int pow_num(int n, int p){
    long long int sum=1;
    rep(i, p) sum*=n;
    return sum;
}

int main(){
    int N;
    cin >> N;
    long long int A[N];
    long long int ans=1;
    int flag=0;
    rep(i, N){
        cin>>A[i];
        if(A[i] == 0){
            cout << "0" << endl;
            return 0;
        }
        int num_A=0;
        int num_ans=0;
        int A_sub=A[i];
        while(true){
            A_sub/=10;
            num_A++;
            if(A_sub < 10) break;
        }
        int ans_sub=ans;
        while(true){
            ans_sub/=10;
            num_ans++;
            if(ans_sub < 10) break;
        }

        if(1000000000000000000/ans < A[i]) {
            ans=-1;
            flag=1;
        }else if(num_A+num_ans > 17 && A_sub*ans_sub>=10){
            ans=-1;
            flag=1;
        }else if(ans*A[i] > pow_num(10, 18)){
            ans=-1;
            flag=1;
        }if(flag == 0) ans = A[i]*ans;
    }

    cout << ans << endl;
}

Measured memory_bytes: 4412
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

vector<vector<int>> to;
vector<bool> seen;
vector<int> ans;
void dfs(int v) {
    if (seen[v]) return;
    seen[v] = true;
    for (auto u : to[v]) dfs(u);
    ans.pb(v);
}

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

    int v, e;
    cin >> v >> e;
    to.resize(v);
    rep(i, e) {
        int s, t;
        cin >> s >> t;
        to[s].pb(t);
    }
    seen.resize(v);
    rep(i, v) dfs(i);
    reverse(all(ans));
    rep(i, v) cout << ans[i] << endl;
}


Measured memory_bytes: 3740
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
vector<ll> a[205];
ll M;
ll BB;
ll AAA=0,ans;
ll binary(char c,ll n){
	ll C=c;
	ll r=a[C].size(),l=-1;
	while(r-l>1){
		M=(r+l)/2;
		if(a[C][M]>=n){
			r=M;
		}else{
			l=M;
		}
	}
	return r;
}
int main(void){
	string s,t; cin>>s>>t;
	ll S=s.size();
	for(int i=0;i<S;i++){
		ll k=s[i];
		a[k].push_back(i);
	}
	for(int i=0;i<t.size();i++){
	    if(a[t[i]].size()==0){
	        cout<<-1<<endl;
	        return 0;
	    }
		ll AA=binary(t[i],AAA);
		ll T=t[i];
		BB=a[T][AA]+1;
		if(AA==a[T].size()){
			ans+=S;
			BB=a[T][0]+1;
		}
		//cout<<ans<<" "<<BB<<endl;
		AAA=BB;
	}
	ans+=BB;
	cout<<ans<<endl;
	
}


Measured memory_bytes: 1724