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

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {

            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {

            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }

       




        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var hw = Reads();
            var h = hw[0];
            var w = hw[1];
            var s = new char[h][];
            var c1 = new long[] {-1,-1,-1,0,0,1,1,1};
            var c2 = new long[] {-1,0,1,-1,1,-1,0,1};
            for (int i = 0; i < h; i++)
            {
                s[i] = Console.ReadLine().ToCharArray();
            }
            
            for (int i = 0; i < h; i++)
            {
                for (int j = 0; j < w; j++)
                {
                    if (s[i][j] == '.')
                    {
                        var count = 0;
                        for (int k = 0; k < 8; k++)
                        {
                            var x = i + c1[k];
                            var y = j + c2[k];
                            if (x!=-1&&x!=h&&y!=-1&&y!=w&&s[x][y]=='#') count++;
                        }
                        s[i][j] = (char)('0' + count);
                    }
                }
            }
            for (int i = 0; i < h; i++)
            {
                for (int j = 0; j < w; j++)
                {
                    Console.Write(s[i][j]);
                }
                Console.WriteLine();
            }


            Console.Out.Flush();
        }
    }
}




Measured memory_bytes: 13396
func readLine_() -> [String] {
    return readLine()!.characters.split(" ").map{String($0)}
}
func readIntSplit() -> [Int] {
    let strs = readLine_()
    return strs.map{Int($0)!}
}

/************** main *****************/
let nm = readIntSplit()
let (n, m) = (nm[0], nm[1])
var (t, b) = (1, n)
for i in 1...m {
    let lr = readIntSplit()
    let (l, r) = (lr[0], lr[1])
    if t < l{
        t = l
    }
    if b > r {
        b = r
    }
}
let ans = b - t + 1
if ans < 0 {
    print(0)
} else {
    print(ans)
}


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

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

    int takahashi_think = 0;
    for(int i = 0; i < 4; i++){
        if(S.at(i) == '+'){
            takahashi_think++;
        }
        else{
            takahashi_think--;
        }
    }

    cout << takahashi_think << endl;
}

Measured memory_bytes: 3552
#include<stdio.h>
int main(){
	int a;
	while(~scanf("%d",&a)){
		int ret=0;
		int ks=1;
		for(int i=0;i<a;i++){
			ret+=ks;
			if(i%2==1)ks*=3;
		}
		printf("%d\n",ret);
	}
}

Measured memory_bytes: 1024
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;

class Program{
  static void Main(){
    var input = ReadLine().Split(' ').Select(int.Parse).ToArray();
    
    if(input[0] < 10){
    	Write(input[1] + 100*(10 - input[0]));
    }else{
    	Write(input[1]);
    }
    
  }
}


Measured memory_bytes: 19028
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {
    public static void main(String[] args) throws IOException {
       Scanner in = new Scanner(System.in);
       int a, b, c;
       a = in.nextInt();
       b = in.nextInt();
       c = in.nextInt();
       int ans = 0;
       for(int i = a; i <= b; i++) {
	       if(c % i == 0) ans++;
       }
       System.out.println(ans);
    }
}

Measured memory_bytes: 17360
#include<stdio.h>

int a[100001],b[50001];

int main(void){

  int n,q,cnt=0,i,j;

  scanf("%d",&n);

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

  scanf("%d",&q);
  for(i=0;i<q;i++)scanf("%d",&b[i]);

  for(i=0;i<q;i++){
    int l=0,r=n;
    while(r-l>1){
      int m=(l+r)/2;
      if(a[m] > b[i])r=m;
      else l=m;
    }
    cnt+=(a[l]==b[i] || a[r]==b[i]);
  }

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

  return 0;
}



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

sumA, sumB = [0], [0]
sa, sb = 0, 0
for a in A:
    sa += a
    sumA.append(sa)
for b in B:
    sb += b
    sumB.append(sb)


n_max = 0
nb_max = M
for na in range(0, N+1):
    for nb in range(nb_max, -1, -1):
        k = sumA[na] + sumB[nb]
        if k <= K:
            n = na + nb
            n_max = max(n_max, n)
            nb_max = nb
            break
print(n_max)


Measured memory_bytes: 47232
//This is getting accepted!
#include<bits/stdc++.h>
#define ll long long
#define oo 1000000009
#define isset(x, i) (((x)>>(i))&1)
#define setbit(x, i) ((x)^(1ll<<(i)))
#define clearbit(x, i) ((x)&(~(1ll<<(i))))
#define twoexp(i) (1ll<<(i))

using namespace std;

const int MOD = 1000000007;
const double EPS = 1e-8;
const double PI = 2 * acos(0);
const int MAXN = 10006;

int l, r;
int a[MAXN];
int cnt = 0;

bool input() {
	
	cin >> l >> r;
	
	return !cin.fail();
}

void clear_input() {
	
}

void preprocess() {
	
	
}

void process(int itest) {
	
	cnt = 0;
	
	for(int i = l, j = 0; i <= r && j < 2019; i++, j++) {
		a[cnt++] = i%2019;
	}
	
	int res = 2019;
	
	for (int i = 0; i < cnt; ++i)
		for (int j = i+1; j < cnt; ++j)
			if (a[i]*a[j] % 2019 < res) {
				res = a[i]*a[j] % 2019;
//				cout << res << " " << i << " " << j << endl;
			}
	
	cout << res << endl;
	
}

void oneTest() {
	
	while(input()) {
		preprocess();
		process(0);
		clear_input();
	}
	
}

void multiTest() {
	
	int t;
	cin >> t;
	
	for (int it = 1; it <= t; ++it) {
		input();
		preprocess();
		process(it);
	}
}

int main(){
    #ifndef ONLINE_JUDGE
//    freopen("../out.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	oneTest();
//	multiTest();

    return 0;

}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
using namespace std;

const int MAX = 400;
const int DX[] = {0,1,0,-1};
const int DY[] = {1,0,-1,0};

int H,W;
char S[MAX][MAX];
bool check[MAX][MAX] = {{false}};

void cnt(int x,int y,long long& w,long long& b){
    if(check[y][x])return;
    check[y][x] = true;

    if(S[y][x] == '#')b++;
    else w++;

    for(int i = 0;i < 4;i++){
        int dx = x + DX[i];
        int dy = y + DY[i];
        if(dx < 0 || dx >= W || dy < 0 || dy >= H)continue;
        if(S[y][x] == S[dy][dx])continue;
        cnt(dx,dy,w,b);
    }
}

int main(){
    long long ans = 0;

    cin >> H >> W;
    for(int i = 0;i < H;i++){
        for(int j = 0;j < W;j++){
            cin >> S[i][j];
        }
    }

    for(int i = 0;i < H;i++){
        for(int j = 0;j < W;j++){
            if(S[i][j] == '.')continue;
            if(check[i][j])continue;
            long long w = 0;
            long long b = 0;
            cnt(j,i,w,b);
            ans += w * b;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 13056
n = int(input())
ind = list(map(int, input().split()))
val = list(map(int, input().split()))
val1 = list(map(int, input().split()))
res = sum(val)
if ind[1] == ind[0] + 1:
    res += val1[ind[0]-1]
for i in range(1, len(ind)-1):
    if ind[i+1] == ind[i] + 1:
        res += val1[ind[i]-1]
print(res)


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#define SIZE 1000000002

typedef long long int ll;

using namespace std;

int n;
int a, b;
ll h;

int main(void) {

	cin >> n;
	int ret = 0, count = 0;
	ll prev;
	cin >> prev;
	for (int i = 1; i < n; i++)
	{
		cin >> h;
		if (prev >= h)
		{
			count++;
			if (count > ret)
			{
				ret++;
			}
		}
		else
		{
			count = 0;
		}
		prev = h;
	}
	cout << ret;

	return 0;
}

Measured memory_bytes: 256
#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;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define int ll
#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    int n;
    cin>>n;
    int ans = LLONG_MAX;
    for(int i = 1; i <= (int)sqrt(n); i++) {
    	if(n % i) continue;
    	int ss = n / i;
    	ans = min(ans, i + ss);
    }
    cout<<ans - 2;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){

    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

bool IsPrime(ll num){
    if(num < 2) return false;
    else if(num == 2) return true;
    else if(num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for(ll i = 3; i <= sqrtNum; i += 2){
        if(num%i==0){
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}

signed main(){
  int a,b; cin>>a>>b;
  cout << max(0,a-2*b)<<endl;


  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <algorithm>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
using namespace std;
int main(void){
    int num[3];
    cin>>num[0]>>num[1]>>num[2];
    sort(num,num+3);
    int gap1=num[2]-num[0];
    int gap2=num[2]-num[1];
    if(gap1%2==1&&gap2%2==1){cout<<(gap1-1)/2+(gap2-1)/2+1;}
    else if(gap1%2==1&&gap2%2==0){cout<<(gap1+1)/2+gap2/2+1;}
    else if(gap2%2==1&&gap1%2==0){cout<<(gap2+1)/2+gap1/2+1;}
    else {cout<<gap1/2+gap2/2;}
    return 0;
}

Measured memory_bytes: 256
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
CD=[list(map(int,input().split())) for i in range(M)]

for a,b in AB:
    x=10**20
    for i,(c,d) in enumerate(CD):
        l=int(abs(a-c)+abs(b-d))
        if x>l:
            x=l
            num=i+1
    print(num)


Measured memory_bytes: 39408
n = int(input())

print( n*(n-1)//2 - n//2)

com = []

if (n%2 == 1):
    com.append([n])
    n -= 1
for i in range(1,1+n//2):
    com.append([i,n+1-i])

for i in range(len(com) - 1):
    for j in com[i]:
        for k in com[i+1 : ]:
            for l in k:
                print('{} {}'.format(j,l))

Measured memory_bytes: 3336
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>//小数点以下表示
#include<map>
using namespace std;
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 long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


int main(){
    int n,m;
    cin>>n>>m;
    vector<int> kosuu(m,0);
    rep(i,n){
        int k;
        cin>>k;
        rep(i,k){
            int a;
            cin>>a;
            kosuu.at(a-1)++;
        }
    }
    int count=0;
    rep(i,m){
        if(kosuu.at(i)==n){
            count++;
        }
    }
    cout<<count<<endl;
}

Measured memory_bytes: 256
def main():
    h, w = map(int, input().split())
    s = [list(input()) for _ in range(h)]
    
    def judge(y, x):
        if s[y][x] == '.':
            return True
        for dx, dy in [[-1, 0], [0, -1], [1, 0], [0, 1]]:
            ny = y + dy
            nx = x + dx
            if 0<= ny < h and 0<= nx < w:
                if s[ny][nx] == '#':
                    return True
        return False
            
        
    for y in range(h):
        for x in range(w):
            if judge(y, x) == False:
                print('No')
                return
    else:
        print('Yes')
        
        
if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define optimizar_io ios_base::sync_with_stdio(false);cin.tie(0);

int main() {
	optimizar_io
	string s;

	cin >> s;
	if (s[0] != s[1] or s[1] != s[2])
		cout << "Yes\n";
	else
		cout << "No\n";
	return 0;
}

Measured memory_bytes: 256
use std::fmt;
use std::io::stdin;
use std::io::BufRead;
use std::str;
use std::str::FromStr;

fn main() {
	let stdin = stdin();
	let mut scan = InputScanner::new(stdin.lock(),256);

	let n:usize = scan.next();
	let y:usize = scan.next();

	for i in 0..3 {
		let mut answer = vec![0,0,0];

		if search(&mut answer, n,y,i,(3 + i - 1)%3) {
			println!("{}",answer.into_iter().map(|n| format!("{}",n)).collect::<Vec<String>>().join(" "));
			return;
		}
	}

	println!("-1 -1 -1");
}
fn search(answer:&mut Vec<usize>, n:usize, y:usize, i:usize, last_index:usize) -> bool {
	const M:[usize; 3] = [10000,5000,1000];

	let mi = M[i];

	if i == last_index && y - n * mi == 0 {
		answer[i] = n;
		return true;
	} else if i == last_index {
		return false;
	} else {
		for cn in 0..(n+1) {
			let y = y - cn * mi;

			if search(answer,n-cn,y,(i+1)%3,last_index) {
				answer[i] = cn;
				return true;
			}
		}

		false
	}
}
struct InputScanner<R: BufRead> {
	reader: R,
	buf: Vec<u8>, // Should never be empty
	pos: usize,   // Should never be out of bounds as long as the input ends with '\n'
}
impl<R: BufRead> InputScanner<R> {
	fn new(reader: R, capacity: usize) -> Self {
		InputScanner {
			reader: reader,
			buf: Vec::with_capacity(capacity),
			pos: 0,
		}
	}

	#[inline]
	fn next<T: FromStr>(&mut self) -> T
	where
		T::Err: fmt::Debug,
	{
		if self.buf.is_empty() {
			self._read_next_line();
		}
		let mut start = None;
		loop {
			match (self.buf[self.pos], start.is_some()) {
				(b' ', true) | (b'\n', true) | (b'\r', true) => break,
				(_, true) | (b' ', false) => self.pos += 1,
				(b'\n', false) | (b'\r', false) => self._read_next_line(),
				(_, false) => start = Some(self.pos),
			}
		}
		let target = &self.buf[start.unwrap()..self.pos];
		unsafe { str::from_utf8_unchecked(target) }.parse().unwrap()
	}

	#[inline]
	fn _read_next_line(&mut self) {
		self.pos = 0;
		self.buf.clear();
		if self.reader.read_until(b'\n', &mut self.buf).unwrap() == 0 {
			panic!("Reached EOF");
		}
	}
}



Measured memory_bytes: 4352
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = readline().rstrip().decode('utf-8')

t = ""
for i in s:
    if not i == "x":
        t += i

if t[::] != t[::-1]:
    print(-1)

else:
    ans = 0
    left,right = 0,len(s)-1
    while True:
        if right - left <= 0:
            break
        if s[left] == "x" and s[right] != "x":
            ans += 1
            left += 1
        elif s[left] != "x" and s[right] == "x":
            ans += 1
            right -= 1
        else:
            left += 1
            right -= 1
    print(ans)




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

typedef long long ll;

using namespace std;

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

template<class T>
using vi = vector<T>;
template<class T>
using vvi = vector<vector<T>>;

int mod=1000000007;

int main(){
    ll power=1;
    int N;
    cin >> N;
    rep(i,N){
        power*=i+1;
        power%=mod; 
    }
    cout << power << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
        int a = 0;
        int b = 0;
        
        scanf("%d %d", &a, &b);
        
        if(a < b){
            printf("a < b\n");
        }else if(b < a){
            printf("a > b\n");
        }else{
            printf("a == b\n");
        }
        
        return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MAX = 5100000;
ll gcd(ll a, ll b) {
    return (b==0) ? a : gcd(b, a%b);
}

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {

    int x, y; cin >> x >> y;
    string s; cin >> s;
    if ((x + y)%3 != 0) {
        cout << 0 << endl;
        return 0;
    }
    // 連立方程式からのa,bを求める
    int m = (2*x - y)/3;
    int n = (y - m)/2;
    int c = (n + m);
    COMinit();
    ll count = COM(c, n);

    cout << count << endl;
}

Measured memory_bytes: 119808
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <cstring>

#define INF 100000000

using namespace std;

int main()
{
    string s[3];
    cin >> s[0] >> s[1] >> s[2];
    cout << "A" << s[1][0] << "C\n";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    int n;
    cin >> n;
    vector<P> X(n);
    rep(i, n) {
        cin >> X[i].first;
        X[i].second = i;
    }
    sort(ALL(X));
    int m = n / 2;
    vector<P> A = X;
    rep(i, n) {
        if(i < m) A[i].first = X[m].first;
        else A[i].first = X[m - 1].first;
    }
    vector<int> B(n);
    rep(i, n) {
        B[A[i].second] = A[i].first;
    }
    rep(i, n) cout << B[i] << endl;

    return 0;
}

Measured memory_bytes: 6144
#include <bits/stdc++.h>
using namespace std;
#define rep(shoki,i,n) for(int i=shoki; i<n; i++)
#define _GLIBCXX_DEBUG
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vector<int>>;

int main(){
    int n,m; cin>>n>>m;
    int nn = 0;
    int mm = 0;

    if(n>=2){
        nn = n*(n-1)/2;
    }else{
        nn = 0;
    }

    if(m>=2){
        mm = m*(m-1)/2;
    }else{
        mm = 0;
    }

    cout << nn+mm << endl;
    // int bunshin = 1;
    // int bunshim = 1;
    // int bumbon = 2;
    // int bumbom = 2;
    // for(int i=1; i<=n; i++){
    //     bunshin *=i;
    // }
    // for(int i=1; i<=m; i++){
    //     bunshim *= i;
    // }
    // for(int i=1; i<=n-2; i++){
    //     bumbon *=i;
    // }
    // for(int i=1; i<=m-2; i++){
    //     bumbom *=i;
    // }

    // cout << bunshin/bumbon + bunshim/bumbom << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>

struct Point{
	long double X,Y;
	inline void read(){scanf("%Lf%LF",&X,&Y);}
	inline long double plength(){return X*X+Y*Y;}
	inline long double length(){return sqrtl(plength());}
	Point(){X=Y=0;}
	Point(long double X_,long double Y_){X=X_,Y=Y_;}
};
struct Line{
	Point A,B;
	inline void read(){A.read(),B.read();}
	Line(){}
	Line(const Point &A_,const Point &B_){A=A_,B=B_;}
};
typedef Point Vector;
inline Vector operator - (const Point &A,const Point &B){return Vector(A.X-B.X,A.Y-B.Y);}
inline long double operator ^ (const Point &A,const Point &B){return A.X*B.X+A.Y*B.Y;}
inline long double operator * (const Point &A,const Point &B){return A.X*B.Y-A.Y*B.X;}
inline Point operator + (const Point &A,const Vector &B){return Point(A.X+B.X,A.Y+B.Y);}
inline Vector operator * (const Vector &A,long double k){return Vector(A.X*k,A.Y*k);}

Line L;
Point P;

int Q;

inline long double sqr(long double k){return k*k;}

Point Projection(const Line &L,const Point &P){
	long double len=((P-L.A)^(L.B-L.A))/(L.B-L.A).plength();
	return L.A*(1-len)+L.B*len;
}

Point Reflection(const Line &L,const Point &P){
	Point projection=Projection(L,P);
	return projection+(projection-P);
}

int main(){
	L.read();
	scanf("%d",&Q);
	while (Q--){
		P.read();
		Point Ans=Reflection(L,P);
		printf("%.10Lf %.10Lf\n",Ans.X,Ans.Y);
	}
}



Measured memory_bytes: 3220
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let mut d = 0;
    for i in n.to_string().chars() {
        d += i.to_digit(10).unwrap() as usize;
    }
    println!("{}", if n % d == 0 {"Yes"} else {"No"});
}

Measured memory_bytes: 2108
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int w,a,b; cin>>w>>a>>b;
    if(abs(a-b)<=w){
        cout<<0<<endl;
        return 0;
    }
    cout<<min(abs(b-a-w),abs(b+w-a))<<endl;
}


Measured memory_bytes: 3580
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7+1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n,m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/

int main()
{
	ll n, m, p;
	while (1) {
		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0) {
			return 0;
		} else {
			vi v(n);
			ans = 0;
			sum = 0;
			REP(i, n)
			{
				cin >> v[i];
			}
			sum = accumulate(ALL(v), 0LL);
			sum = sum * 100 * (100 - p) / 100;
			if (v[m - 1] == 0) {
				cout << 0 << endl;
			} else {
				ans = sum / v[m - 1];
				cout << ans << endl;
			}
		}
	}
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(std::numeric_limits<float>::max_digits10);
  int n;cin>>n;
  vector<string> s(n);
  rep(i,n)cin>>s[i];
  set<string> ss;
  rep(i,n) {
    if(ss.find(s[i])!=ss.end()) {
      cout << "No" << endl;
      return 0;
    }
    if(i!=0&&s[i-1].back()!=s[i][0]) {
      cout << "No" << endl;
      return 0;
    }
    ss.insert(s[i]);
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>


int parent(int i){
  return i/2;  
}
int left(int i){
  return 2*i;
}
int right(int i){
  return 2*i+1;
}
int main(){
  int i,len,a[251];
  
  
  scanf("%d",&len);
  for(i=1;i<=len;i++){
    scanf("%d",&a[i]);
   }
  for(i=1;i<=len;i++){
    printf("node %d: key = %d, ",i,a[i]);
    if(parent(i)>=1){
      printf("parent key = %d, ",a[parent(i)]);
    }
    if(left(i)<=len){
      printf("left key = %d, ",a[left(i)]);
    }
    if(right(i)<=len){
      printf("right key = %d, ",a[right(i)]);
    }
    puts("");  
  }

  return 0;
}

	    

Measured memory_bytes: 2708
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010];
int main(){
    int n, m;
    while(cin>>n>>m){
        cout<<max(n-2*m, 0)<<endl;
    }
  return 0;
}




Measured memory_bytes: 256
import java.io.PrintWriter
import java.util.*
import java.math.*
import java.lang.*
import kotlin.comparisons.*

val pw = PrintWriter(System.out)
val MOD: Long = (1e+9 + 7).toLong()

fun main(args: Array<String>) {
    val (a, b) = readListOfString()
    println(if((a=="H" && b == "H") || (a=="D" && b=="D")) "H" else "D")
    pw.flush()
}

/****** Declared Functions and Data Structures ******/
// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }

fun Double.format(digits: Int) = String.format("%.${digits}f", this)
fun Float.format(digits: Int) = String.format("%.${digits}f", this)

fun print(value: Any) { pw.print(value) }
fun println(value : Any) { pw.println(value) }


// Extensions
fun<T> List<T>.toBuckets(): Map<T, Int>
    = this.groupBy { it }.mapValues { it.value.size }

fun <K, V> Map<K, V>.toMutableMap(): MutableMap<K, V> = HashMap(this)

// Util Functions
fun<T> permutations(src: List<T>): List<List<T>> {
    if(src.size == 1) return listOf(src)
    val perms = mutableListOf<List<T>>()
    val insertElement = src[0]
    permutations(src.drop(1)).forEach { perm ->
        for(i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, insertElement)
            perms.add(newPerm.toList())
        }
    }
    return perms
}

// return nCr, if you want nCr, please access v[n][r]
fun combinations(n: Long): List<List<Long>> {
    val v = (0..n).map { (0..n).map{0L}.toMutableList() }.toMutableList()
    for(i in 0 until v.size) {
        v[i][0] = 1L
        v[i][i] = 1L
    }
    for(i in 0 until v.size) {
        for(j in 1 until i) {
            v[i][j] = (v[i-1][j-1] + v[i-1][j]) % MOD
        }
    }
    return v.map { it.toList() }.toList()
}

// should be a >= b
fun gcd(a: Long, b: Long): Long = 
    if(b == 0L) a else gcd(b, a % b)

// shoud be a >= b
fun lcm(a: Long, b: Long): Long = 
    a / gcd(a, b) * b

fun sumDigits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

fun Double.isDecimal(): Boolean = ((this - Math.floor(this)) != 0.0)

// Data Structures
class Stack<T>(private var st: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = st.isEmpty()
    fun top(): T = st.last()
    fun push(e: T) { st.add(e) }
    fun pop() { st = st.dropLast(1).toMutableList() }
}

class Queue<T>(private var que: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = que.isEmpty()
    fun top(): T = que.first()
    fun push(e: T) { que.add(e) }
    fun pop() { que = que.drop(1).toMutableList() }
}


Measured memory_bytes: 35996
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}

int main() {
  int A,B,C;
  cin>>A>>B>>C;
  map<int,int>a;
  a[A]++;a[B]++;a[C]++;
  if(a[A]==1){cout<<A<<endl;}
  else if(a[B]==1){cout<<B<<endl;}
  else{cout<<C<<endl;}
  return 0;
}

Measured memory_bytes: 3608
#include<iostream>
using namespace std;
int main(){
    while(1){
        int h, w;
        cin >> h >> w;
        if (h == 0 && w == 0) break;
        for(int i = 0; i < h; i++){
            for(int j = 0; j < w; j++){
                if (i == 0 || i == h - 1 || j == 0 || j == w - 1) cout << "#";
                else cout << ".";
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}



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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;

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

const ull mod = (ull)1e9 + 7;


int main(void)
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	ll count = 0;
	for (int i = 0; i < n - 2; i++) {
		if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>

int n, k;
bool s[102];

int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < k; i++) {
    int d;
    scanf("%d", &d);
    for (int j = 0; j < d; j++) {
      int tmp;
      scanf("%d", &tmp);
      s[tmp] = true;
    }
  }
  int ans = n;
  for (int i = 1; i <= n; i++) {
    if (s[i]) {
      --ans;
    }
  }
  printf("%d\n", ans);
}


Measured memory_bytes: 1724
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
 
using namespace std;
typedef unsigned long long int ll;

int K;
vector<int> m;

bool islun(int);
long ten(int);

int main()
{
  int i,j,k;
  int sum=0;
  bool fin=false;
  int cn=0;
  long ans;


  cin >> K;

  /*
  for (i=1;;i++) {
    if (islun(i)) {
      cn++;
      if (cn==K) {
        printf("l:%d\n", i);
        break;
      }
    }
  }
    */

  m.resize(10*20);
  for (i=0; i<20; i++) {
    m[i] = 1;
  }
  for (i=1; i<=19; i++) {
    m[i*10] = m[(i-1)*10]+m[(i-1)*10+1];
    for (j=1; j<=8; j++) {
      m[i*10+j] = m[(i-1)*10+j]+m[(i-1)*10+j+1]+m[(i-1)*10+j-1];
    }
    m[i*10+9] = m[(i-1)*10+8]+m[(i-1)*10+9];
  }
  for (i=0; i<=19; i++) {
    for (j=1; j<=9; j++) {
      sum+=m[i*10+j];
//printf("sum=%d(%d) (%d,%d)\n", sum , m[i*10+j], i, j);
      if (sum>=K) {
        fin = true;
        break;
      }
    }
    if (fin) break;
  }

//printf("sum=%d %d,%d\n", sum, i, j);

  // i:����
  ans=ten(i)*j;
  while (sum>K) {
    i--;
    if (j<9) {
      k=j+1;
    } else {
      k=j;
    }
    for (;k>=j-1; k--) {
//printf("(%d,%d) sum=%d, m[%d,%d]=%d\n", i, k, sum, i, k, m[i*10+k]);
      if (sum-m[i*10+k] == K) {
        j = k;
        sum -= m[i*10+j];
        j--;
        break;
      }
      if (sum-m[i*10+k] > K) {
        sum -= m[i*10+k];
        continue;
      }
      j = k;
      break;
    }
    ans += ten(i)*j;
  }
//printf("i=%d j=%d\n", i, j);
  while (i>0) {
    i--;
    if (j<9) j++;
    ans += ten(i)*j;
  }
  printf("%ld\n", ans);

  return 0;
}
bool islun(int n) {
  int p,q;

  p=n%10;
  n/=10;
  for (; n>0; n/=10) {
    q = n%10;
    if (p-q > 1 ||  p-q < -1) break;
    p = q;
  }
  if (n>0) return false;
  return true;
}
long ten(int k) {
  long ret;
  for(ret=1; k>=1; k--) {
    ret *= 10;
  }
  return ret;
}
/*
     0  1  2  3  4  5  6  7  8  9
  1  1  1  1  1  1  1  1  1  1  1
  2  2  3  3  3  3  3  3  3  3  2
  3  5  8  9  9  9  9  9  9  8  5
  4 13 22 26 27 27 27 27 26 22 13
  1���͂��ׂă����������F9��
  2�� 10,11,12,
      21,22,23,
      ...,
      87,88,89,
      98,99: 3*8+2=26��
  3�� 100,101,
      110,111,112,
      121,122,123,
      210,211,212,
      221,222,223,
      232,233,234,
      321,322,323,
      332,333,334,
      343,344,345,
  ...
      765,766,767,
      776,777,778,
      787,788,789,
      876,877,878,
      887,888,889,
      898,899,
      987,988,989,
      998,999
                                           :8+9*6+8+5=75
  4�� 1000,1001,1010,1011,1012,1100,1101,1110,1111,1112,
      1121,1122,1210,1211,1212,1221,1222,1223,1232,1233,1234
  
  N->K-N
  
  */


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

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

    int cnt_0 = 0, cnt_1 = 0;
    for(int i = 0; i < S.size(); i++){
        if(i % 2 == 0){
            if(S[i] == '1')
                cnt_0++;
            if(S[i] == '0')
                cnt_1++;
        }
        else{
            if(S[i] == '0')
                cnt_0++;
            if(S[i] == '1')
                cnt_1++;
        }
    }
    
    int ans = min(cnt_0, cnt_1);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define MOD 998244353
#define pb push_back
#define ll long long int
#define con 1000000007
using namespace std;


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll i,j,m,n,k;
    ll t;
    string s;
    cin>>n;
    ll sum=0;
    unordered_map<ll,ll> m1;
    for(i=0;i<n;i++)
    {
        cin>>m;
        sum+=m;
        m1[m]++;
    }
    cin>>t;
    while(t--)
    {
        cin>>j>>k;
        sum=sum-(m1[j]*j)+(m1[j])*k;
        m1[k]+=m1[j];
        m1[j]=0;
        cout<<sum<<"\n";
    }
}


Measured memory_bytes: 6988
#include<bits/stdc++.h>
#define  ll   long long int
#define  sz   20010

using namespace std;

ll num[10];

int main()
{

    ll n,i,j,k,a,b,d,p,x,y,m,sm=0;

    cin>>n;

    string s;
    while(n--)
    {
        cin>>s;
        if(s[0]=='M')num[1]++;
        if(s[0]=='A')num[2]++;
        if(s[0]=='R')num[3]++;
        if(s[0]=='C')num[4]++;
        if(s[0]=='H')num[5]++;
    }

    for(i=1;i<=5;i++)
    {
        for(j=i+1;j<=5;j++)
        {
            for(k=j+1;k<=5;k++)
            {
                d=num[i]*num[j]*num[k];

                sm+=d;
            }
        }
    }
    cout<<sm<<endl;

    return 0;
}


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

int main()
{
    int n, k;
    cin >> n >> k;
    int a[200005];
    for(int i = 0; i < n; i++) cin >> a[i];
    for(int i = k; i < n; i++){
        if(a[i] > a[i - k]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}


Measured memory_bytes: 4428
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    int x, y, temp, i = 1;

    while(scanf("%d %d",&x, &y))
    {
        if(x==0 && y==0)
            break;

        temp = x;
        x = y;
        y = temp;

        if(x<y)
            cout<<x<<" "<<y<<endl;
        else
            cout<<y<<" "<<x<<endl;

        i++;
    }

    return 0;
}



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

int main() {
    int n;
    cin >> n;
    int A[n];
    rep(i, n) {
        int a;
        cin >> a;
        a--;
        A[i] = a;
    }

    int ans = 0;
    rep(i, n) if (i == A[A[i]]) ans++;

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


Measured memory_bytes: 640
#include <iostream>
using namespace std;
string s;
string ans = "";
void dfs(int i,int sum,string t){
      if(i == 3){
            if(sum == 7){
                  ans =  t + "=7";
            }
            return;
      }else{
            dfs(i + 1,sum + (s[i + 1] - '0'),t + "+" + s[i + 1]);
            dfs(i + 1,sum - (s[i + 1] - '0'),t + "-" + s[i + 1]);
      }
}
int main(void){
    cin >> s;
    dfs(0,s[0] - '0',s.substr(0,1));
    cout << ans << endl;
}


Measured memory_bytes: 3640
#include<stdio.h>
int main(){
  int n,i,co,t,nt,r=1,d[100010]={0};
  int q[100010],f[100010]={1};
  scanf("%d",&n);//printf("a\n");
  for(i=0;i<n;i++)scanf("%d",&d[i]);//printf("a\n");
  for(i=0;i<6;i++)f[n+i]=1;//printf("a\n");
  for(t=q[0]=0;f[n-1]==0;t++){
    co=f[q[t]]+1;//printf("%d\n",q[t]);
    for(i=0;i<6;i++){
      for(nt=q[t]+i+1;f[nt]==0;nt+=d[nt])f[nt]=co;
      if(d[nt]==0&&f[nt]==co)q[r++]=nt;
    }
  }
  //for(i=0;i<n;i++)printf("%d\n",f[i]);
  printf("%d\n",co-1);
  return 0;
}

Measured memory_bytes: 1684
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
struct node
{
	long long v,w;
	long double t;
}a[5];
bool cmp(node a,node b)
{
	return a.t<b.t;
}
int main()
{
	long long n;
	scanf("%lld %lld %lld %lld",&a[1].v,&a[2].v,&a[3].v,&a[4].v);
	scanf("%lld",&n);
	a[1].w=25;
	a[2].w=50;
	a[3].w=100;
	a[4].w=200;
	for(int i=1;i<=4;i++)
	{
		a[i].t=1.0*a[i].v/a[i].w;
	}
	sort(a+1,a+5,cmp);
	n*=100;
	long long sum=0,m;
	for(int i=1;i<=4;i++)
	{
		m=n/a[i].w;
		sum+=a[i].v*m;
		if(n%a[i].w==0)
		{
			break;
		}
		n=n%a[i].w;
	}
	printf("%lld\n",sum);
}

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

using namespace std;

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

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

  int qon;
  cin >> qon;

  queue<pair<string, int>> process;
  queue<pair<string, int>> ans;
  int time = 0;

  rep(i, N){
    string tmp;
    int sec;
    cin >> tmp >> sec;
    process.push(make_pair(tmp, sec));
  }

  while(!process.empty()){
    if(process.front().second <= qon){
      time += process.front().second;
      ans.push(make_pair(process.front().first, time));
      process.pop();
    }
    else{
      pair<string, int> ps;
      ps.first = process.front().first;
      ps.second = process.front().second - qon;
      process.pop();
      process.push(ps);
      time += qon;
    }
  }

  while(!ans.empty()){
    cout << ans.front().first << " " << ans.front().second <<endl;
    ans.pop();
  }
}



Measured memory_bytes: 6188
/***
	chauhan176's code

	Nothing Happens , It's True
***/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define ld long double
#define fi first
#define se second
#define mod 1000000007
#define maxn 300005
#define all(v) v.begin(),v.end()
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define go_t int t;cin>>t;for(int tt=1;tt<=t;tt++)
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define trace2(x, y)             cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)       cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;

typedef pair<int,ll>pi;
const ll inf = 1e10;//0x3f3f3f3f3f3f3f3fll;//4x10e18
const int maxx = 10000000;
#define PI 3.14159265
int main()
{
    fastio;
    int r;
    cin>>r;
    cout<<pow(r,2)<<endl;
    return 0;
}


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

int main(){

string S;
cin >> S;

int min_x=S.size() , max_y = 0;

	for(int i = 0; i < S.size(); i++){ 
		if(S.at(i) == 'A'){
			min_x = min(min_x, i);	
		}else if(S.at(i) == 'Z'){
			max_y = (max_y, i);	
		}
	}
if(max_y > min_x){
cout << max_y - min_x + 1 << endl;
}
/*
int ans = 0, max_ans = 0;
bool flag = false, flag2 = false;

	for(int i = 0; i < S.size(); i++){ 
		
		if(S.at(i) == 'A'){
			
			flag = true;
			ans++;
			
		}else if(S.at(i) == 'Z' && flag == true){
			ans++;
			flag2 = true;
		}else if(S.at(i) != 'Z' && flag2 == true){
			flag = false;
			flag2 = false;			
			max_ans = max(max_ans , ans);
			ans = 0;
		}else if(flag == true){
			ans++;	
		}
	}
	
	max_ans =max(max_ans , ans);
	cout << max_ans << endl;
*/


}


Measured memory_bytes: 640
/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;

int main()
{   
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    ll x;
    cin >> x;

    ll ans=0;
    ans+=1000*(x/500);
    x%=500;
    ans+=5*(x/5);
    cout << ans ;    
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string s[1000000];
int main()
{
    int n,l;
    cin>>n>>l;
    for(int i=1;i<=n;i++)
        cin>>s[i];
    sort(s+1,s+1+n);
    for(int i=1;i<=n;i++)
        cout<<s[i];
    return 0;
}

Measured memory_bytes: 8064
#include "iostream"
using namespace std;
int main(){
  string a[4]={"A","C","G","T"};
  string b[4]={"T","G","C","A"};
  string c;
  cin>>c;
  for(int i=0;i<4;i++){
    if(a[i]==c){
      cout<<b[i]<<endl;
      break;
    }
  }
}


Measured memory_bytes: 3592
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define MOD (ll)1000000000000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;
#define MAX 100005



int main(){
    ll n; cin >> n;
    vector<string> s(n);
    rep(i,n){
        cin >> s[i];
        sort(all(s[i]));
    }
    sort(all(s));
    vl ans;
    ll cnt=0;
    //rep(i,n) cout << s[i] << endl;
    rep(i,n-1){
        if(s[i].compare(s[i+1]) == 0) cnt++;
        else if(cnt > 0){
            ans.push_back(cnt);
            cnt = 0;
        }
    }
    if(cnt > 0) ans.push_back(cnt);
    ll sum = 0;
    rep(i,ans.size()){
        //cout << ans[i] << endl;
        sum += (ans[i])*(ans[i]+1)/2;
    }
    cout << sum << endl;
}


Measured memory_bytes: 7552
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
const int INF = numeric_limits<int>::max();

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

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

    return 0;
}


Measured memory_bytes: 1792
#include<cstdio>
#include<bits/stdc++.h>
typedef long long int ll;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR_IN(i, a, b) for(int i = (a); i < (b); i++)
#define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b))
#define BIT(b, i) (((b) >> (i)) & 1)
#define LOG_F 1
#define LOG(...) if(LOG_F) fprintf(stderr, __VA_ARGS__)

using namespace std;

ll pow(int x, int n){
  return n == 0 ? 1 : x * pow(x, n - 1);
}


/*
x
a
b
 */
int x,a,b;

int main(){
  cin>>x>>a>>b;
  cout << (x-a)%b<<endl;

  return 0;
}


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

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

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

	cin >> n;

	ll pre = 0, ans = 1;
	for(int i=1; i<=2*n; i++){
		char c; cin >> c;
		int op = (c == 'B');
		if(op == (pre&1)){		// ]
			ans = ans * pre % MOD; 
			pre--;
		}else{		// [
			pre++;
		}
	}

	if(pre != 0){
		cout << 0;
	}else{
		for(int i=1; i<=n; i++)
			ans = ans * i % MOD;
		cout << ans;
	}

	return 0;
}


Measured memory_bytes: 256
#include <iostream>

#define REP(i, a, b) for ( int i = (a); i < (b); i++ )
#define REVREP(i, a, b) for ( int i = (a); i >= (b); i--)
#define DEBUG_INT(var) printf("the value of "#var" is %d\n", var)
#define PRINT_ARRAY(name, i) printf("the value of "#name"[%d] is %d\n", (i), name[(i)])
#define DEBUG_ARRAY(name, begin, end) REP(i, begin, end) PRINT_ARRAY(name, i)

using namespace std;

typedef long long ll;

int A, B;

int main(void) {
    scanf("%d %d", &A, &B);
    
    printf("%d\n", (A-1)*(B-1));

	return 0;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N;
    cin >> N;
    vector<ll> S(N);
    rep(i, N) cin >> S[i];
    ll Q;
    cin >> Q;
    vector<ll> T(Q);
    rep(i, Q) cin >> T[i];
    ll ans = 0;
    rep(i, Q) {
        ll t = T[i];
        if (binary_search(S.begin(), S.end(), t)) {
            ans++;
        }
    }
    cout << ans << '\n';
}

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



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

using namespace std;

struct I{I(){ios::sync_with_stdio(false);cin.tie(0);}}init;

typedef long long LL;
typedef vector<LL> V;
typedef vector<V> VV;
const LL MOD=1e9+7;

LL f(LL v,int n){
    if(n==0)return 1;
    else return v*f(v,n-1)%MOD;
}
int main(){
    int d;cin>>d;
    V l(d);for(auto &it:l)cin>>it;
    int s;cin>>s;
    sort(l.begin(),l.end());
    VV dp(2,V(s+1,0));
    dp[0][s]=1;
    for(int i=0;i<d;i++){
        VV nxt=dp;
        for(int j=0;j<2;j++)
            for(int k=l[i]+1;k<=s;k++){
                (nxt[1-j][k-l[i]]+=dp[j][k])%=MOD;
            }
        swap(nxt,dp);
    }
    LL res=0;
    for(int i=1;i<=s;i++){
        LL mul=f(i,d);
        V sgn({1,-1});
        for(int j=0;j<2;j++){
            (res+=MOD+sgn[j]*(mul*dp[j][i]%MOD))%=MOD;
        }
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 5636