akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <set>

using namespace std;

int main(void){
    int n;
    cin>>n;
    
    set<long int> s;
    set<long int> ss;
    long int a[n];
    long int b[n];
    for(int i=0;i<n;i++){
        b[i]=0;
        cin>>a[i];
        if(s.find(a[i])==s.end()){
            s.insert(a[i]);
        }else{
            if(ss.find(a[i])==ss.end()){
                ss.insert(a[i]);
                b[i]=a[i];
                //cout<<b[i]<<endl;
            }else{
                ss.erase(a[i]);
            }
        }
    }
    sort(b,b+n);
    reverse(b,b+n);
    cout<<b[0]*b[1]<<endl;
    return 0;
}

Measured memory_bytes: 6528
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define VFOR(x,begin,num) for(int x=(begin);x<((begin)+(num));x++)
#define INF_ ((long long)1 << 60)
int main(){
    int A[4][4],N,b[15],flg = 0;
    VFOR(i,1,3){VFOR(j,1,3){cin >> A[i][j];}}
    cin >> N;
    VFOR(i,0,N) cin >> b[i];
    VFOR(i,1,3){
        VFOR(j,1,3){
            VFOR(k,0,N){
                if(A[i][j] == b[k]){
                    A[i][j] = -1;
                    k = 100000;
                }
            }
        }
    }
    VFOR(i,1,3){
        int tmp = 1;
        VFOR(j,1,3){
            if(A[i][j] != -1){tmp = 0;}
        }
        if(tmp){flg = 1;}
    }
    VFOR(j,1,3){
        int tmp = 1;
        VFOR(i,1,3){
            if(A[i][j] != -1){tmp = 0;}
        }
        if(tmp){flg = 1;}
    }
    if(A[1][1]==-1 && A[2][2] == -1 && A[3][3]== -1){flg=1;}
    if(A[1][3]==-1 && A[2][2] == -1 && A[3][1]== -1){flg=1;}
    if(flg)cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 256
module practiceA
  sub Main(ByVal args() as String)
    dim n,m as integer
    dim arr(2) as string
    dim ac(100000) as integer
    dim wa(100000) as integer
    arr=Split(Console.ReadLine())
    n=arr(0):m=arr(1)
    dim i as integer
    dim pn as integer
    dim res as string
    dim good, bad as integer
    for i = 0 to n-1
    	ac(i) = 0
    	wa(i) = 0
  	next
    for i = 0 to m-1
	    arr=Split(Console.ReadLine())
    	pn=arr(0)-1:res=arr(1)
  		if res = "WA" and ac(pn) = 0 then
    		wa(pn) = wa(pn) + 1
    	end if
      	if res = "AC" then
        	ac(pn) = 1
    	end if
  	next
    for i = 0 to n-1
		good = good + ac(i)
		bad = bad + wa(i)*ac(i)
  	next
  Console.Write(good)
  Console.Write(" ")
  Console.Write(bad)
end sub
end module

Measured memory_bytes: 27608
M,D = map(int,input().split())
ans = 0
for d in range(22,D+1):
    s = str(d)
    if s[1]<"2":continue
    for m in range(1,M+1):
        if eval(s[0]+"*"+s[1])==m:
            ans+=1
print(ans)

Measured memory_bytes: 3060
/*   _/                _/                 _/_/_/   _/
  _/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
   _/     _/    _/   _/     _/    _/  _/_/_/     _/
  _/     _/    _/   _/     _/    _/  _/    _/   _/
   _/_/   _/_/       _/_/   _/_/      _/_/     _/ */
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
using ll=long long;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=1e18;
using P=pair<int,int>;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  string s,ans="";
  cin >> s;
  for(int i=0; i<s.size(); i++) {
    if(s[i]=='0') {
      ans+='0';
    }
    else if(s[i]=='1') {
      ans+='1';
    }
    else if(s[i]=='B'&&ans.size()) {
      ans.erase(ans.size()-1);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <functional>

using namespace std;
typedef long long int ll;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)

int main(){
  int D, G;
  cin >> D >> G;
  int p[D], c[D];
  rep(i, D) cin >> p[i] >> c[i];

  int ans = 1000;
  repi(bit, 0, 1 << D){
    int cost = 0, score = 0;
    int mask = 1;
    rep(i, D){
      if(bit & mask){
        cost += p[i];
        score += p[i] * 100 * (i + 1) + c[i];
      }
      mask <<= 1;
    }
    // printf("%d %d %d\n", bit, score, cost);
    rrep(i, D){
      if(bit & (1 << i)) continue;
      if(p[i] * 100 * (i+1) + score <= G){
        cost += 1000;
        break;
      }
      while(G > score){
        score += 100 * (i+1);
        cost++;
      }
      break;
    }
    // printf("%d %d %d\n", bit, score, cost);
    ans = min(ans, cost);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		if (N==M) {
			System.out.println("Yes");
		} else {
			System.out.println("No ");
		}
	}
}

Measured memory_bytes: 22100
def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    weights = list(map(lambda x: int(x), inputs[0].split()))
    min = None
    for i, _ in enumerate(weights):
        sum_head = sum(weights[0:i])
        sum_tail = sum(weights[i:])
        diff = abs(sum_head - sum_tail)
        if not min:
            min = diff
        elif min > diff:
            min = diff

    return min


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)


Measured memory_bytes: 3064
#include<stdio.h>
int main(void){
int n,m;
  scanf("%d%d",&n,&m);
  int a[m],sum=0;
  for(int i=0;i<m;i++){
    scanf("%d",&a[i]);
    sum+=a[i];
  }
  if(sum>n)printf("-1");
  else printf("%d",n-sum);
  return 0;
}

Measured memory_bytes: 1740
#include <iostream>
#include <string>
#include <deque>

int main()
{
    std::string initial;

    std::cin >> initial;

    int queryCount = 0;
    std::cin >> queryCount;

    std::deque<std::string::value_type> work(initial.begin(), initial.end());

    bool inverted = false;
    for (auto count = 0; count < queryCount; ++count)
    {
        int instruction = 0;
        std::cin >> instruction;
        if (instruction == 1)
        {
            inverted = !inverted;
        }
        else
        {
            int option = 0;
            std::cin >> option;
            bool optionInvert = inverted;
            if (option == 1)
            {
                optionInvert = !optionInvert;
            }

            char append = '\0';
            std::cin >> append;

            if (optionInvert)
            {
                work.push_front(append);
            }
            else
            {
                work.push_back(append);
            }
        }
    }

    if (inverted)
    {
        std::cout << std::string(work.rbegin(), work.rend());
    }
    else
    {
        std::cout << std::string(work.begin(), work.end());
    }
    
    return 0;
}

Measured memory_bytes: 1280
#include <cstdio>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

typedef long long ll;

ll id2x[60];
ll id2y[60];

struct P {
  ll x, y;
};

P ps[60];
int cs[60][60];

int main(void) {
  int n, k;
  scanf("%d%d", &n, &k);
  REP(i, n) {
    scanf("%lld%lld", &ps[i].x, &ps[i].y);
    id2x[i] = ps[i].x;
    id2y[i] = ps[i].y;
  }
  id2x[n+1] = 1000000000 + 1;
  id2y[n+1] = 1000000000 + 1;
  sort(id2x, id2x + n+1);
  sort(id2y, id2y + n+1);
  REP(ix, n+1) {
    REP(iy, n+1) {
      ll x = id2x[ix];
      ll y = id2y[iy];
      int cnt = 0;
      REP(i, n) {
        if(ps[i].x <= x && ps[i].y <= y) {
          ++cnt;
        }
      }
      cs[ix+1][iy+1] = cnt;
    }
  }
  ll res = 4e18;
  REP(ix2, n+1) {
    REP(ix1, ix2) {
      REP(iy2, n+1) {
        REP(iy1, iy2) {
          int cnt = cs[ix2+1][iy2+1] - cs[ix2+1][iy1] - cs[ix1][iy2+1] + cs[ix1][iy1];
          // cerr << cnt << " " << endl;
          if(cnt >= k) {
            ll area = (id2x[ix2] - id2x[ix1]) * (id2y[iy2] - id2y[iy1]);
            if(area < res) {
              res = area;
            }
          }
        }
      }
    }
  }
  printf("%lld\n", res);
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();

		String[][] map = new String[H][W];
		for(int i=0; i<H; i++){
			for(int j=0; j<W; j++){
				map[i][j] = "0";
			}
		}

		for(int i=0; i<H; i++){
			String S = sc.next();
			for(int j=0; j<W; j++){
				String str = String.valueOf(S.charAt(j));
				if(str.equals("#")){
					map[i][j]="#";
					if(i+1!=H&&!(map[i+1][j].equals("#"))){
						map[i+1][j] = String.valueOf(Integer.parseInt(map[i+1][j])+1);
						if(j-1!=-1&&!(map[i+1][j-1].equals("#"))){
							map[i+1][j-1] = String.valueOf(Integer.parseInt(map[i+1][j-1])+1);;
						}
						if(j+1!=W&&!(map[i+1][j+1].equals("#"))){
							map[i+1][j+1] = String.valueOf(Integer.parseInt(map[i+1][j+1])+1);;
						}
					}
					if(i-1!=-1){
						if(!(map[i-1][j].equals("#"))){
							map[i-1][j] = String.valueOf(Integer.parseInt(map[i-1][j])+1);
						}
						
						if(j-1!=-1&&!(map[i-1][j-1].equals("#"))){
							map[i-1][j-1] = String.valueOf(Integer.parseInt(map[i-1][j-1])+1);;
						}
						if(j+1!=W&&!(map[i-1][j+1].equals("#"))){
							map[i-1][j+1] = String.valueOf(Integer.parseInt(map[i-1][j+1])+1);;
						}
					}
					if(j-1!=-1&&!(map[i][j-1].equals("#"))){
						map[i][j-1] = String.valueOf(Integer.parseInt(map[i][j-1])+1);
					}
					if(j+1!=W&&!(map[i][j+1].equals("#"))){
						map[i][j+1] = String.valueOf(Integer.parseInt(map[i][j+1])+1);
					}
				}
			}
		}

		for(int i=0; i<H; i++){
			String str = "";
			for(int j=0; j<W; j++){
				str += map[i][j];
			}
			System.out.println(str);
		}
    }
}


Measured memory_bytes: 40180
import itertools

l = []
for i in range(5):
    l.append(int(input()))

lp = []
for i in itertools.permutations(l):
    lp.append(i)

min_ = 10 ** 10

# lpi: list
for lpi in lp:
    t = 0
    t += lpi[0]
    if t % 10 != 0:
        x = t % 10
        t += 10 - x

    t += lpi[1]
    if t % 10 != 0:
        x = t % 10
        t += 10 - x
    t += lpi[2]
    if t % 10 != 0:
        x = t % 10
        t += 10 - x
    t += lpi[3]
    if t % 10 != 0:
        x = t % 10
        t += 10 - x
    t += lpi[4]
    min_ = min(min_, t)

print(min_)


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

int main(){
  vector<int> N(4);
  string ans;
  for(int i = 0; i < 4; i++){
    char c;
    cin >> c;
    N.at(i) = c - '0';
  }
  
  for(int b = 0; b < (1<<3); b++){
    int sum = N.at(0);
    for(int i = 0; i < 3; i++){
      if(b & (1<<i)){
        sum += N.at(i + 1);
      }
      else{
        sum -= N.at(i + 1);
      }
    }
    if(sum == 7){
      ans = to_string(N.at(0));
      for(int i = 0; i < 3; i++){
        if(b & (1<<i)){
          ans += '+' +to_string(N.at(i + 1));
        }
        else{
          ans += '-' +to_string(N.at(i + 1));
        }
      }
      break;
    }
  }
  cout << ans << "=7" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x,a,b;
  cin >> x >>a >> b;
  
  if(abs(x-a)>abs(x-b)){
    cout << 'B' << endl;
  }else{
    cout << 'A' << endl;
  } 
}

Measured memory_bytes: 3524
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll a[100010];
int main() {
	ll n;
	cin>>n;
	for(ll i=0;i<n;i++){
		ll now;
		cin>>now;
		a[now]++;
	}
	bool ch=true;
	if(n%2==0){
		ll cnt=0;
		ll now=0;
		while(cnt!=n){
			if(now%2==0){
				if(a[now]!=0){
				ch=false;
				}
			}
			else{
				if(a[now]!=2){
					ch=false;
				}
			}
			cnt+=a[now];
			now++;
		}
	}
	else{
		ll cnt=0;
		ll now=0;
		while(cnt!=n){
			if(now%2!=0){
				if(a[now]!=0){
				ch=false;
				}
			}
			else{
				if(now==0){
					if(a[now]!=1){
						ch=false;
					}
				}
				else if(a[now]!=2){
					ch=false;
				}
			}
			cnt+=a[now];
			now++;
		}		
	}
	if(ch!=true){
		cout << 0;
		return 0;
	}
	ll ans=1;
	for(ll i=0;i<n/2;i++){
		ans*=2;
		ans%=inf;
	}
	cout <<ans;
	return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
 
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl
 
typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
const int inf = 1000000001;
const ll INF = 1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
 
int main(){
  int h,w,i,j;
  cin>>h>>w;
  vi cnt(26);
  for(i=0;i<h*w;i++){
    char c;
    cin>>c;
    cnt[c-'a']++;
  }
  vi cnt2(26);
  int sum = 0;
  for(i=0;i<26;i++){
    cnt2[i] = cnt[i] % 4;
    sum+=cnt2[i];
  }
  bool flag = true;
  if(w%2 == 0 && h%2 == 0){
    if(sum != 0){
      flag = false;
    }
  }
  else if(w%2 == 1 && h%2 == 0){
    if(sum > h){
      flag = false;
    }
    for(i=0;i<26;i++){
      if(cnt2[i]%2 == 1){
	flag = false;
      }
    }
  }
  else if(w%2 == 0 && h%2 == 1){
    if(sum > w){
      flag = false;
    }
    for(i=0;i<26;i++){
      if(cnt2[i]%2 == 1){
	flag = false;
      }
    }
  }
  else{
    if(sum > h + w - 1){
      flag = false;
    }
    int cnt3 = 0;
    for(i=0;i<26;i++){
      if(cnt2[i]%2){
	cnt3++;
      }
    }
    if(cnt3>1){
      flag = false;
    }
  }
  if(flag){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
    
}
      


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

int main() {
   std::string s;
   std::string t;
   std::cin >> s >> t;
   for (size_t i = 0; i < s.size(); i++) {
      if (s.compare(t) == 0) {
         std::cout << "Yes" << '\n';
         return 0;
      } else {
         char tmp;
         tmp = t.at(0);
         for (size_t j = 0; j < t.size() - 1; j++) {
            t.at(j) = t.at(j + 1);
         }
         t.at(t.size() - 1) = tmp;
         //std::cout << t << '\n';
      }
   }
   std::cout << "No" << '\n';
}


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


int main(){

	double num,score,alpha;

	for (;;){
		cin >> num;
		if (num == 0)break;

		vector<double> students;//??°????????????????????§????????????????¢????

		double m = 0.0;//?????????????????????

		for (int i = 0; i < num; i++){
			cin >> score;
			students.push_back(score);
			m += score;
		}	m /= num;
	

		alpha = 0.0;

		for (int i = 0; i < num; i++){



			alpha += ((students[i] - m)*(students[i] - m));
		}
		alpha /= num;


		if (alpha == 0){ cout <<(double)0.00000000000000<<endl; }
		else{
		cout << printf("%.10f", sqrt(alpha)) << endl;
	}

	}//??°???????????????

	return 0;
}

Measured memory_bytes: 1324
fn main() {
    let hn = read_vec::<u64>();
    let h = hn[0];
    let v = read_vec::<u64>();
    let sum: u64 = v.iter().sum();

    if h > sum {
        println!("No");
    } else {
        println!("Yes");
    }
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

Measured memory_bytes: 6396
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn read_touple<T: std::str::FromStr + Copy>() -> (T, T) {
  let v: Vec<T> = read_vec();
  assert_eq!(v.len(), 2);
  (v[0], v[1])
}

fn main() {
    let n: usize = read();
    let mut ans = 0;
    let mut d = vec![(0, 0); n+1];
    for i in 1..n+1 {
      d[i] = digit_top_last(i);
      //println!("{}, {:?}", i, d[i]);
    }
    for i in 1..10 {
      for j in 1..10 {
        let c = count(n, i, j, &d) * count(n, j, i, &d);
        //println!("i = {}, j = {}, count = {}", i, j, count(n, i, j));
        ans += c;
      }
    }
    println!("{}", ans);
}

fn digit_vec(n: usize) -> Vec<usize> {
  let mut res = Vec::new();
  let mut n = n;
  while n > 0 {
    let x = n % 10;
    res.push(x);
    n /= 10;
  }
  res
}

fn digit_top_last(n: usize) -> (usize, usize) {
  let v = digit_vec(n);
  let l = v.len();
  (v[l-1], v[0])
}

fn count(n: usize, i: usize, j: usize, d: &Vec<(usize, usize)>) -> usize {
  let mut res = 0;
  for x in 1..n+1 {
    let (top, last) = d[x];
    if i == top && j == last {
       res += 1;
    }
  }
  res
}

Measured memory_bytes: 8444
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


N, Q = MAP()
ab = [LIST() for _ in range(N-1)]
px = [LIST() for _ in range(Q)]

graph = defaultdict(list)

for a, b in ab:
	graph[a-1].append(b-1)
	graph[b-1].append(a-1)

dic = defaultdict(int)

for p, x in px:
	dic[p-1] += x

check = [0]*N
check[0] = 1

ans = [0]*N

q = deque([0])

while q:
	n = q.popleft()
	ans[n] += dic[n]
	for node in graph[n]:
		if check[node]:
			continue
		ans[node] += ans[n]
		check[node] = 1
		q.append(node)

print(*ans)




Measured memory_bytes: 148888
private fun readInts() = readLine()!!.split(" ").map(String::toInt)

fun main(args: Array<out String>) {
    val (N, K) = readInts()
    val h = readInts()

    val costs = Array(N) { 0 }

    (0 until N).forEach { index ->
        costs[index] = (1..K)
            .filter { k -> index - k >= 0 }
            .map { k -> costs[index - k] + Math.abs(h[index] - h[index - k]) }
            .min()
            ?: 0
    }

    println(costs[N - 1])
}

Measured memory_bytes: 120804
#include <algorithm>
#include <cstddef>
#include <iostream>

using namespace std;

int main() {
    int D;
    cin >> D;
    cout << "Christmas";
    if (D < 25) cout << " Eve";
    if (D < 24) cout << " Eve";
    if (D < 23) cout << " Eve";
    cout << endl;
    return 0;
}

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

int main(){
  string s;
  int cnt=0;
  cin >> s;
  for(char c: s){
    if(c=='o')cnt++;
  }
  cout << (cnt+(15-s.length())>=8 ? "YES" : "NO");
  return 0;
}


Measured memory_bytes: 760
#include <stdio.h>
int main(){
	char s[25];
	
	scanf("%s",&s);
	
	for(int i=0;s[i] !='\0';i++){
		if(s[i] ==','){
			printf(" ");
		}
		else {
			printf("%c",s[i]);
		}
	}
	return 0;
}

Measured memory_bytes: 1644
using System;
namespace Code1
{	
	class MainClass
	{
		class Vector2 {
			public Vector2(int x, int y){
				this.x = x;
				this.y = y;
			}
			public int x;
			public int y;
		}

		public static void Main (string[] args)
		{
			string input = Console.ReadLine ();
			switch (input) {
			case "a":
			case "i":
			case "u":
			case "e":
			case "o":	
				Console.WriteLine ("vowel");
				break;
			default:
				Console.WriteLine ("consonant");
				break;
			}
			/*
			string heightAndWidthString = Console.ReadLine ();
			var heightAndWidth = heightAndWidthString.Split (' ');
			var height = int.Parse (heightAndWidth [0]);
			var width = int.Parse (heightAndWidth [1]);

			string[] pathRaws = new string[height];
			while (true) {
				var pathRow = Console.ReadLine ();
				if (pathRow == "") {
					break;
				}
			}
			char[, ] pathCells = new char[width, height];
			var i = 0;
			var j = 0;
			foreach (string pathRaw in pathRaws) {
				j++;
				foreach (char cell in pathRaw) {
					pathCells [i, j] = cell;
					i++;
				}
			}
			if (Possible (width, height, pathCells)) {
				Console.WriteLine ("Possible");
			} else {
				Console.WriteLine ("Impossible");
			}
*/

		}

		/*
		public static bool Possible(int width, int height, char[, ] pathCells) {
			var currentCell = new Vector2 (0, 0);
			while (currentCell.x != width - 1 || currentCell.y != height - 1) {
				var ableToMoveCount = 0;
				// 右に進める
				if (currentCell.x != width - 1 && pathCells [currentCell.x + 1, currentCell.y] == '#') {
					ableToMoveCount++;
					currentCell.x++;
				}
				// 下に進める
				if (currentCell.y != height - 1 && pathCells [currentCell.x, currentCell.y + 1] == '#') {
					ableToMoveCount++;
					currentCell.y++;
				}
				if (ableToMoveCount != 1) {
					return false;
				}
			}
			return true;

		}
		*/
	}
}

Measured memory_bytes: 2648
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
r = int(input())

ans = 3*r**2

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する



Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=5e15;

int main() {
  ll n,m;
  cin >> n >> m;
  priority_queue<pll,vector<pll>,greater<pll>> q;
  for(ll i=0;i<m;i++) {
    ll a,b;
    cin >> a >> b;
    q.push({b,a});
  }
  ll cnt=0;
  ll id=-1;
  while(q.size()) {
    ll l=q.top().second;
    ll r=q.top().first;
    q.pop();
    if(id<=l) {
      id=r;
      cnt++;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 2420
#include <algorithm>
#include <array>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;

constexpr double EPS = 1e-7;
constexpr int INF = 1e9;
constexpr ll LINF = 1e18;
#define PI (acos(-1))

constexpr int MOD = 1e9 + 7;

int main(int argc, char const *argv[]) {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);

	int A, B;
	cin >> A >> B;

	if (min(A, B) == 1 && max(A, B) == 2) {
		cout << 3 << endl;
	}
	if (min(A, B) == 2 && max(A, B) == 3) {
		cout << 1 << endl;
	}
	if (min(A, B) == 1 && max(A, B) == 3) {
		cout << 2 << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;

void max_self(ll& a, ll b) {
    a = max(a, b);
}
void min_self(ll& a, ll b) {
    a = min(a, b);
}

const ll INF = 1e18L + 5;

int main() {
    int n, W;
    scanf("%d%d", &n, &W);
    vector<int> weight(n), value(n);
    for(int i = 0; i < n; ++i) {
        scanf("%d%d", &weight[i], &value[i]);
    }
    int sum_value = 0;
    for(int x : value) {
        sum_value += x;
    }
    vector<ll> dp(sum_value + 1, INF); // 0 ... W
    dp[0] = 0;
    // dp[i] - the minimum total weight of items with total value exactly i
    for(int item = 0; item < n; ++item) {
        for(int value_already = sum_value - value[item]; value_already >= 0; --value_already) {
        //~ for(int weight_already = 0; weight_already <= W - weight; ++weight_already) {
            min_self(dp[value_already+value[item]], dp[value_already] + weight[item]);
        }
    }
    ll answer = 0;
    for(int i = 0; i <= sum_value; ++i) {
        if(dp[i] <= W) {
            answer = max(answer, (ll) i);
        }
        //~ min_self(answer, dp[i]);
    }
    printf("%lld\n", answer);
}

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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 1e9+7;


int main(){
	//ios_base::sync_with_stdio(false);
	int c[5][5];

	rep(i,3) rep(j,3) cin >> c[i][j];

	rep(a1, 101) rep(a2, 101) rep(a3, 101){
		bool f = true;
		int b[3] = {};
		rep(i,3){
			chmax( b[i], c[i][0] - a1 );
			chmax( b[i], c[i][1] - a2 );
			chmax( b[i], c[i][2] - a3 );
		}
		rep(i,3){
			f &= ( c[i][0] == a1 + b[i] );
			f &= ( c[i][1] == a2 + b[i] );
			f &= ( c[i][2] == a3 + b[i] );
		}
		if( f ){
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;

	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 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 rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define repc2(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define inf 2e9
#define linf 9000000000000000000ll
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int n;
vector<ll> arr, mm, pm;

int main() {
    cin >> n;
    arr.resize(n);
    mm.resize(n);
    pm.resize(n);
    rep(i, n) {
        scanf("%lld", &arr[i]);
        mm[i] = -i - arr[i];
        pm[i] = i - arr[i];
    }
    sort(all(mm));
    sort(all(pm));
    ll ans = 0;
    rep(i, n) {
        ll a1 = arr[i] + i;
        ll a2 = arr[i] - i;
        ans += upper_bound(all(pm), a1) - lower_bound(all(pm), a1);
        ans += upper_bound(all(mm), a2) - lower_bound(all(mm), a2);
        if (a1 == i - arr[i]) {
            ans--;
        }
        if (a2 == -i - arr[i]) {
            ans--;
        }
    }
    cout << ans / 2 << endl;
    return 0;
}

Measured memory_bytes: 7948
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x); i<=(y); i++)
#define per(i,x,y) for (int i=(x); i>=(y); i--)
#define ll long long
#define ld long double
#define inf 1000000000
#define INF 1000000000000000000ll
#define pii pair<int,int>
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define sqr(x) ((x)*(x))
#define cmin(x,y) (x)=(((y)<(x))?(y):(x))
#define cmax(x,y) (x)=(((y)>(x))?(y):(x))
using namespace std;
const ld pi=acos(-1);
const ld eps=1e-8;
//////////////////////// header files ////////////////////////
ll read(){
	char ch=getchar(); ll x=0; int op=1;
	for (; !isdigit(ch); ch=getchar()) if (ch=='-') op=-1;
	for (; isdigit(ch); ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
	return x*op;
}
void write(ll a){
	if (a<0) putchar('-'),a=-a;
	if (a>=10) write(a/10); putchar(a%10+'0');
}
////////////////////////// fast i/o //////////////////////////
#define N 100005
int n,a[N];
//#define local
int main(){
#ifdef local
	freopen("test.in","r",stdin); freopen("test.out","w",stdout);
#endif
	int ans=0; n=read();
	rep (i,1,n) a[i]=read(); a[0]=a[n+1]=0;
	rep (i,0,n) ans+=abs(a[i+1]-a[i]);
	rep (i,1,n) cout<<ans-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1])<<endl;
	return 0;
}
//sample data:
/*
=======
3
3 5 -1

12
8
10

=======
5
1 1 1 2 0

4
4
4
2
4

=======
6
-679 -2409 -3258 3095 -3291 -4462

21630
21630
19932
8924
21630
19288

*/

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

typedef long long ll;
typedef pair<int,int> P;

const int INT = 1e9;
const int mod = 1e9+7;

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

    int i = 0;
    while(++i){
        if(i*(i+1)/2 >= x){
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
/* Simplicity and Goodness */

#include <bits/stdc++.h>
using namespace std;
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ",n)
#define pri(n) printf("%d ",(int)n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define deb(x) cout << #x << ' ' << x << '\n'
#define rep(i,ini,n) for(int i=ini;i<(int)n;i++)
#define per(i,ini) for(int i=ini;i>=0;i--)
#define tc int tt; scn(tt); while(tt --)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 998244353;
const int N = 2e5+2;


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

    if(s == "ARC")
    cout << "ABC";
    else
    cout << "ARC";

    return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>

int count = 0;

void merge(int*, int, int, int);
void mergeSort(int*, int, int);

int main(){
  int i, n;
  scanf("%d", &n);
  int A[n];
  for(i = 0 ; i < n ; i++) scanf("%d", &A[i]);
  mergeSort(A, 0, n);
  for(i = 0 ; i < n ; i++){
    if(i != n - 1)printf("%d ", A[i]);
    else printf("%d\n", A[i]);
  }
  printf("%d\n", count);
}

void merge(int *A, int left, int mid, int right){
  int n1 = mid - left;
  int n2 = right - mid;
  int i, L[n1 + 1], R[n2 + 1];
  for(i = 0 ; i < n1 ; i++) L[i] = A[left + i];
  for(i = 0 ; i < n2 ; i++) R[i] = A[mid + i];
  L[n1] = 1000000000;
  R[n2] = 1000000000;
  i = 0;
  int j = 0, k;
  for(k = left ; k < right ; k++){
    if(L[i] <= R[j]){
      A[k] = L[i];
      i++;
    }
    else{
      A[k] = R[j];
      j++;
    }
    count++;
  }
}

void mergeSort(int *A, int left, int right){
  if(left + 1 < right){
    int mid = (left + right)/2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}



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

#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define lg long long
#define db double
#define lb(x) ((x)&-(x))
#define ft first
#define sd second

#define HII cerr<<"HI"<<endl
#define LLLINE cerr<<"@@@@@@@@@@@@@@@@@@@@"<<endl

template <class _T_>
void read(_T_& d){
	d=0;int f=1;char c=getchar();
	for(;c<'0'||c>'9';c=getchar())if(c=='-')f*=-1;
	for(;c>='0'&&c<='9';c=getchar())d=d*10+c-'0';
	d*=f;
}

/************************************************/
#define MN 205
int n;
vector<int> G[MN];
int dis[MN][MN];
int L,R;
int d[MN];
void dfs(int x,int fa,int dep){
	int D=0;
	for(int v:G[x])if(v!=fa){
		++D;
		dfs(v,x,dep+1);
	}
	d[dep]=max(D,d[dep]);
}
lg tryit(int x,int y){
	//cerr<<x<<' '<<y<<"!"<<endl;
	for(int i=0;i<=n;++i)d[i]=1;
	dfs(x,y,1);
	if(y!=x)dfs(y,x,1),++d[0];
	lg res=1;
	for(int i=0;i<=n;++i){
		res=res*d[i];
	}return res;
}
int main(){
	read(n);
	memset(dis,0x3f,sizeof dis);
	for(int i=1,x,y;i<n;++i){
		read(x);read(y);
		G[x].pb(y);dis[x][y]=1;
		G[y].pb(x);dis[y][x]=1;
	}
	for(int k=1;k<=n;++k){
		for(int i=1;i<=n;++i)if(i!=k){
			for(int j=1;j<=n;++j)if(j!=k&&j!=i){
				dis[i][j]=min(dis[i][k]+dis[k][j],dis[i][j]);
			}
		}
	}
	dis[0][0]=0;
	for(int i=1;i<=n;++i){
		for(int j=i+1;j<=n;++j){
			if(dis[i][j]<0x3f3f3f3f&&dis[i][j]>dis[L][R])L=i,R=j;
		}
	}
	for(int i=1;i<=n;++i)dis[i][i]=0;
	int T=dis[L][R];lg res=0x3f3f3f3f3f3f3f3f;
	printf("%d ",T/2+1);
	if(T&1){
		for(int i=1;i<=n;++i){
			for(int j=1;j<=n;++j){
				if(dis[i][j]==1&&dis[L][i]+dis[i][j]+dis[j][R]==T&&abs(dis[i][L]-dis[j][R])<=1){
					res=min(res,tryit(i,j));
				}
			}
		}
	}else{
		for(int i=1;i<=n;++i){
			if(dis[L][i]+dis[i][R]==T&&dis[i][L]==dis[i][R]){
				res=min(res,tryit(i,i));
				for(auto v:G[i])res=min(res,tryit(i,v));
			}
		}
	}
	printf("%lld\n",res);
	return 0;
}


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

int main() {
    int n, m;
    cin >> n >> m;
    vector<pair<int,int>> ab(n);
    for (int i = 0; i < n; i++) {
        cin >> ab.at(i).first;
        cin >> ab.at(i).second;
    }
    vector<pair<int,int>> cd(m);
    for (int i = 0; i < m; i++) {
        cin >> cd.at(i).first;
        cin >> cd.at(i).second;
    }

    vector<pair<int, int>> ans(n);
    for (int i = 0; i < n; i++) {
        ans.at(i).first = 1;
        ans.at(i).second = 500000000;
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            int tmp = abs(ab.at(i).first - cd.at(j).first) + abs(ab.at(i).second - cd.at(j).second);
            if (tmp < ans.at(i).second) {
                ans.at(i).first = j + 1;
                ans.at(i).second = tmp;
            }
        }
        cout << ans.at(i).first << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<algorithm>
#include <numeric>
using namespace std;

long long GCD(long long a, long long b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}

int main(){
  int N;
  cin >> N;
  int a[N];
  for(int i=0;i<N;i++){
   cin >> a[i]; 
  }
  int ans=0;
  for(int i=0;i<N;i++){
   ans+=a[i]-1; 
  }
  int g=a[0];
  for(int i=0;i<N;i++){
    g=GCD(g,a[i]);
  }
  cout << ans << endl;
  return 0;}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
/*int graph[50][50];

int n, m;
int bfs();*/

int main() {

	//A
	int a, b, c;
	cin >> a >> b >> c;
	if (a == b) {
		cout << c;
	}
	else if (a == c) {
		cout << b;
	}
	else {
		cout << a;
	}
	cout << endl;
	return 0;

	//B
	/*char p[52][52];
	int i, j;
	int h, w;
	cin >> h >> w;
	for (i = 0; i <= h+1; i++) {
		for (j = 0; j <= w+1; j++) {
			if ((i == 0) || (j == 0) || (i == h + 1) || (j == w + 1)) {
				p[i][j] = '.';

			}
			else {
				cin >> p[i][j];
			}
		}
	}
	int counter;
	int ii, jj;
	for (i = 1; i <= h; i++) {
		for (j = 1; j <= w; j++) {
			if (p[i][j] == '.') {
				counter = 0;
				for (ii = -1; ii <= 1; ii++) {
					for (jj = -1; jj <= 1; jj++) {
						if (p[i + ii][j + jj] == '#') {
							counter++;
						}
					}
				}
				p[i][j] = counter + '0';
				
			}
			cout << p[i][j];
		}
		cout << endl;
	}
	return 0;*/

	//C
	/*cin >> n >> m;

	//queue<int> graph[50];
	//int graph[50][50];
	int i,j,a,b;
	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			graph[i][j] = 0;
		}
	}
	for (i = 0; i < m; i++) {
		cin >> a >> b;
		graph[a - 1][b - 1] = 1;
		graph[b - 1][a - 1] = 1;
	}
	//cout << graph[1][6];
	int counter = 0;

	for (i = 0; i < n; i++) {
		for (j = i; j < n; j++) {
	//i = 1; j = 6;
			if (graph[i][j] == 1) {
				graph[i][j] = 0;
				graph[j][i] = 0;

				if (bfs() == 0) {
					counter++;
					//cout << i << ' ' << j << endl;
				}

				graph[i][j] = 1;
				graph[j][i] = 1;
			}
		}
	}
	cout << counter << endl;
	return 0;
	*/


	//D
	/*
	long long int x[50], xs[50], y[50], ys[50];
	int n, k;
	cin >> n >> k;
	int i1,i2,j1,j2,i,l;
	for (i = 0; i < n; i++) {
		cin >> x[i] >> y[i];
		xs[i] = x[i]; ys[i] = y[i];
	}
	sort(xs, xs + n);
	sort(ys, ys + n);
	int counter;
	long long int rectangle = 4000000000000000000;
	for (i1 = 0; i1 < n-1; i1++) {
		for (j1 = i1 + 1; j1 < n; j1++) {
			for (i2 = 0; i2 < n - 1; i2++) {
				for (j2 = i2 + 1; j2 < n; j2++) {
					if ((xs[j1] - xs[i1]) * (ys[j2] - ys[i2]) < rectangle) {


						counter = 0;
						for (i = 0; i < n; i++) {
							if ((x[i] >= xs[i1]) && (x[i] <= xs[j1]) && (y[i] >= ys[i2]) && (y[i] <= ys[j2])) {
								counter++;
							}
						}
						if (counter >= k) {
							rectangle = (xs[j1] - xs[i1]) * (ys[j2] - ys[i2]);
						}
					}
				}
			}
		}
	}
	cout << rectangle << endl;
	return 0;
	*/
}
/*int bfs() {
	int i, j;
	int edge[50];
	for (i = 0; i < n; i++) {
		edge[i] = 0;
	}
	queue<int> q;
	q.push(0);
	edge[0] = 1;
	int x;
	while (q.size()>0) {
		//cout << 'a';
		x = q.front(); q.pop();
		for (i = 0; i < n; i++) {
			//cout << 'a';
			//cout << x << ' ' << i << endl;
			if (i != x) {
				if (graph[x][i] == 1) {
					if (edge[i] == 0) {
						//cout << x << ' ' << i << endl;
						edge[i] = 1;
						q.push(i);
						//cout << i << endl;
					}
				}
			}
		}

	}
	for (i = 0; i < n; i++) {
		if (edge[i] == 0) {
			//cout << i << endl;
			return 0;
		}
	}
	return 1;
	
}*/

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 solve() {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    vector<ll> ans(N);
    rep(i, N) {
        ans[i] = A[i];
    }
    rep(k, K) {
        vector<ll> imos(N + 5, 0);
        rep(i, N) {
            ll mi = max(0LL, i - A[i]);
            ll ma = min(N, i + A[i]);
            imos[ma + 1]--;
            imos[mi]++;
        }
        rep(i, N + 4) {
            imos[i + 1] += imos[i];
        }
        rep(i, N) {
            A[i] = imos[i];
        }
        rep(i, N) {
            ans[i] = A[i];
        }
        bool ok = true;
        rep(i, N) {
            if (ans[i] != N) {
                ok = false;
            }
        }
        if (ok) {
            break;
        }
    }
    rep(i, N) {
        cout << ans[i] << ' ';
    }
    cout << '\n';
}

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


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

const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;
const int MOD = 1000000007;

typedef long long ll;

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

ll LCM(ll x, ll y)
{
    return x * y / GCD(x, y);
}

using Graph = vector<vector<int>>;

typedef pair<int, int> P;

vector<int> to[200005]; //vector<int> の配列
vector<int> ans;

int main()
{
    map<map<char, int>, ll> dic;

    int n;
    cin >> n;
    rep(i, n)
    {
        string s;
        cin >> s;
        map<char, int> cnt;
        rep(j, 10)
        {
            if (!cnt.count(s.at(j)))
                cnt[s.at(j)] = 1;
            else {
                cnt[s.at(j)]++;
            }
        }

        if (!dic.count(cnt)) {
            dic[cnt] = 1;
        } else {
            dic[cnt]++;
        }
    }

    ll sum = 0;
    for (auto e : dic) {
        if (e.second >= 2) {
            sum += e.second * (e.second - 1) / 2;
        }
    }

    cout << sum << endl;
}


Measured memory_bytes: 53888
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;

const int MAX_N = 5e1 + 5;
int n, m;
string table[MAX_N];
int dx[] = {-1, 0, 0, +1};
int dy[] = {0, -1, +1, 0};

bool in (int x, int y) {
	return 0 <= x && 0 <= y && x < n && y < m;
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n >> m;
	for (int i = 0; i < n; i++)
		cin >> table[i];

	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			if (table[i][j] == '#') {
				int cnt = 0;
				for (int k = 0; k < 4; k++)
					if (in(i + dx[k], j + dy[k]) && table[i + dx[k]][j + dy[k]] == '#') {
						cnt++;
						break;
					}

				if (!cnt) {
					cout << "No\n";
					return 0;
				}
			}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pp long long int
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define rzip(i,a,b) for(int i=a;i>=b;i--)
#define ll unsigned long long int
#define test int t;cin>>t; while(t--)
#define um unordered_map
#define en '\n'
#define us unordered_set
typedef pair<int, int>     pii;
typedef pair<char, int>    pci;
typedef pair<char, char>   pcc;
typedef vector<pii>       vii;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define INF (1e18+5)
#define inf (1e9+5)
#define mod 1000000007


bool check_prime(long long n)
{
	int flag = 0;
	for (long long i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			flag = 1;
			break;
		}
	}
	if (n == 1)
		return false;
	else if (flag == 0 || n == 2 || n == 3)
	{
		return true;
	}
	else
	{
		return false;
	}

}

int BE(int x, int n, int m) //function to calculate x raise to power n modulo m
{
	int result = 1;
	while (n > 0)
	{
		if (n % 2 == 1)
			result = result * x % m;
		x = x * x % m;
		n = n / 2;
	}
	return result;
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	if (fopen("input.txt", "r"))
	{
		freopen ("input.txt" , "r" , stdin);
		freopen ("output.txt" , "w" , stdout);
	}
#endif
	//_______________________________-code starts-_______________________________________________
	string s, t;
	cin >> s >> t;
	int n = s.size();
	int cnt = 0;
	zip(i, 0, n)
	{
		if (s[i] != t[i])
			cnt++;
	}
	cout << cnt << en;


	return 0;
}



Measured memory_bytes: 3824
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f,x,y;
	int i,j,k;
	while(cin>>a>>b>>c>>d>>e>>f){
		y=(c*d/a-f)/(b*d/a-e);
		x=(c-b*y)/a;
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}
	

Measured memory_bytes: 1236
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		final Scanner scanner = new Scanner(System.in);
		final String string = scanner.nextLine();

		String answerString = "";

		for (int i = 0; i < string.length(); i++) {
			String temp = "";
			for (int j = i; j < string.length() && isATCG(string.charAt(j)); j++) {
				temp += String.valueOf(string.charAt(j));
			}
			if (temp.length() > answerString.length())
				answerString = temp;
		}
		System.out.println(answerString.length());
		scanner.close();
	}

	public static boolean isATCG(final char chara) {
		if (chara == 'A' || chara == 'T' || chara == 'C' || chara == 'G')
			return true;
		return false;
	}

}

Measured memory_bytes: 23892
N = int(input())
a = list(map(int, input().split()))
 
i = 0
odd = 0
while odd == 0:
    for n in range(N):
        if a[n] % 2 == 0:
            a[n] /= 2
        else:
            odd = 1
            break
    if odd == 0:
        i += 1
print(i)

Measured memory_bytes: 3188
import java.util.Scanner;
import java.util.Vector;

class Main{
  public static void main(String[] av){
    Scanner sc = new Scanner(System.in);

    Vector<Integer> vec = new Vector<Integer>();
    while(sc.hasNextInt()){
      vec.add( sc.nextInt() );
    }
    int M = 1000000;
    boolean [] e = new boolean[M];
    e[0] = e[1] = true;
    for ( int i = 2; i < Math.sqrt(M); i++ ){
      if ( e[i] == false ){
        for ( int f = i*2; f < M; f += i ){
          e[f] = true;
        }
      }
    }
      
    for ( Integer x: vec ){
      int cnt = 0;
      for ( int i=2; i <= x; i++ ){
        if ( e[i] == false ){
          cnt++;
        }
      }
      System.out.println( cnt );
    }
  }
}

Measured memory_bytes: 22204
#include "bits/stdc++.h"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/operators.hpp>
#include <boost/dynamic_bitset.hpp>
namespace adaptor = boost::adaptors;
using index_t = std::size_t;

namespace lib
{
	using graph_t = std::vector<std::set<index_t>>;
	template<class T>using weighted_graph_t = std::vector<std::map<index_t, T>>;

	struct max_t
	{
		template<class T>T operator()(T&& lhs, T&& rhs)const
		{
			return std::max(lhs, rhs);
		}
	};
	struct min_t
	{
		template<class T>T operator()(T&& lhs, T&& rhs)const
		{
			return std::min(lhs, rhs);
		}
	};

	template<class T>auto order_by(T func)
	{
		return [=](auto&& lhs, auto&& rhs)
		{
			return func(lhs) < func(rhs);
		};
	}

	template<class T>constexpr auto max_v = std::numeric_limits<T>::max();
	template<class T>constexpr auto min_v = std::numeric_limits<T>::min();
}

void Main()
{
	int N, M;
	std::cin >> N >> M;
	if (N % 2 == 1)
	{
		N = 2 * M;
		for (auto i : boost::irange(M))
		{
			std::cout << i + 1 << " " << N - i << std::endl;
		}
	}
	else
	{
		auto p = N / 4 + bool(N % 4);
		for (auto i : boost::irange(1, M + 1))
		{
			if (p <= i)
			{
				std::cout << i + 1 << " " << N - i << std::endl;
			}
			else
			{
				std::cout << i + 1 << " " << N - i + 1 << std::endl;
			}
		}
	}
}

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

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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

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


void solve(long long A, long long B, long long C){
    if(A % 2 == 0 || B % 2 == 0 || C % 2 == 0) {
        cout << 0 << endl;
        return;
    }

    VLL memo;
    memo.PB(A);
    memo.PB(B);
    memo.PB(C);

    sort(ALL(memo));
    cout << memo[0] * memo[1] << endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    solve(A, B, C);
    return 0;
}


Measured memory_bytes: 256
import collections

N = int(input())
A = [0] * N

for i in range(N):
    A[i] = input()
B = collections.Counter(A)    
C = B.most_common()
Max = B.most_common()[0]

Ans =[]
for i in C:
    if Max[1] == i[1]:
        Ans.append(i[0])
    else:
        break
Ans = sorted(Ans)
for i in Ans:
    print(i)

Measured memory_bytes: 120816