akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void){
    char line[81];
    char sign[3][5]={"the","this","that"};
    int sign1,i;
    for(;sign1=1,fgets(line,81,stdin);){
        for(;sign1;){
            for(i=0;i<3;i++)
                if(strstr(line,sign[i]) != NULL){
                    printf("%s",line);
                    sign1=0;
                    break;
                }
            if(!sign1)continue;
            for(i=0;line[i]!='\n';i++){
                if(line[i] == 'a')
                    line[i]='z';
                else if(islower(line[i]))
                    line[i]--;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 528
n=int(input())
blue=[input() for i in range(n)]
m = int(input())
red = [input() for i in range(m)]
money = [0 for i in range(n)]

for i in range(n):
  for j in range(n):
    if blue[i] == blue[j]:
      money[i] += 1
  for k in range(m):
    if blue[i] == red[k]:
      money[i] -= 1

if max(money) >= 0:
  print(max(money))
else:
  print(0)

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

int h,w;
int c[1500][1500]={0};
int m=-1;

int main(){
  
  scanf(" %d %d",&h,&w);
  
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      scanf(" %d",&c[i][j]);
      if(c[i][j]==0)c[i][j]=1;
      else c[i][j]=0;
    }
  }
  /*
  cout << endl;

  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout << c[i][j] << ' ';
    }
    cout << endl;
    }*/

  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(i>0&&j>0&&c[i][j]!=0&&c[i-1][j]!=0&&c[i][j-1]!=0&&c[i-1][j-1]!=0){
	int mi=min(c[i-1][j],min(c[i][j-1],c[i-1][j-1]));
	c[i][j]=mi+1;
	//cout << mi << endl;
      }      
      m=max(c[i][j],m);
    }
  }
  /*
  cout << endl;

  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout << c[i][j] << ' ';
    }
    cout << endl;
    }*/

  cout << m*m << endl;

  return 0;

}

Measured memory_bytes: 11328
#include <stdio.h>
int main()
{int i,j,p,N,X,L[10000],x[10000];
scanf("%d%d",&N,&X);
  p=0;
  for(i=1;i<=N;i++)
    scanf("%d",&L[i]);
    for(j=1;j<=N;j++)
      for(i=1;i<=j;i++)
    x[j]+=L[i];
    for(j=1;j<=N;j++)
    if(x[j]<=X)p++;
    printf("%d\n",p+1);
    
  
}

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

const int maxn = 2e5 + 5;
typedef long long ll;
ll n, arr[maxn], tot = 0, ans = 0;
std::vector<ll> p, num;
void print(std::vector<ll> a){
	for(int i=0;i<a.size();i++) printf("%lld ", a[i]);
	printf("\n");
}
void fac(ll a){
	ll cur = 2;
	while(a != 1 && cur <= 1e6 + 5){
		if(a % cur == 0){
			p.push_back(cur);
			int cnt = 0;
			while(a % cur == 0) a /= cur, cnt ++;
			num.push_back(cnt);
		}
		cur ++;
	}
	if(a != 1) p.push_back(a), num.push_back(1);
}
ll fast_pow(ll a, ll b){
	ll ret = 1;
	for(;b;b>>=1){
		if(b&1) ret = ret * a;
		a = a * a;
	}
	return ret;
}
void dfs(int i, ll cur){
	if(i == p.size()){
		arr[++tot] = cur;
		return;
	}
	for(int j=0;j<=num[i];j++){
		dfs(i+1, cur * fast_pow(p[i], j));
	}
}
int main(){
	scanf("%lld",&n);
	fac(n);
	dfs(0, 1);
	for(int i=1;i<=tot;i++){
		if(arr[i] == 1) continue;
		ll t = n;
		while(t % arr[i] == 0) t /= arr[i];
		if(t % arr[i] == 1) ans ++;
	}
	tot = 0; p.clear(), num.clear();
	fac(n-1);
	dfs(0, 1);
	for(int i=1;i<=tot;i++){
		if(arr[i] == 1) continue;
		else ans ++;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int N;
	int a;
	int X_Y=0;
	
	scanf("%d",&N);
	
	int V_C[2][20];
	
	for(int i=0;i<=N-1;i++){
		scanf("%d",&a);
		V_C[0][i]=a;
	}
	
	for(int i=0;i<=N-1;i++){
		scanf("%d",&a);
		V_C[1][i]=a;
	}
	
	for(int i=0;i<=N-1;i++){
		if(V_C[0][i]>V_C[1][i]){
			X_Y+=V_C[0][i]-V_C[1][i];
		}
	}
	
	printf("%d",X_Y);
	return(0);
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
#define all(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define TDARRAY(int,a,n,m) vector<vector<int>> a(n,vector<int>(m,0));
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
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;}

int n,a,b,c;
int main(){
    cin >> n >> a >> b >> c;
    vector<int> l(8,1e6);
    REP(i,n){
        cin >> l[i];
    }
    int res = INT_MAX;
    REP(d,4){
        REP(e,4){
            REP(f,4){
                REP(g,4){
                    REP(h,4){
                        REP(i,4){
                            REP(j,4){
                                REP(k,4){
                                    int cost = 0;
                                    vector<int> v(4);
                                    v[d]+=l[0];
                                    v[e]+=l[1];
                                    v[f]+=l[2];
                                    v[g]+=l[3];
                                    v[h]+=l[4];
                                    v[i]+=l[5];
                                    v[j]+=l[6];
                                    v[k]+=l[7];
                                    if(d!=3)cost+=10;
                                    if(e!=3)cost+=10;
                                    if(f!=3)cost+=10;
                                    if(g!=3)cost+=10;
                                    if(h!=3)cost+=10;
                                    if(i!=3)cost+=10;
                                    if(j!=3)cost+=10;
                                    if(k!=3)cost+=10;
                                    cost+=abs(v[0]-a);
                                    cost+=abs(v[1]-b);
                                    cost+=abs(v[2]-c);
                                    if(v[0]&&v[1]&&v[2]){
                                        if(chmin(res,cost)){
                                            chmin(res,cost);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    put(res-30);
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
#define MAXN 100005
#define LL long long
#define INF 1000000000
int n,ans,cnt;
char s[MAXN];
int main()
{
	scanf("%s",s);
	int len=strlen(s);
	for(int i=0;i<len;i++)
	{
		if(s[i]=='g')
		{
			if(cnt) cnt--,ans++;
			else cnt++;
		}
		else if(s[i]=='p')
		{
			if(cnt) cnt--;
			else cnt++,ans--;
		}
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 256
X,N = map(int,(input().split()))
p=list(map(int,(input().split())))

import numpy as np

all_set = [i for i in range(-1,102)]

def getNearestValue(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

temp_result = list(set(all_set) - set(p))
print(getNearestValue(temp_result, X))

Measured memory_bytes: 27216
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll, vl/*, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); ++i)
#define rep2(i, n) for(ll i = 1; i <= ll(n); ++i)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); ++i)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); ++i)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

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

  ll n;
  string s;
  cin >> n >> s;
  
  if(n&1) {cout << "No" << newl; return 0;}
  rep(i, n/2) if(s[i]!=s[n/2+i]) goto OUT;
  cout << "Yes" << newl;
  return 0;
  
  OUT:
  cout << "No" << newl;
  return 0;
}

Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b = LI()
    if a < b:
        a, b = b, a
    ans = a
    a -= 1
    ans += max(a, b)
    print(ans)
    return

#B
def B():
    n = II()
    h = LI()
    dp = [0 for i in range(n)]
    ans = 0
    for i in range(n):
        dp[i] = max(dp[i - 1], h[i])
        if dp[i - 1] <= h[i]:
            ans += 1
    print(ans)
    return

#C
def C():
    s = S()
    ans = 0
    for num, i in enumerate(s):
        if num % 2:
            if i == "0":
                ans += 1
        else:
            if i == "1":
                ans += 1
    ansb = 0
    for num, i in enumerate(s):
        if not num % 2:
            if i == "0":
                ansb += 1
        else:
            if i == "1":
                ansb += 1
    print(min(ans, ansb))
    return

#D
def D():
    n, K = LI()
    s = S()
    ans = []
    i = 0
    while i < n:
        l = 1
        for x in range(i+1, n):
            if s[x] == s[i]:
                l = x + 1 - i
                continue
            l = x - i
            break
        ans.append(l)
        i += l
    f = 0
    if s[-1] == "0":
        ans.append(0)
        f = 1
    
    dp = [0 for i in range(len(ans))]
    #print(ans)    
    if s[0] == "0":
        i = 2*K
        dp[0] = sum(ans[:i])
        a = 1
    if s[0] == "1":
        i = 2*K+1
        dp[0] = sum(ans[:i])
        a = 0
    x = 1
    while x + 2 * K < len(ans):
        if not a:
            dp[x] = dp[x - 1] - ans[x-1]
        else:
            dp[x] = dp[x - 1] + ans[x + 2 * K] + ans[x+2*K-1] - ans[x-1]
        x += 1
        a = (a + 1) % 2
        
    print(max(dp))
        

    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    D()


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

namespace Test01
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            //a[i] = i番目の箱の余り 0 or 1
            int[] a = new int[N + 1];
            string[] input = Console.ReadLine().Split(' ');
            for (int i = 1; i <= N; i++) a[i] = int.Parse(input[i - 1]);

            //b[i] := i番目の箱にボールが何個入っているか
            int[] b = new int[N + 1];

            //bについてN-1番目から0番目を決めていく
            for(int i = N; i >= 1; i--)
            {
                int sum = 0;
                for(int j = i; j <= N; j += i)
                {
                    sum += b[j];
                }
                if (a[i] != sum % 2) b[i] = 1;
            }
           
            //ボールの入っている箱に書いてある番号を入れる
            List<int> ans_list = new List<int>();

            for(int i = 1; i <= N; i++)
            {
                if (b[i] == 1) ans_list.Add(i);
            }

            Console.WriteLine(ans_list.Count());
            if(ans_list.Count() != 0)Console.WriteLine(string.Join(" ", ans_list));
        }
    }
}


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

int main(){

int a,b,c,d,e;
cin >> a >> b >> c >> d >> e;

//注文してから届くまでの時間(標準入力)
vector<int> Time = { a, b, c, d, e};

//注文してから次に注文できるまでの時間
vector<int> waitTime(5);
for (int i = 0; i < 5; i++){
    if (Time[i] % 10 == 0) {
        waitTime[i] = Time [i];
    } else {
        waitTime[i] = Time[i] - Time[i] % 10 + 10;
    }
}

int bestTime = 99999999;
//最後に注文するものを全通り計算
for (int i = 0; i < 5; i++){
    int sumTime = 0;
    for (int j = 0; j < 5; j++){
        if (i == j){
            sumTime += Time[j];
        }else{
            sumTime += waitTime[j];
        }
    }

    bestTime = min(bestTime, sumTime);
    if (bestTime > sumTime){
        bestTime = sumTime;
    }
}

cout << bestTime << endl;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    //IOS;
    //ll t;cin>>t;while(t--)
    {
        ll a,b,c,d,i,j,k,l,m,n,sum=0,temp=0,f=0,cnt=0;
        cin>>n;
        vector<ll> vec,vec1;
        for(i=0;i<n;i++)
        {
            cin>>a>>b;
            vec.pb(a+b);
            vec1.pb(a-b);
        }
        sort(vec.begin(),vec.end());
      sort(vec1.begin(),vec1.end());
        sum=abs(vec[0]-vec[vec.size()-1]);
        ll sum1=abs(vec1[0]-vec1[vec1.size()-1]);
        cout<<max(sum,sum1)<<endl;


    }
}


Measured memory_bytes: 6644
s = input()

A = s[0:2]
B = s[2:4]

if (int(B) == 0 or int(B) > 12) and (int(A) == 0 or int(A) > 12):
    print('NA')
elif 0 < int(B) <= 12 and (int(A) == 0 or int(A) > 12):
    print('YYMM')
elif 0 < int(B) <= 12 and 0 < int(A) <= 12:
    print('AMBIGUOUS')
else:
    print('MMYY')


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;

int main(void) {
    int N;
    cin >> N;
    string S;
    cin >> S;
    if(N%2 == 1) {
        cout << "No" << endl;
    } else {
        string T;
        T = S.substr(N/2);
        S.erase(N/2);
        if(S == T) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()

int main() {
    int a,b;
    cin>>a>>b;
    if((a*b)&1)cout<<"Odd";
    else cout<<"Even";
	return 0;
}


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

int main(){
	int n,t;
	cin>>n>>t;
	int sh[n];

	for(int i=0;i<n;i++) cin>>sh[i];

	int res = t;
	
	for(int i=1;i<n;i++){
		if(sh[i]-sh[i-1]<=t) res+=(t-((sh[i-1]+t)-sh[i]));
		else res+=t;
	} 
	cout<<res;
}

Measured memory_bytes: 1024
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        int[] guusuukou = new int[100001];
        int[] kisuukou = new int[100001];
        
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
            if (i % 2 == 0) {
                guusuukou[array[i]] += 1;
            } else {
                kisuukou[array[i]] += 1;
            }
        }
        
        int guusuukouMode1 = 0;
        int guusuukouModeValue1 = 0;
        int guusuukouMode2 = 0;
        int guusuukouModeValue2 = 0;
        int kisuukouMode1 = 0;
        int kisuukouModeValue1 = 0;
        int kisuukouMode2 = 0;
        int kisuukouModeValue2 = 0;
        
        for (int i = 1; i < 100001; i++) {
            if (guusuukou[i] > guusuukouModeValue1) {
                guusuukouMode2 = guusuukouMode1;
                guusuukouModeValue2 = guusuukouModeValue1;
                guusuukouMode1 = i;
                guusuukouModeValue1 = guusuukou[i];
                
            } else if (guusuukou[i] > guusuukouModeValue2) {
                guusuukouMode2 = i;
                guusuukouModeValue2 = guusuukou[i];
            }
            
            if (kisuukou[i] > kisuukouModeValue1) {
                kisuukouMode2 = kisuukouMode1;
                kisuukouModeValue2 = kisuukouModeValue1;
                kisuukouMode1 = i;
                kisuukouModeValue1 = kisuukou[i];
                
            } else if (kisuukou[i] > kisuukouModeValue2) {
                kisuukouMode2 = i;
                kisuukouModeValue2 = kisuukou[i];
            }
        }
        
        int a;
        int b;
        
        if (guusuukouMode1 != kisuukouMode1) {
            a = guusuukouModeValue1;
            b = kisuukouModeValue1;
        } else {
            int a1 = guusuukouModeValue2;
            int b1 = kisuukouModeValue1;
            int a2 = guusuukouModeValue1;
            int b2 = kisuukouModeValue2;
            
            if (a1 + b1 > a2 + b2) {
                a = a1;
                b = b1;
            } else {
                a = a2;
                b = b2;
            }
        }
        
        int countToFix = n - a - b;
        System.out.println(countToFix);
    }
}


Measured memory_bytes: 58120
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N;
    cin >>N;
    if(N==1){
        cout<<"Hello World"<<endl;
    }else{
        ll A,B;
        cin>>A>>B;
        cout<<A+B<<endl;
    }
    


    return 0;
    

}

Measured memory_bytes: 3540
from collections import Counter


def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = []
    c = []
    for i in range(n):
        b.append(a[i] + i + 1)
        c.append(i + 1 - a[i])
    b = list(Counter(b).items())
    c = Counter(c)
    answer = 0
    for i, n in b:
        if i in c:
            answer += n * c[i]
    print(answer)


if __name__ == '__main__':
    main()



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

#include <cstdlib>
using namespace std;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

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

typedef long long ll;

const string YES = "Yes";
const string NO = "No";

int main() {
    ll tot = 0;
    string N;
    cin >> N;
    rep(i, N.size()) {
        tot += N[i] - '0';
    }
    if (tot % 9 == 0) {
        cout << YES << endl;
    } else {
        cout << NO << endl;
    }
    return 0;
}


Measured memory_bytes: 3688
#include<iostream>
#include<algorithm>
using lint=int64_t;
using namespace std;

int main()
{
	int N,C;
	int D[35][35]={};
	int cnt[3][35]={};

	cin >> N >> C;
	for(int i=1;i<=C;i++)
		for(int j=1;j<=C;j++)
			cin >> D[i][j];
	for(int i=1;i<=N;i++)
	{
		for(int j=1;j<=N;j++)
		{
			int c;
			cin >> c;
			cnt[(i+j)%3][c]++;
		}
	}

	int ans=1e9;
	int col[3]={};
	for(col[0]=1;col[0]<=C;col[0]++)
	{
		for(col[1]=1;col[1]<=C;col[1]++)
		{
			for(col[2]=1;col[2]<=C;col[2]++)
			{
				if(col[0]==col[1])continue;
				if(col[1]==col[2])continue;
				if(col[2]==col[0])continue;

				int tans=0;
				for(int i=0;i<3;i++)
					for(int j=1;j<=C;j++)
						tans+=D[j][col[i]]*cnt[i][j];

				ans=min(ans,tans);
			}
		}
	}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin >> n;
    string s;cin >> s;
    REP(i,s.size()){
        cout << char((s[i]-'A'+n)%26+'A');
    }
    cout << endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main()
{

	// #ifndef HAPHAZARD_CODE
	// 	freopen("input.txt","r",stdin);
	// 	freopen("output.txt","w",stdout);
	// #endif

		int n; cin>>n;
		long long int a[n],i,sum=0,ans=0;
		int mod= 1000000007;

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

		for(i=0;i<n;i++)
		{
			sum=sum-a[i];
			ans+=(sum%mod * a[i]%mod)%mod;
		}

		ans=ans%mod;

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



Measured memory_bytes: 5188
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        long money = 1000;
        for (int i = 1; i < n; i++) {
            if (a[i] > a[i - 1]) {
                money += (a[i] - a[i - 1]) * (money / a[i - 1]);
            }
        }

        System.out.println(money);
    }
}

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

int main()
{
   string str; cin >> str;
   int n = str.size();
   if(n==2){
        if(str[0] == str[1]) cout << 1 << " " << 2 << endl;
        else cout << -1 << " " << -1 << endl;
        return 0;
   }else{
        rep(i,n-2){
            if(str[i] == str[i+1] or str[i] == str[i+2] or str[i+1] == str[i+2]){
                cout << i+1 << " " << i+3 << endl;
                return 0;
            }
        }
    }

    cout << -1 << " " << -1 << endl;

   return 0;   
}


Measured memory_bytes: 512
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
  int K,L;
  cin >> K;
  if (K%2==0 || K%5==0) {cout << -1 << endl; return 0;}
  if (K%7==0) L = 9 * K/7;
  else L = 9 * K;
  int i=1,ans=10;
  while(ans%L !=1) {
    ans = (ans % L) *10;
    i++;
  }
  cout << i << endl;
  return 0;
}


Measured memory_bytes: 3576
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    S = input()
    N = len(S)

    isStrong = True
    half = N // 2
    for i in range(N):
        if i < half:
            if S[i] != S[-i-1]:
                isStrong = False
            if S[i] != S[half-i-1]:
                isStrong = False
        else:
            if S[i] != S[N-i-1]:
                isStrong = False

    if isStrong:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
/*Coded by::
    **Avinash Tiwary**
    **BE/10298/2015**
    **Production Engineer**
    **Producing <code>**
*/
#include<bits/stdc++.h>
#define bf ios_base::sync_with_stdio (0), cin.tie (0)
typedef long long ll;
typedef double d;
#define MAX 1000001
#define MIN -1
#define mod 1000000007
#define INF 5e17
using namespace std;
typedef vector<ll> Vector;
typedef queue<ll > Queue;
typedef stack<ll> Stack;
typedef pair<ll,ll> Pair;
#define mp make_pair
#define pb push_back
vector< pair<ll,ll> > v;
bool vis[MAX];
ll ar[MAX];
int main(){
    bf;
    ll i,j,m,k,t,n,ans=1; string s;
    cin>>n;
    for(i=1;i<=n;i++) ans=((ans%mod)*i)%mod;
    cout<<ans;
    return 0;
}

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

int main() {
    ll n; cin>>n;
    vector<ll> a(n),v,vn;
    for(ll i=0; i<n; i++) cin>>a[i];
    sort(a.begin(),a.end());
    ll res=0;
    for(ll i=0; i<n; i++) {
        res++;
        if(a[i] != a[i+1]) {
            v.push_back(res);
            vn.push_back(a[i]);
            res = 0;
        }
    }
    n = v.size();
    ll ans=0;
    for(ll i=0; i<n; i++) {
        if(v[i] < vn[i]) ans += v[i];
        else ans += v[i] - vn[i];
    }
    cout<<ans;
}

Measured memory_bytes: 2804
h,w,k=map(int,input().split())
grid=[]
for _ in range(h):
    grid.append(list(input()))

from itertools import product

Raw=list(product([0,1],repeat=h))
Column=list(product([0,1],repeat=w))

ans=0
for r in Raw:

    tmp=[]
    for i in range(len(r)):
        if r[i]==1:
            tmp.append(grid[i])
        
    if len(tmp)==0:
        continue

    for c in Column:
        cnt=0

        n=len(tmp)
        for l in range(n):
            for j in range(len(c)):
                if c[j]==1 and tmp[l][j]=='#':
                    cnt+=1
        if cnt==k:
            ans+=1

print(ans)            


        




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

using namespace std;

int main() {
   ios_base :: sync_with_stdio(0);
   cin.tie(0) , cout.tie(0);
   int n;
   cin >> n;
   vector<int> a(n) , b(n);
   for (int i = 0; i < n; i++) {
      cin >> a[i];
   }
   for (int j = 0; j < n; j++) {
      cin >> b[j];
   }
   vector<int> p;
   for (int i = 1; i <= n; i++) {
      p.push_back(i);
   }
   long long x = 0 , y = 0;
   long long c = 0;
   do {
      c++;
      bool ok1 = true;
      for (int i = 0; i < n; i++) {
         if (a[i] != p[i]) {
            ok1 = false;
            break;
         }
      }
      if (ok1)
         x = c;
      bool ok2 = true;
      for (int i = 0; i < n; i++) {
         if (b[i] != p[i]) {
            ok2 = false;
            break;
         }
      }
      if (ok2)
         y = c;
   } while (next_permutation(p.begin() , p.end()));
   cout << abs(x - y) << '\n';
   return 0;
}


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

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

    int count = 0;
    for(int i=0;i<S.length();i++)
    {
        if (S[i] != T[i])
        {
            count++;
        }
    }
    cout << count << "\n";
}

Measured memory_bytes: 3916
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>


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

using namespace std;
int n,k;
vector<int> v;

int main(){
  cin >> n >> k;
  REP(i,n){
    int t;
    cin >> t;
    v.push_back(t);
  }
  sort(v.begin(),v.end());
  reverse(v.begin(),v.end());
  int ans = 0;
  REP(i,k){
    ans += v[i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()

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

const int oo = 1e9 + 7;
const int mod = 1e9 + 7, maxn = 81;
const double PI = acos(-1);


int main (){
    ll n;
    cin >> n;

    if (n&1) {
        cout << "0" << endl;
        return 0;
    }

    ll ans = n/10, k = 50;
    while (n >= k) {
        ans += n/k;
        k*=5;
    }

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

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;
typedef pair<int,int> pii;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T& n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  char c;
  double x1,y1,x2,y2,xq,yq,x,y;
  // y = slp * x + g, y = -(slp.Y/slp.X) * x + h;
  while(cin >> x1 >> c >> y1 >> c >> x2 >> c >> y2 >> c >> xq >> c >> yq){
    x2 -= x1;
    y2 -= y1;
    xq -= x1;
    yq -= y1;
    double xr = (x2*xq+y2*yq)/(x2*x2 + y2*y2);
    double yr = -(x2*yq-y2*xq)/(x2*x2+y2*y2);
    x = (x2 * xr - y2 * yr) + x1;
    y = (x2 * yr + y2 * xr) + y1;
    fcout(6) << x << " " << y << endl;
  }
  return 0;
}

Measured memory_bytes: 3244
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		String[] ld = r.readLine().split("\\s");
		int H = Integer.parseInt(ld[0]);
		int W = Integer.parseInt(ld[1]);
		String[] m = new String[H];
		for (int j = 0; j < H; j++)
			m[j] = r.readLine();
		for (int j = 0; j < H; j++)
			for (int k = 0; k < W; k++) {
				if (j == 0 && k == 0) continue;
				if (m[j].charAt(k) == '#') {
					// up
					if (j > 0 && m[j - 1].charAt(k) == '#') {
						if (count(m, j, k) - 1 != count(m, j - 1, k)) {
							System.out.println("Impossible");
							return;
						}
					}
					else
					// left
					if (k > 0 && m[j].charAt(k - 1) == '#') {
						if (count(m, j, k) - 1 != count(m, j, k - 1)) {
							System.out.println("Impossible");
							return;
						}
					}
					else {
						System.out.println("Impossible");
						return;
					}
				}
			}
		System.out.println("Possible");
	}

	private static int count(String[] m, int r, int c) {
		int result = 0;
		for (int j = 0; j <= r; j++)
			for (int k = 0; k <= c; k++)
				if (m[j].charAt(k) == '#')
					result++;
		return result;
	}
}

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

#define int long long
typedef pair<int, int> P;
//#define mod 1000000007
#define INF (1LL<<60)

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define YES puts("YES\n")
#define Yes puts("Yes\n")
#define NO  puts("NO\n")
#define No  puts("No\n")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }



signed main() {

	int K, S;
	cin >> K >> S;
	
	int ans = 0;
	for (int x = 0; x <= K; x++)for (int y = 0; y <= K; y++) {
		int z = S - x - y;
		if (z >= 0 && z <= K) ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7,MAX = 1e5;

int main()
{
	ll n;
	cin >> n;
	vector<vector<pair<ll,ll>>> M(n);
	for(ll i = 0;i< n-1;i++)
	{
		ll a,b,c;
		cin >> a >> b >> c;
		a--;b--;
		M[a].emplace_back(b,c);
		M[b].emplace_back(a,c);
	}
	vector<ll> div(n,-1);
	ll q,k;
	cin >> q >> k;
	k--;
	queue<ll> Q;
	Q.push(k);
	div[k] = 0;
	while(!Q.empty())
	{
		ll now = Q.front();
		Q.pop();
		for(ll i = 0;i<M[now].size();++i)
		{
			if(div[M[now][i].first]==-1)
			{
				Q.push(M[now][i].first);
				div[M[now][i].first] = div[now] + M[now][i].second;
			}
		}
	}
	while(q--)
	{
		ll x,y;
		cin >> x >> y;
		x--;y--;
		cout<<div[x]+div[y]<<endl;
	}
	return 0;
}

Measured memory_bytes: 11392
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<pair<ll, ll>>> vvpll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 300010;  // デフォルトでnの最大値は300000

// aのn乗を求める。計算量はO(logn)
ll modpow(ll a, ll n) {
    if(n == 0) {
        return 1;
    }
    if(n%2 == 1) {
        return (a * modpow(a, n-1))%mod;
    }
    return (modpow(a, n/2) * modpow(a, n/2))%mod;
}

ll inv(ll a) {
    return modpow(a, mod-2);
}

ll fact[MAX_N];
ll invfact[MAX_N];

// main関数でinit()を呼び出してからComb()を使用する
void init() {
    fact[0] = 1;
    invfact[0] = 1;
    for(ll i = 1; i < MAX_N; i++) {
        fact[i] = (i*fact[i-1])%mod;
        invfact[i] = inv(fact[i]);
    }
}
 
ll Comb(ll n, ll r) {
    if(r < 0 || n < 0 || n < r) {
        return 0;
    }
    ll res = fact[n];
    res = (res * invfact[r])%mod;
    res = (res * invfact[n-r])%mod;
    return res;
}

ll f(ll n, ll m) {
    ll a = (n-1)*n*(n+1)/6;
    ll b = m*m;
    a %= mod;  b %= mod;
    return a*b%mod;
}

ll g(ll n, ll m) {
    ll a = (m-1)*m*(m+1)/6;
    ll b = n*n;
    a %= mod;  b %= mod;
    return a*b%mod;
}

//--- main関数でinit()を呼び出すのを忘れるな ---//
int main() {
    ll n, m, k;
    cin >> n >> m >> k;
    init();
    out( Comb(n*m-2, k-2)*(f(n, m) + g(n, m))%mod );
    re0;
}

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

int main() {
    int a,b,c,k;
    cin >> a >> b >> c >> k;
    int* d;
    if(a >= b && a >= c) d = &a;
    else if(b >= c && b >= a) d = &b;
    else d = &c;
    rep(i,k) *d *= 2;
    cout << a+b+c << endl;
}

Measured memory_bytes: 256
//#pragma  GCC optimize("Ofast")

//#ifdef  DEBUG
//#define _GLIBCXX_DEBUG
//#endif

// -Ofast
// -O3
// -O2
// -fsanitize=address
// -fsanitize=undefined

// add_compile_options()

#include <iostream>
#include <map>
#include <vector>
#include <set>
#include <stack>
#include <bitset>
#include <queue>
#include <algorithm>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#include <iomanip>
#include <unordered_map>
#include <cmath>
#include <cassert>
#include <random>
using namespace std;
//using namesparsace __gnu_pbds;

mt19937 rnd;

int solve();

int main()
{
    srand(time(0));
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
#endif
    solve();
    return 0;
}

int max(int a, int b) {
    return a > b ? a : b;
}

const int maxN = 2e5 + 10;

int n, a[1001];

int solve() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    bool ok = true;
    for (int i = 0; i < n; i++) {
        if (a[i] % 2 == 0 && !(a[i] % 3 == 0 || a[i] % 5 == 0)) {
            ok = false;
            break;
        }
    }
    if (ok) cout << "APPROVED";
    else cout << "DENIED";
}

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

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))
#define SUM(n) ((n)+1)*(n)/2
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD=int(1e9)+7;

using namespace std;
using pii = pair<int,int>;

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

  int n,sum = 0;
  cin >> n;
  for( int i = 1; i <= n; i += 2){
    int d = 0;
    for( int j = 1; j * j <= i ; j ++ ){
      if( i % j == 0 ){
	d += 2;
	if( j * j == i ){
	  d --;
	}
      }
    }

    if( d == 8 ){
      sum ++;
    }
  }
  cout << sum << '\n';
  return 0;
}


Measured memory_bytes: 256
N=int(input())
A=[int(i) for i in input().split()]
c_min=min(A)
c_max=max(A)
if c_min==c_max:
  if N//2>=c_min or N-1==c_min:
    print("Yes")
  else:
    print("No")
elif c_max-c_min==1:
  if c_max>=A.count(c_min)+1 and A.count(c_max)>=2*(c_max-A.count(c_min)):
    print("Yes")
  else:
    print("No")
else:
  print("No")
  
    

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

int main(){
  
 string s;
  cin >> s;
  
  for(int i = 0; i < s.size(); i++){
    if(i % 2 == 0){
    cout << s.at(i);
    }
  }
  cout << endl;
}

 

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

import math
import sys
import heapq
from operator import itemgetter
import itertools
input = sys.stdin.readline

# a = int(input().rstrip())
# a, b = map(int, input().rstrip().split())
# D = list(map(int, input().rstrip().split()))
# H = [int(input().rstrip()) for _ in range(L)]
# DD = [[0 for j in range(100)] for i in range(200)]
# dict = {} ## dictionary

# a = sorted(a, key=lambda x: x[1]))
# if __name__ == '__main__':

N, T = map(int, input().rstrip().split())
ct_s = []
for i in range(N):
	ct = list(map(int, input().rstrip().split()))
	if ct[1] <= T:
		ct_s.append(ct[0])

if len(ct_s) == 0:
	print("TLE")
else:
	print(min(ct_s))

Measured memory_bytes: 3188
n = input()
a = [map(int, raw_input().split()) for _ in xrange(2)]
s = 0
for i in xrange(n):
    s += a[0][i]
    a[0][i] = s
a[1][0] += a[0][0]
for i in xrange(1, n):
    a[1][i] += max(a[0][i], a[1][i - 1])
print a[1][-1]


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

int main()
{
   int a,b,c,x,y,z;
   cin>>x>>y>>z;
   a=x;
   b=y;
   c=z;
   swap(a,b);
   swap(a,c);
   cout<<a<<" "<<b<<" "<<c<<endl;
    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll n, a[60], b, bi;
string s;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	b = 0;
	bi = 0;
	cin >> n;
	rep(i, 1, n){
		cin >> a[i];
		if(abs(a[i]) > abs(b)){
			b = a[i];
			bi = i;
		}
	}
	
	vector<P> ans;
	if(b == 0){
		print(0);
		return 0;
	}
	if(b > 0){
		rep(i, 1, n-1){
			while(a[i] > a[i+1]){
				a[i+1] += b;
				ans.push_back(P(bi, i+1));
				if(a[i+1] > b){
					b = a[i+1];
					bi = i+1;
				}
			}
		}
	}
	else{
		rrep(i, n-1, 1){
			while(a[i] > a[i+1]){
				a[i] += b;
				ans.push_back(P(bi, i));
				if(a[i] < b){
					b = a[i];
					bi = i;
				}
			}
		}
	}
	
	print(ans.size());
	rep(i, 0, ans.size()-1){
		cout << ans[i].first << " " << ans[i].second << endl;
	}
	return 0;
}

Measured memory_bytes: 256
N,M = map(int, input().split())
LR = [list(map(int,input().split())) for _ in range(M)]
sta = [LR[i][0] for i in range(M)]
gol = [LR[i][1] for i in range(M)]

ans = min(gol) -max(sta) 
print(ans+1 if ans >= 0 else 0)

Measured memory_bytes: 29032
package main

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

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
	mod int = 1e9 + 7
)

func gcd(a, b int) int {
	if a < b {
		tmp := a
		a = b
		b = tmp
	}

	for r := a % b; r !=0; {
		a = b
		b = r
		r = a % b
	}

	return b
}

func main() {
	A := getInt()
	B := getInt()
	fmt.Println(A * B / gcd(A, B))
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray) - 1])
}

func calcMod(x int) int {
	return x % mod
}


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

long long int lim[100005][2]={0};

int main(){
    int k;
    cin >> k;
    vector<long long int> a;
    for(int i=0;i<k;++i){
        long long int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }
    lim[k][0] = 2;
    lim[k][1] = 2;
    for(int i=k-1;i>=0;--i){
        if(abs(lim[i+1][1] - lim[i+1][0]) < a[i] && lim[i+1][0] % a[i] != 0 && lim[i+1][1] % a[i] != 0 && lim[i+1][1] / a[i] == lim[i+1][0] / a[i]){
            cout << -1 << endl;
            return 0;
        }
        lim[i][0] = a[i] * ceil(lim[i+1][0]/(long double)a[i]);
        lim[i][1] = a[i] * floor(lim[i+1][1]/(long double)a[i]) + a[i] - 1;
    }
    if(lim[0][0] > lim[0][1])cout << -1 << endl;
    else cout << lim[0][0] << " " << lim[0][1] << endl;

    return 0;
}


Measured memory_bytes: 2676
use std::collections::HashMap;
use std::io::*;
use std::str::FromStr;

//https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_5_B/review/2709881/arsenic28/Rust
trait Joinable {
    fn join(self, sep: &str) -> String;
}

impl<U: ToString, T: Iterator<Item = U>> Joinable for T {
    fn join(self, sep: &str) -> String {
        self.map(|x| x.to_string()).collect::<Vec<_>>().join(sep)
    }
}

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

fn main() {
    let n: i64 = read();
    let n_sq = (n as f64).sqrt() as i64;
    let mut f_n = HashMap::new();

    for x in 1..=n_sq {
        for y in 1..=n_sq {
            for z in 1..=n_sq {
                let temp_n = x * x + y * y + z * z + x * y + x * z + y * z;
                //println!("x{} y{} z{} n{}", x, y, z, temp_n);
                let count = f_n.entry(temp_n).or_insert(0);
                *count += 1;
            }
        }
    }
    for i in 1..=n{
        println!("{:?}",f_n.get(&(i as i64)).unwrap_or(&0)); 
    }
}


Measured memory_bytes: 3796
#include <iostream>
#include <vector>
#include<queue>
#include<iomanip>
#include<array>
#include<cmath>
using namespace std;
#define MAX 1000000000
#define ll long long
#ifndef M_PI
#define M_PI 3.14159265358979
#endif

#define deg_to_rad(deg) (((deg)/360)*2*M_PI)
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)


int main() {

	int A,B,H,M;
	cin >> A >> B >> H >> M;
	
	double deg_h = (H + double(M) / 60.0) * (360 / 12);
	double deg_m = M *6;
	double delta_d = deg_h - deg_m;
	double ans = sqrt(A * A + B * B - 2 * A * B * cos(deg_to_rad(delta_d)));
	std::cout << fixed;

	cout << std::setprecision(9)<<ans;
	return 0;
}

Measured memory_bytes: 4188
fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toLong() }

    if (aa.count { it < 0 } % 2 == 0) {
        println(aa.map { Math.abs(it) }.sum())
    } else {
        var min = Long.MAX_VALUE
        aa.forEach {
            min = Math.min(min, Math.abs(it))
        }
        println(aa.map { Math.abs(it) }.sum() - 2L * min)
    }
}

Measured memory_bytes: 59396
// Problem : 
// 			P - Independent Set
// 			Editorial
// 		
// Contest : AtCoder - Educational DP Contest
// URL : https://atcoder.jp/contests/dp/tasks/dp_p
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

#define int long long
#define db double
#define mod 1000000007
#define pb push_back
#define pp pair<int,int>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repe(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=b;i>=a;i--)
#define maxn 200005
#define ss second
#define ff first
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
int inv(int a, int b){
 return 1<a ? b - inv(b%a,a)*b/a : 1;
}
int n,dp[maxn][2];
vector<int> adj[maxn];
void dfs(int c,int p)
{
	int w = 1, b = 1;
	for(auto x:adj[c])
	{
		if(x!=p)
		{
			dfs(x,c);
			b *= dp[x][0];
			w *= (dp[x][0]+dp[x][1])%mod;
			w %= mod;
			b %=mod;
		}
	}
	dp[c][0]=w;
	dp[c][1]=b;
	return;
}
void solve()
{
	cin >> n;
	rep(i,0,n-1)
	{
		int x,y;
		cin >> x  >> y;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	dfs(1,0);
	cout << (dp[1][0]+dp[1][1])%mod <<"\n";
}
signed main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin >> t;
    while(t--)
    solve();
    return 0;
}


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

int main(){
    int N;
    cin >> N;
    vector<int> a(N), b(N);
    for (int i = 0; i < N; i++){
        cin >> a[i];
        b[a[i] - 1] = i + 1;
    }
    for (int i = 0; i < N; i++) cout << b[i] << " ";
    cout << endl;
}

Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>

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

using namespace std;

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

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

using ll = long long;
using P = pair<int, int>;

const unsigned long long INF = 1LL << 60;

//////////////////////////////////////////////////////////////

int main() {
    int x;
    cin >> x;
    cout << (int)pow(x, 3) << endl;
}



Measured memory_bytes: 3292
/*A - A?C*/
#include <bits/stdc++.h>
using namespace std;
int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	string cad;

	cin >> cad;

	if(cad == "ABC")
		cout << "ARC";
	else
		cout << "ABC";
	
	return 0;
}


Measured memory_bytes: 3540
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		
		if(N.charAt(0) == N.charAt(2)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		
	}
}


Measured memory_bytes: 23508