akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int m,n,a,b,c;
    cin>>m>>n;
    a=m-1;
    b=n-1;
    if(n<=1)
    {
        if(m<=1) cout<<0;
        if(m>1) cout<<m*a/2;
    }
    if(n>1)
    {
        if(m<=1) cout<<n*b/2;
        if(m>1) cout<<(m*a/2)+(n*b/2);
    }
    return 0;
}

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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
#define test cout<<"test"<<endl;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void ans(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
void debug(vector<vector<ll>>v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j]<<" ";cout<<endl;}};
void debug(vector<string>v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}
//m.emplace(x,0).fi->second++;

int main(){
  ll i,j,o;
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  ll s;cin>>s;
  ll ls=(ll)sqrt(s);
  if(s==ls*ls){
    cout<<0 spa 0 spa ls spa 0 spa 0 spa ls<<endl;
  }
  else{
    ll lss=ls;
    ls++;
    ll p=s-lss*lss,q=ls*ls-s;
    //cout<<ls spa lss spa p spa q<<endl;
    if(p<q){
      cout<<0 spa 1 spa lss spa 0 spa p spa lss+1<<endl; 
      //cout<<(lss*lss-p*(-1))<<endl; 
    }
    else{
      cout<<0 spa 0 spa ls spa 1 spa q spa ls<<endl;
    }
  }

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int,int>P;
typedef long long ll;

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

int main(){
	int n;cin>>n;
	map<string,int>mp;
	rep(i,n){
		string s;cin>>s;
		sort(s.begin(),s.end());
		mp[s]++;
	}
	ll ans=0;
	for(auto p:mp){
		ans+=p.second*(ll)(p.second-1)/2;
	}
	cout<<ans<<endl;
}


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

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

  long long n;
  cin >> n;

  int result = 0;
  for (long long i = 2; i * i <= n; ++i) {
    if (n % i != 0) continue;
    int c = 0, j = 1;
    while (n % i == 0) n /= i, ++c;
    while (c >= j) {
      ++result;
      c -= j;
      ++j;
    }
  }

  if (n > 1) ++result;

  cout << result << '\n';
}

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

int main()
{
	int a, b, c, x;
	cin >> a >> b >> c >> x;
	int ans = 0;
	for (int i = 0; i < a+1; ++i)
	{
		for (int j = 0; j < b+1; ++j)
		{
			for (int k = 0; k < c+1; ++k)
			{
				ans += (i * 500 + j * 100 + k * 50 == x);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

int main() {
	long long h;
	cin >> h;

	long long n_monster = 1;

	long long ans = 0;
	while (h > 0) {
		ans += n_monster;
		h /= 2;
		n_monster *= 2;
	}

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


Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#pragma region Macros
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define all(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define CEIL(a,b) ((a+b-1)/b)
int GCD(int a, int b) // assuming a,b >= 1
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	if (a % b == 0)
		return b;
	return GCD(b, a % b);
}
int LCM(int a, int b) // assuming a,b >= 1
{
	return  a * b / GCD(a, b);
}
inline bool BETWEEN(int x, int min,int max) {
	if (min <= x && x <= max)
		return true;
	else
		return false;
}
using namespace std;
#pragma endregion
signed main() {
	char S[4];
	rep(i,4)
		cin >>S[i] ;
	if ((S[0] == S[1] && S[1] == S[2]) || (S[1] == S[2] && S[2] == S[3]))
		cout << "Yes";
	else
		cout << "No";
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<limits>
#include<iomanip>
#include<cmath>
#include<climits>
using namespace std;

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

const int mod=1e9+7;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,h,w;
    cin >> n >> h >> w;
    cout << (n-h+1)*(n-w+1) << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0093
???????????´
"""
import sys

def is_leap(year):
    ''' ?????????????????´??? ???????????´ ???????????????True/False??§?????? '''
    if year % 400 == 0:
        return True
    elif year % 100 == 0:
        return False
    elif year % 4 == 0:
        return True
    else:
        return False


def main(args):
    is_first__dataset = True
    leap_years = []  # ???????????´????????????
    # ??????????????\???
    while True:
        start_year, end_year = [int(x) for x in input().strip().split(' ')]
        if start_year == 0 and end_year == 0:
            break
        else:
            # ???????????????
            leap_years = []
            for year in range(start_year, end_year+1):
                if is_leap(year):
                    leap_years.append(year)

        # ???????????????
        if is_first__dataset == True:
            is_first__dataset = False
        else:
            print('')  # ????????????????????????1????????????

        if len(leap_years) == 0:
            print('NA')
        else:
            print('{0}'.format('\n'.join(map(str, leap_years))))

if __name__ == '__main__':
    main(sys.argv[1:])

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


int main (){
  int n;
  int a[200010];
  int ans[200010]={0};
  cin >> n;

  for(int i = 2; i <= n; i++){
    cin >> a[i];
    ans[a[i]]++;
  }
  for(int i = 1; i <= n; i++){
    cout << ans[i] << endl;
  }

}


Measured memory_bytes: 5140
#include <algorithm>
#include <math.h>
#include <iostream>
#include <vector>
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<ll(b);i++)
#define repr(i,a,b) for(ll i=a;i>=ll(b);i--)
#define endl "\n"
#define ALL(x) x.begin(),x.end()
#define ALLR(x) x.rbegin(),x.rend()
using namespace std;

int n;
int main() {
	cin >> n;
	vector<ll> a(n); rep(i, 0, n) cin >> a[i];


	double alog = 0;
	rep(i, 0, n){
		// 0が含まれているか
		if(a[i] == 0){
			cout << "0" << endl;
			return 0;
		}

		// 配列全部の積の桁数を求める
		alog += log10(a[i]);
	}

	// 1e18 を大きく超えているか
	if(alog > 18){
		cout << "-1" << endl;
		return 0;
	}

	// 積を求める
	ll ans = 1;
	rep(i, 0, n){
		ans *= a[i];
		if(ans > 1000000000000000000){
			cout << "-1" << endl;
			return 0;
		}
	}

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


Measured memory_bytes: 3552
N,L = (int(x) for x in input().split())
taste = []
for x in range(int(N)):
  taste.append(str(L+(x+1)-1))
p_taste = sum(int(x) for x in taste)
n_1_taste = []
t_taste= taste.copy()
t_i = 0
for y in t_taste:
  taste.remove(str(y))
  sum_taste = sum(int(x) for x in taste)
  n_1_taste.append(sum_taste)
  taste.append(str(y))
  t_i+=1
if p_taste in n_1_taste:
  print(p_taste)
elif str(L).startswith("-"):
  print(min(n_1_taste))
else:
  print(max(n_1_taste))

Measured memory_bytes: 3064
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0

for i in range(n):
    ans += b[a[i]-1]
    if i < n-1 and a[i] - a[i+1] == -1:
        ans += c[a[i]-1]

print(ans)

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

int main(){
	int n;
	cin>>n;
	for (int i=n/4+1;i<=3500;i++){
		for (int j=i;j<=3500;j++){
			long long k=(long long)i*j*n;
			long long p=(long long)4*i*j-n*i-n*j;
			if (p>0){
				if (k%p==0 && k/p<=3500){
					cout<<i<<" "<<j<<" "<<k/p<<endl;
					return 0;
				}
			}
		}
	}
} 

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

using namespace std;

int main()
{
  int N;

  cin >> N;
  map< int, int > mp;
  for(int i = 0; i < N; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  vector< int > beet;
  for(auto &p : mp) {
    if(p.second >= 4) beet.push_back(p.first);
    if(p.second >= 2) beet.push_back(p.first);
  }

  sort(begin(beet), end(beet));
  reverse(begin(beet), end(beet));
  if(beet.size() <= 1) cout << 0 << endl;
  else cout << 1LL * beet[0] * beet[1] << endl;
}

Measured memory_bytes: 4992
import java.util.Scanner;

public class Main{

	static Scanner s = new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	static int h, w, n, k, f[][];

	private static void input(){
		h = s.nextInt();
		w = s.nextInt();
		n = s.nextInt();
		k = s.nextInt();
		f = new int[h][w];
	}

	private static void solve(){
		//loop:
		for(int i = 0; i < h; i++){
			int rowsum = question(i, 0, i, w-1);
			for(int j = 0; j < w-1&&rowsum!=0; j++){
				f[i][j] = question(i, j, i, j);
				rowsum-=f[i][j];
			}
			f[i][w-1]=rowsum;
		}

		long pow = 1, result = 0;
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				result += f[i][j] * pow;
				result %= k;
				pow *= 2;
				pow %= k;
			}
		}

		answer(result);
	}

	private static final int question(int x1, int y1, int x2, int y2){
		System.out.printf("? %d %d %d %d\n", x1, y1, x2, y2);
		return s.nextInt();
	}

	private static final void answer(long a){
		System.out.printf("! %d\n", a);
	}
}


Measured memory_bytes: 35664
import sys
     
n, k = map(int, sys.stdin.readline().split())
     
snukes = [1] * n
     
for _ in range(k):
  n = int(sys.stdin.readline())
  nums = list(map(int, sys.stdin.readline().split()))
  for num in nums:
    snukes[num - 1] = 0

print(sum(snukes))


Measured memory_bytes: 9156
#<D>wa
#(Point)
#優先度付きキューを使いこなす！
#最大値を1/2するのをＭ回繰り返せばいいけどリストやと最大値の選定にO(N),
#それをＭ回やからO(MN)でＴＬＥ
#heapqやったらO(MlogN)なのでおｋ
import heapq
N, M = map(int,input().split())
#最大値取り出すためにリストの要素をすべてマイナスに
A = list(map(lambda x:-int(x),input().split()))
heapq.heapify(A) #Ａを優先度付きキューに

for i in range(M):
    value_min = heapq.heappop(A)
    heapq.heappush(A, (-1) * (-value_min//2)) #負数の剰余演算避けるために
    #一時的に０以上の整数にしている
    #*(-1)してやらんと挿入した後の次の最大値を探す作業ができなくなる
    #heapqは最小値しかみつけれんから
    #print(A)
print(-sum(A))

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);

int q;

bool prime[MAX_N];

int cnt[MAX_N];

void prepare() {
  for (int i = 0; i < MAX_N; ++i) {
    prime[i] = true;
  }

  prime[0] = prime[1] = false;

  for (int i = 2; i < MAX_N; i += 2) {
    prime[i] = false;
  }

  prime[2] = true;

  for (int i = 3; i * i < MAX_N; ++i) {
    if (!prime[i]) continue;

    for (int j = i * i; j <= MAX_N; j += i) {
      prime[j] = false;
    }
  }

  for (int i = 2; i < MAX_N; ++i) {
    int other = (i + 1) / 2;
    cnt[i] = cnt[i - 1] + (prime[i] && prime[other] ? 1 : 0);
  }

  // for (int i = 0; i < 100; ++i) {
  //   printf("%d: %d\n", i, prime[i]);
  // };

  // for (int i = 0; i < 100; ++i) {
  //   printf("%d: %d\n", i, cnt[i]);
  // };
}

int main(void) {
  // Here your code !
  scanf("%d", &q);

  prepare();

  for (int i = 0; i < q; ++i) {
    int l, r;
    scanf("%d %d", &l, &r);

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

  return 0;
}


Measured memory_bytes: 1152
#include <stdio.h>

int main()
{
  int A[100][100], b[100], c;
  int m, n, i, j;

  scanf("%d %d", &n, &m);

  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%d", &A[i][j]);
    }
  }
  for (j = 0; j < m; j++) {
    scanf("%d", &b[j]);
  }

  for (i = 0; i < n; i++) {
    c = 0;
    for (j = 0; j < m; j++) {
      c += A[i][j] * b[j];
    }
    printf("%d\n", c);
  }

  return 0;
}



Measured memory_bytes: 2104
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N=100005;
int Head[N],Next[N<<1],Adj[N<<1],tot=0;
int mn[N],pos[N],a[N];
bool vis[N];
inline int read(){
	int x=0;char e=getchar();
	for (;e<'0'||e>'9';e=getchar());
	for (;e>='0'&&e<='9';e=getchar()) x=(x<<1)+(x<<3)+(e^48);
	return x;
}
inline void addedge(int u,int v){
	Next[++tot]=Head[u];
	Head[u]=tot;
	Adj[tot]=v;
	Next[++tot]=Head[v];
	Head[v]=tot;
	Adj[tot]=u;
}
inline void dfs(int x){
	mn[x]=a[x],pos[x]=x;
	vis[x]=true;
	for (int e=Head[x];e;e=Next[e])
		if (!vis[Adj[e]]){
			dfs(Adj[e]);
			if (mn[Adj[e]]<mn[x]) pos[x]=pos[Adj[e]],mn[x]=mn[Adj[e]];
		}
}
int main (){
	int n=read(),m=read();
	memset (mn,0x3f,sizeof(mn));
	for (int i=1;i<=n;i++) a[i]=read();
	for (int i=1;i<=m;i++){
		int u=read()+1,v=read()+1;
		addedge(u,v);
	}
	long long ans=0;int cnt=0;
	for (int i=1;i<=n;i++)
		if (!vis[i]){
			dfs(i);
			cnt++;
			ans+=mn[i],a[pos[i]]=1<<30;
		}
	sort(a+1,a+n+1);
	if ((cnt-1)*2>n){
		printf("Impossible");
		return 0;
	}
	for (int i=1;i<=(cnt-1)*2-cnt;i++) ans+=a[i];
	printf ("%lld",cnt==1?0:ans);
	return 0;
}

Measured memory_bytes: 3456
//大文字->小文字 tolower(),逆はtoupper()
//int a = stoi(c); 文字列をintへ
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//while(N)で回すとき、Nはコピーを作っておく
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//等価なものに変換する思考
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// K進数でのNの桁数
ll dig(ll N,ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b,a%b);
}

ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

//nC2の計算
ll C(ll N) {
	return N * (N - 1) / 2;
}

//円周率
const double PI = 3.14159265358979323846;

int main() {
	string N; cin >> N;
	cout << "ABC" << N << endl;
}

Measured memory_bytes: 256
package main

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

func main() {
	sc := NewScanner(os.Stdin)
	a := make([]int, 5)
	for i := 0; i < 5; i++ {
		a[i] = sc.NextInt()
	}
	k := sc.NextInt()
	for i := 0; i < 5; i++ {
		for j := i + 1; j < 5; j++ {
			if a[j]-a[i] > k {
				fmt.Println(":(")
				return
			}
		}
	}
	fmt.Println("Yay!")
}

func vmin(v []int) int {
	mn := math.MaxInt32
	for i := 0; i < len(v); i++ {
		mn = min(mn, v[i])
	}
	return mn
}

func lcm(x, y int) int {
	x, y = max(x, y), min(x, y)
	if y == 0 {
		return x
	}
	return lcm(y, x%y)
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

// scanner
type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner(r io.Reader) *Scanner {
	rdr := bufio.NewReaderSize(r, 1024)
	return &Scanner{r: rdr}
}

func (s *Scanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		line, isp, err := s.r.ReadLine()
		if err != nil {
			os.Exit(1)
		}
		s.buf = append(s.buf, line...)
		if !isp {
			break
		}
	}
}

func (s *Scanner) NextInt() int {
	i, err := strconv.Atoi(s.Next())
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) NextFloat64() float64 {
	i, err := strconv.ParseFloat(s.Next(), 64)
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	next := string(s.buf[start:s.p])
	s.p++
	return next
}

func (s *Scanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}


Measured memory_bytes: 640
import sys
input = sys.stdin.readline

def main():
    N,M,P = map(int,input().split())
    edges = []


    for _ in range(M):
        A,B,C = map(int,input().split())
        edges.append([A-1,B-1,P-C])

    reachable_from = [False for _ in range(N)]
    reachable_from[0] = True
    reachable_to = [False for _ in range(N)]
    reachable_to[N-1] = True

    for i in range(N-1):
        for edge in edges:
            if reachable_from[edge[0]]:
                reachable_from[edge[1]] = True
            if reachable_to[edge[1]]:
                reachable_to[edge[0]] = True

    edges2 = []
    for edge in edges:
        if reachable_from[edge[0]] and reachable_to[edge[0]]:
            edges2.append(edge)

    inf = 10000*(10**5)
    dist = [inf for _ in range(N)]
    dist[0] = 0

    for i in range(N):
        for edge in edges2:
            if dist[edge[1]] > dist[edge[0]] + edge[2]:
                dist[edge[1]] = dist[edge[0]]+edge[2]
                if i==N-1:
                    print(-1)
                    break
        else:
            continue
        break
    else:
        print(max(0,-1*dist[N-1]))

if __name__ == "__main__":
    main()


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

int main(){
	long long n,a,b;
	cin>>n>>a>>b;
	long long ans=(a+(n-1)*b)-((n-1)*a+b)+1;
	if(a>b) cout<<0<<endl;
	else if(n==1&&a!=b) cout<<0<<endl;
	else if(n==1&&a==b) cout<<1<<endl;
	else cout<<ans<<endl;
}

Measured memory_bytes: 256
n=int(input())
dic={}
for i in range(n):
    s=input()
    if not s in dic:
        dic[s]=1
    else:
        dic[s]+=1
max_val=max(dic.values())
a=sorted([i for i, k in dic.items() if k == max_val])
for i in a:
    print(i)

Measured memory_bytes: 35796
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split();
        int x = int.Parse(input[0]);
        int a = int.Parse(input[1]);
        if (x < a) { Console.WriteLine(0); }
        else { Console.WriteLine(10); }
    }
}


Measured memory_bytes: 13140
#include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

int main() {
  long long a;
  cin>>a;
  long long count=0;
  rep(i,a/2){
    count++;
  }
  if(a%2==0)
    cout<<count-1<<endl;
    else{
      cout<<count<<endl;
    }
}


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

using namespace std;
#define rep(i, N) for(int i=0;i<int(N);++i)
#define rep1(i, N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    os << "{" << p.first << ", " << p.second << "}";
    return os;
}

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

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

const int INF = (ll) 1e9;
const ll INFLL = (ll) 1e18 + 1;
const ll MOD = (ll) 1e9 + 7;
const double PI = acos(-1.0);

/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

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

    int N, M;
    cin >> N >> M;
    vector<int> p(M), q(M), c(M);
    //頂点を拡張する
    //(i, c)を1頂点とみなす
    //(i, -1)を改札としてみる
    vector<l_l> vrx;
    for (int i = 0; i < N; ++i) vrx.emplace_back(i, -1);
    for (int i = 0; i < M; ++i) {
        cin >> p[i] >> q[i] >> c[i];
        p[i]--, q[i]--;
        vrx.emplace_back(p[i], c[i]);
        vrx.emplace_back(q[i], c[i]);
    }
    // 頂点にidxをつける
    //頂点からidxを復元できるようにする
    sort(all(vrx));
    vrx.erase(unique(vrx.begin(), vrx.end()), vrx.end());
    int sz = vrx.size();
    map<l_l, int> p2i;
    for (int i = 0; i < sz; ++i) p2i[vrx[i]] = i;

    //この拡張されたグラフ上に辺を貼っていく
    //駅内の辺
    vvec<l_l> G(sz);
    for (int i = 0; i < sz; ++i) {
        if (vrx[i].second == -1) continue;
        int home = p2i[vrx[i]];
        int cent = p2i[{vrx[i].first, -1}];
        G[home].emplace_back(cent, 0);
        G[cent].emplace_back(home, 1);
    }
    //駅間の辺
    for (int i = 0; i < M; ++i) {
        l_l v1 = {p[i], c[i]};
        l_l v2 = {q[i], c[i]};
        G[p2i[v1]].emplace_back(p2i[v2], 0);
        G[p2i[v2]].emplace_back(p2i[v1], 0);
    }
    vector<ll> dist(sz, INFLL);
    ll s_idx = p2i[{0, -1}];
    ll g_idx = p2i[{N - 1, -1}];
    dist[s_idx] = 0;
    priority_queue<l_l, vector<l_l>, greater<>> pq;
    pq.push({0, s_idx});

    // calc
    while (!pq.empty()) {
        auto tmp = pq.top();
        pq.pop();
        ll d = tmp.first;
        ll from = tmp.second;
        for (auto e: G[from]) {
            int to = e.first;
            int cost = e.second;
            if (dist[to] > dist[from] + cost) {
                dist[to] = dist[from] + cost;
                pq.push({dist[to], to});
            }
        }
    }
    cout << ((dist[g_idx] == INFLL) ? -1 : dist[g_idx]) << endl;
}


Measured memory_bytes: 95976
#include <iostream>

using namespace std;

int main(){
	int K,S;
	cin >> K >> S;
	int X[3];
	for (int i=0; i<3; i++) {
		if (K <= S) {
			X[i] = K;
			S -= K;
		}
		else {
			X[i] = S;
			S = 0;
		}
	}
	int ans = 0;
	for (int i=X[0]; i>=0; i--) {
		int left = X[0] + X[1] + X[2] - i;
		if (left > 2*K) continue;
		if (left >= K) ans += 2*K - left + 1;
		else ans += left + 1;
	}
	cout << ans << endl;

	return 0;
}


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


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

	vector<vector<int>> g(n,vector<int>(n));
	for(int i=0;i<m;i++){
		int x,y;
		cin>>x>>y;
		g[x-1][y-1] = g[y-1][x-1] = 1;
	}

	vector<int> p(n);
	for(int i=0;i<n;i++) p[i] = i;

		int res = 0;
	do {
		bool ok = 1;
		for(int i=0;i<(int)p.size()-1;i++){
			ok&=g[p[i]][p[i+1]];
		}
		if(ok) res++;
	} while(next_permutation(p.begin()+1,p.end()));

	cout<<res;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;

int n, m;
int h1[100], h2[100], r1[100], r2[100];
int next1[100], next2[100];

int calc(int idx, int d, bool init)
{
	static int dp[2][100];
	
	if(init) {
		for(int i = 0; i < n; ++i)
			dp[0][i] = -1;
		for(int i = 0; i < m; ++i)
			dp[1][i] = -1;
	}
	
	int ret = 0;
	
	if((idx < 0) || (d == 0 && idx >= n) || (d == 1 && idx >= m))
		return 0;
		
	if(dp[d][idx] != -1) {
		//printf("%d %d -> %d\n", d, idx, dp[d][idx]);
		return dp[d][idx];
	}
	
	ret = calc(idx + 1, d, false);
	if(d == 0)
		ret = max(ret, calc(next1[idx], 1, false));
	else
		ret = max(ret, calc(next2[idx], 0, false));
	
	//printf("%d %d -> %d\n", d, idx, ret + 1);
	return dp[d][idx] = (ret + 1);
}

int main()
{
	while(true) {
	
		int idx;
		
		scanf("%d", &n);
		if(n == 0)
			break;
		for(int i = 0; i < n; ++i)
			scanf("%d%d", &h1[i], &r1[i]), next1[i] = -1;
		scanf("%d", &m);
		if(m == 0)
			break;
		for(int i = 0; i < m; ++i)
			scanf("%d%d", &h2[i], &r2[i]), next2[i] = -1;
		
		idx = 0;
		for(int i = 0; i < n; ++i) {
			
			while(idx < m) {
				if(h1[i] < h2[idx] && r1[i] < r2[idx])
					break;
				++idx;
			}
			
			if(idx >= m)
				break;
			next1[i] = idx;
		}
		
		idx = 0;
		for(int i = 0; i < m; ++i) {
			
			while(idx < n) {
				if(h2[i] < h1[idx] && r2[i] < r1[idx])
					break;
				++idx;
			}
			
			if(idx >= n)
				break;
			next2[i] = idx;
		}
		
		int ans = calc(0, 0, true);
		ans = max(ans, calc(0, 1, false));
		
		printf("%d\n", ans);
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    for(int i = 0;i < s.size();i++)
    {
        if(s[i] + n <= 'Z')
        {
            s[i] += n;
        }
        else
        {
            s[i] += n - 26;
        }
        cout << s[i];
    }
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <functional>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cassert>
#define SIZE 35

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

int h,w,K;
int A[SIZE][SIZE];
int B[SIZE][SIZE];

ll solve(int depth)
{
	ll ret=0;
	for(int i=0;i<h;i++)
	{
		for(int j=0;j<w;)
		{
			if(B[i][j]==-1)
			{
				j++;
				continue;
			}
			int f=j;
			for(;j<w&&B[i][j]==B[i][f];j++);
			if(j-f>=K)
			{
				for(int k=f;k<j;k++)
				{
					ret+=B[i][k];
					B[i][k]=-1;
				}
			}
		}
	}
	if(ret==0) return 0;
	ret=ret*(1LL<<depth);
	for(int i=0;i<w;i++)
	{
		int last=h-1;
		for(int j=h-1;j>=0;j--)
		{
			if(B[j][i]!=-1)
			{
				if(last>j)
				{
					B[last][i]=B[j][i];
					B[j][i]=-1;
					last--;
				}
				else last--;
			}
		}
	}
	ret+=solve(depth+1);
	return ret;
}
char str[SIZE];
int main()
{
	scanf("%d %d %d",&h,&w,&K);
	for(int i=0;i<h;i++)
	{
		scanf("%s",&str);
		for(int j=0;j<w;j++) A[i][j]=str[j]-'0';
	}
	ll mx=0;
	for(int i=0;i<h;i++)
	{
		for(int j=0;j<w;j++)
		{
			for(int x=0;x<h;x++)
			{
				for(int y=0;y<w;y++) B[x][y]=A[x][y];
			}
			for(int x=i;x>=1;x--) B[x][j]=B[x-1][j];
			B[0][j]=-1;
			mx=max(mx,solve(0));
		}
	}
	printf("%lld\n",mx);
	return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int n, m;
    cin >> n >> m;
    vi a(m);
    for (int i = 0; i < m; ++i) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    vi matches = {-1, 2, 5, 5, 4, 5, 6, 3, 7, 6};
    map<int, int> ma;
    map<int, vi> ma2;
    for (auto &aa : a) {
        ma2[matches[aa]].push_back(aa);
    }
    for (auto &p : ma2) {
        sort(p.second.begin(), p.second.end(), greater<int>());
        ma[p.first] = p.second.front();
    }
    vi dp(n + 1, -1);
    dp[0] = 0;
    for (int i = 1; i <= n; ++i) {
        for (auto &p : ma) {
            if (i - p.first >= 0) {
                chmax(dp[i], dp[i - p.first] + 1);
            }
        }
    }
    sort(a.begin(), a.end(), greater<int>());
    string ret = "";
    int curr   = n;
    bool proc  = false;
    while (curr != 0) {
        proc = false;
        for (auto &aa : a) {
            if (curr - matches[aa] >= 0 && dp[curr - matches[aa]] + 1 == dp[curr]) {
                ret += to_string(aa);
                proc = true;
                curr -= matches[aa];
                break;
            }
        }
        if (!proc)
            curr++;
    }
    cout << ret << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
#include <climits>

using namespace std;

int ary[100000] = {0};
int main() {
    int n, q, c = 0;
    string s;
    cin >> n >> q;
    cin >> s;
    for(int i=1; i<n; i++) {
        if(s[i-1] == 'A' && s[i] == 'C') {
            c++;
        }
        ary[i] = c;
    }
    for(int i=0; i<q; i++) {
        int l, r;
        cin >> l >> r;
        cout << ary[r-1] - ary[l-1] << endl;
    }
}


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

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define dump(x)  cout << #x << " = " << (x) << endl;	//debug
#define SZ(x) ((int)(x).size())
#define REP(i, n) for(ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define ps(s) cout << #s << endl;
#define pv(v) cout << (v) << endl;
#define ALL(a)  (a).begin(),(a).end()
#define RANGE(a, l, r)  (a).begin()+(l),(a).begin()+(r)

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

ll LCM(ll a, ll b)
{
	return a * b / GCD(a, b);
}

int main() {
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	ll q1, q2, q3,val1,val2;
	q1 = b / c;
	q2 = b / d;
	q3 = b / LCM(c, d);
	val1 = b - (q1 + q2 - q3);
	a--;
	q1 = a / c;
	q2 = a / d;
	q3 = a / LCM(c, d);
	val2 = a - (q1 + q2 - q3);
	pv(val1 - val2);

	return(0);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x;
  cin >> n >> x;
  vector<int> m(n);
  for (int i=0;i<n;i++){
    cin >> m[i];
  }
  sort(m.begin(),m.end());
  int sum=0;
  for (int i=0;i<n;i++){
    sum+=m[i];
  }
  cout << n+(x-sum)/m[0] << endl;
}


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

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

    int A = -1, B = -1, C = -1;

    for (int i = 0; i <= N; i++){
        for (int j = 0; j <= N; j++){
            if (10000 * i + 5000 * j + 1000 * (N - i - j) == Y && N - i - j >= 0){
                A = i;
                B = j;
                C = N - i - j;
            }
        }
        
    }
    
    cout << A << " " << B << " " << C << endl;
}

Measured memory_bytes: 256
from collections import Counter

n = int(input())
u = [int(i) for i in input().split()]
e = Counter(u[0::2]).most_common() + [(0, 0)]
o = Counter(u[1::2]).most_common() + [(0, 0)]

if e[0][0] == o[0][0]:
    print(n - max(e[1][1] + o[0][1], e[0][1] + o[1][1]))
else:
    print(n - e[0][1] - o[0][1])


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

int main()
{
    string s, t;
    cin >> s >> t;
    int result;
    if (s.size() + 1 == t.size() && s == t.substr(0, s.size()))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3584
#include <algorithm>
#include <cstdio>

using namespace std;

int main() {
  int n;
  scanf("%d", &n);

  long maxLen = 0;
  long currentLen = 0;

  long prevVal;
  scanf("%ld", &prevVal);
  for (int i = 1; i < n; ++i) {
    long currentVal;
    scanf("%ld", &currentVal);
    if (prevVal < currentVal) {
      maxLen = max(currentLen, maxLen);
      currentLen = 0;
    } else {
      currentLen++;
    }
    prevVal = currentVal;
  }
  maxLen = max(currentLen, maxLen);
  printf("%ld\n", maxLen);
  return 0;
}

Measured memory_bytes: 128
import os, sys, re, math

lines = sys.stdin.readlines()

(N) = int(lines[0])

factors = dict()
for i in range(201):
    for j in range(201):
        m = i * j
        if m <= 200:
            if not m in factors:
                factors[m] = []
            factors[m].append(i)

count = 0
for i in range(1, N + 1, 2):
    if len(factors[i]) == 8:
        count += 1

print (count)


Measured memory_bytes: 3188
#include<iostream>
#include<string>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
	char x, y; cin >> x >> y;
	if ((int)x == (int)y) cout << "=" << endl;
	else if ((int)x > (int)y) cout << ">" << endl;
	else cout << "<" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

template<class T>
struct Dijkstra {
    const T inf = numeric_limits<T>::max() / 2 - 1;
    vector<T> dist;
    vector<int> path;
    
    Dijkstra() {}
    Dijkstra(int n) {
        graph.resize(n);
        dist.resize(n);
        prev.resize(n);
    }
    
    void add_edge(int from, int to, T cost) {
        graph[from].emplace_back(to, cost);
    }
    
    void get_distance(int from) {
        priority_queue<pair<T, int>, vector<pair<T, int>>, greater<pair<T, int>>> pq;
        fill(dist.begin(), dist.end(), inf);
        fill(prev.begin(), prev.end(), -1);
        dist[from] = 0;
        pq.push(make_pair(0, from));
        while(!pq.empty()) {
            pair<T, int> p = pq.top(); pq.pop();
            if (dist[p.second] < p.first) continue;
            for (auto e : graph[p.second]) {
                if (dist[e.first] > (dist[p.second] + e.second)) {
                    dist[e.first] = dist[p.second] + e.second;
                    prev[e.first] = p.second;
                    pq.push(make_pair(dist[e.first], e.first));
                }
            }
        }
    }
    
    void get_path(int to) {
        path = vector<int>(0);
        for (; to != -1; to = prev[to]) {
            path.push_back(to);
        }
        reverse(path.begin(), path.end());
    }
    
private:
    vector<vector<pair<int, T>>> graph;
    vector<T> prev;
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n, m;
    cin >> n >> m;
    Dijkstra<ll> di(n);
    rep(i, n - 1) {
        di.add_edge(i + 1, i, 0);
    }
    rep(i, m) {
        ll l, r, c;
        cin >> l >> r >> c;
        l--; r--;
        di.add_edge(l, r, c);
    }
    di.get_distance(0);
    ll ans = di.dist[n - 1];
    if (ans == di.inf) ans = -1;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 10876
#define M 1000001
T[M],t[M],a;main(m,n,x,i,j){
	for(i=2;i<M;i++)if(!T[i])for(j=i*2;j<M;j+=i)T[j]=1;
	for(;scanf("%d%d",&n,&x),n;printf(m?"%d\n":"NA\n",m))
		for(memset(t,0,sizeof(t)),t[0]=1,m=i=0;i<n;i++)
			for(scanf("%d",&a),j=0;j+a<=x;j++)if(t[j])if(t[j+a]=1,!T[j+a]&&m<j+a)m=j+a;
exit(0);}

Measured memory_bytes: 8420
import collections
N=int(input())
S=[]
for i in range(N):
  s=input()
  S.append(s)

l=collections.Counter(S)
keys=l.keys()
k=max(l.values())
ans=[]
for i in keys:
  if l[i]==k:
    ans.append(i)

ans.sort()
n=len(ans)

for i in range(n):
  print(ans[i])

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

using lnt = long long;
using Real = long double;

#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(lnt i=0;i<(n);++i)
#define RANGE(i, a, b) for(lnt i=(a);i<(b);++i)
#define RREP(i, n) for(lnt i=(n)-1;i>= 0;--i)

#define ln '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define dcout cout<<fixed<<setprecision(20)
#define summon_tourist cin.tie(0);ios::sync_with_stdio(false)

constexpr int dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
constexpr Real eps = 1e-9; const Real pi = acosl(-1);
constexpr lnt BIG = INT_MAX/10, BBIG = LLONG_MAX/10;

template<class T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<class T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<class T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<class T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
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;}

using pint = pair<int, int>; using plnt = pair<lnt, lnt>;
using vint = vector<int>; using vlnt = vector<lnt>;
constexpr lnt MOD = 1e9+7;

int main(){
	summon_tourist;

	lnt N, A[100000], Q, B, C; cin >> N;
	map<lnt, lnt> mp;
	lnt sum = 0;
	REP(i, N){
		cin >> A[i];
		mp[A[i]]++;
		sum += A[i];
	}
	cin >> Q;
	REP(i, Q){
		cin >> B >> C;
		sum += (C-B) * mp[B];
		cout << sum << ln;
		mp[C] += mp[B];
		mp[B] = 0;
	}
}

Measured memory_bytes: 10276
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int x1, y1, x2, y2;
  cin>>x1>>y1>>x2>>y2;
  int vec1 = x2-x1, vec2 = y2-y1;;
  cout<<x2-vec2<<" "<<y2+vec1<<" "<<x1-vec2<<" "<<y1+vec1<<endl;
}


Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll INF=mod*mod;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

 ll gcd(ll m,ll n){
 	if(n==0){
       return m;
     }
   return gcd(n,m%n);
 }
ll lcm(ll a,ll b){
  ll g=gcd(a,b);
  return a/gcd(a,b)*b;
		

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



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,C,D;
  cin >>A>>B>>C>>D;
  
  int ans=0;
  if(A<B)ans+=A;
  else ans+=B;
  if(C<D) ans+=C;
  else ans+=D;
  
  cout<<ans<<endl;
}
  
  
  

Measured memory_bytes: 764
#include <iostream>

using namespace std;
int max(int a,int b)
{
    return a>b?a:b;
}
int main()
{
    int n;
    cin>>n;
    int happy[n*3];
    for(int i=0;i<n*3;i++)
    {
        cin>>happy[i];
    }
    int min1,min2,min3;
    min1=happy[0];
    min2=happy[1];
    min3=happy[2];
    for(int i=3;i<n*3;i+=3)
    {
        int tempmin1,tempmin2,tempmin3;
        tempmin1=max(min2+happy[i],min3+happy[i]);
        tempmin2=max(min1+happy[i+1],min3+happy[i+1]);
        tempmin3=max(min1+happy[i+2],min2+happy[i+2]);
        min1=tempmin1;
        min2=tempmin2;
        min3=tempmin3;
    }
    int d;
    d=max(min1,min2);
    d=max(min3,d);
    cout<<d;
    return 0;
}


Measured memory_bytes: 1408
void main()
{
    string s = rdStr;

    long[] cnts = new long[3];
    foreach (x; s)
    {
        ++cnts[x-'a'];
    }
    cnts.sort!"a < b";

    writeln(cnts[2] - cnts[0] < 2 ? "YES" : "NO");
}

T rdElem(T = long)()
{
    //import std.stdio : readln;
    //import std.string : chomp;
    //import std.conv : to;

    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;

dchar[] rdDchar()
{
    //import std.conv : to;

    return rdStr.to!(dchar[]);
}

T[] rdRow(T = long)()
{
    //import std.stdio : readln;
    //import std.array : split;
    //import std.conv : to;

    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    //import std.range : iota;
    //import std.algorithm : map;
    //import std.array : array;

    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    //import std.range : iota;
    //import std.algorithm : map;
    //import std.array : array;

    return iota(col).map!(x => rdRow!T).array;
}

void wrMat(T = long)(T[][] mat)
{
    //import std.stdio : write, writeln;

    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

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

int main()
{
    int n;
    cin>>n;
    if (n==1)
    {
      cout<<"1";
	}
	if (n==2)
    {
      cout<<"1";
	}
	if (n==3)
    {
      cout<<"1";
	}
	if (n==4)
    {
      cout<<"2";
	}
	if (n==5)
    {
      cout<<"1";
	}
	if (n==6)
    {
      cout<<"2";
	}
	if (n==7)
    {
      cout<<"1";
	}
	if (n==8)
    {
      cout<<"5";
	}
	if (n==9)
    {
      cout<<"2";
	}
	if (n==10)
    {
      cout<<"2";
	}
	if (n==11)
    {
      cout<<"1";
	}
	if (n==12)
    {
      cout<<"5";
	}
	if (n==13)
    {
      cout<<"1";
	}
	if (n==14)
    {
      cout<<"2";
	}
	if (n==15)
    {
      cout<<"1";
	}
	if (n==16)
    {
      cout<<"14";
	}
	if (n==17)
    {
      cout<<"1";
	}if (n==18)
    {
      cout<<"5";
	}
	if (n==19)
    {
      cout<<"1";
	}
	if (n==20)
    {
      cout<<"5";
	}
	if (n==21)
    {
      cout<<"2";
	}
	if (n==22)
    {
      cout<<"2";
	}
	if (n==23)
    {
      cout<<"1";
	}
	if (n==24)
    {
      cout<<"15";
	}
	if (n==25)
    {
      cout<<"2";
	}
	if (n==26)
    {
      cout<<"2";
	}
	if (n==27)
    {
      cout<<"5";
	}
	if (n==28)
    {
      cout<<"4";
	}
	if (n==29)
    {
      cout<<"1";
	}
	if (n==30)
    {
      cout<<"4";
	}
	if (n==31)
    {
      cout<<"1";
	}
	if (n==32)
    {
      cout<<"51";
	}
	return 0;
}

Measured memory_bytes: 256
use std::cmp::max;
use std::cmp::min;
use std::io::stdin;

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let mut itr = s.split_whitespace().map(|e| e.parse::<usize>().unwrap());
    let w = itr.next().unwrap();
    let h = itr.next().unwrap();
    let n = itr.next().unwrap();
    let mut xl = 0;
    let mut xh = w;
    let mut yl = 0;
    let mut yh = h;

    for _ in 0..n {
        let mut s = String::new();
        stdin().read_line(&mut s).ok();
        let mut itr = s.split_whitespace().map(|e| e.parse::<usize>().unwrap());
        let x = itr.next().unwrap();
        let y = itr.next().unwrap();
        let a = itr.next().unwrap();
        match a {
            1 => xl = max(xl, x),
            2 => xh = min(xh, x),
            3 => yl = max(yl, y),
            4 => yh = min(yh, y),
            _ => (),
        }
    }

    println!(
        "{}",
        if xl < xh && yl < yh {
            (xh - xl) * (yh - yl)
        } else {
            0
        }
    );
}


Measured memory_bytes: 4352
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using flt = double;
const flt eps = 1e-12, inf = 1e18, PI = acos(-1.0);
template<typename T>
inline T sqr(T x) {return x * x;}
inline flt cmp(flt a, flt b, flt e = eps) {
  return fabs(a - b) >= e + fabs(a) * e ? a - b : 0;
}
inline int sgn(flt x, flt e = eps) {return x < -e ? -1 : (x > e);}
inline flt fix(flt x, flt e = eps) {return cmp(x, 0, e);}

struct point {
  flt x, y;
  point(flt x = 0, flt y = 0): x(x), y(y) {}
  bool operator < (const point &rhs) const {
    return cmp(x, rhs.x) < 0 || (cmp(x, rhs.x) == 0 && cmp(y, rhs.y) < 0);
  }
  bool operator == (const point &rhs) const {
    return cmp(x, rhs.x) == 0 && cmp(y, rhs.y) == 0;
  }
  point operator + (const point &rhs) const {
    return point(x + rhs.x, y + rhs.y);
  }
  point operator - (const point &rhs) const {
    return point(x - rhs.x, y - rhs.y);
  }
  point operator * (const flt k) const {
    return point(x * k, y * k);
  }
  point operator / (const flt k) const {
    return point(x / k, y / k);
  }
  point operator ~ () const {// counter clockwise rotate 90 degree
    return point(-y, x);
  }
  flt dot(const point &rhs) const {
    return x * rhs.x + y * rhs.y;
  }
  flt det(const point &rhs) const {
    return x * rhs.y - y * rhs.x;
  }
  flt norm2() const {
    return x * x + y * y;
  }
  flt norm() const {
    return hypot(x, y);
  }
  point rot(flt a) const {// counter clockwise rotate A rad
    return point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
  }
  point rot(flt cosa, flt sina) const {// counter clockwise rotate using cos/sin
    return point(x * cosa - y * sina, x * sina + y * cosa);
  }
  point trunc(flt a = 1.0) const {
    return (*this) * (a / this->norm());
  }
};

point project(const point &A, const point &B, const point &O) {
  point AB = B - A;
  return A + AB * (AB.dot(O - A) / AB.norm2());
}

int main() {
  point A, B;
  scanf("%lf%lf%lf%lf", &A.x, &A.y, &B.x, &B.y);
  int q;
  scanf("%d", &q);
  for (int i = 0; i < q; ++i) {
    point O;
    scanf("%lf%lf", &O.x, &O.y);
    O = project(A, B, O);
    printf("%.10f %.10f\n", O.x, O.y);
  }
  return 0;
}

Measured memory_bytes: 2756
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


K = z()
if K == 7:
    print(1)
    exit()

t = 7 % K
for i in range(1, K * 2):
    if t == 0:
        print(i)
        exit()

    t = (t * 10 + 7) % K

print(-1)


Measured memory_bytes: 42076
#define DIN freopen("input.txt","r",stdin);
#define DOUT freopen("output.txt","w",stdout);
#include <bits/stdc++.h>
#include <cstdio>
#define mem(a,b) memset(a,b,sizeof(a))
#define REP(i,a,b) for(int i=(a);i<=(int)(b);i++)
#define REP_(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
using namespace std;
typedef long long LL;
typedef std::vector<int> VI;
typedef std::pair<int,int> PI;
int read()
{
    int x=0,flag=1; char c=getchar();
    while((c>'9' || c<'0') && c!='-') c=getchar();
    if(c=='-') flag=0,c=getchar();
    while(c<='9' && c>='0') {x=(x<<3)+(x<<1)+c-'0';c=getchar();}
    return flag?x:-x;
}

#define mod M
#define k (1<<n-1)
const int M=1e9+7;
const int maxn=1e6+5;
int n,p[maxn],d[maxn],ans;

void solve(int x,int y)
{
    y=1ll*y*x%M;
    if(x<(1<<n-1))
    {
        solve(x<<1,y);
        solve(x<<1|1,y);
    }
    else
    {
        int yy=y;
        for(int i=p[x];i>1;i>>=1)
        {
            yy=1ll*yy*i%M;
            int s=(d[i>>1]-1ll*d[i]*(i>>1)%M+M)%M;
            ans=(ans+1ll*s*yy)%M;
        }
    }
}

void res(int x)
{
    if(x<(1<<n-1))
    {
        res(x<<1);
        res(x<<1|1);
    }
    else
    {
        for(int i=p[x];i;i>>=1) d[i]=0;
    }
}

void cal(int x,int y)
{
    y=1ll*y*x%M;
    if(x<(1<<n-1))
    {
        cal(x<<1,y);
        cal(x<<1|1,y);
    }
    else
    {
        for(int i=p[x];i;i>>=1)
        {
            y=1ll*y*i%M;
            d[i]=(d[i]+y)%M;
        }
    }
}

int main()
{
    n=read();
    for(int i=(1<<n-1);i<(1<<n);i++)
        p[i]=read()+(1<<n-1)-1;
    for(int i=1;i<(1<<n-1);i++)
    {
        cal(i<<1,i);
        solve(i<<1|1,1);
        res(i<<1);
    }
    cout<<ans;

    return 0;
}


Measured memory_bytes: 5136