akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a+b > c+d) cout<<"Left"<<endl;
    else if(a+b < c+d) cout<<"Right"<<endl;
    else cout<<"Balanced"<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int gr[12] = {1,3,1,2,1,2,1,1,2,1,2,1};
	int x, y;
	
	scanf("%d %d", &x, &y);
	if (gr[x - 1] == gr[y - 1]) {
		puts("Yes");
	} else {
		puts("No");
	}
	return 0;
}


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

int main(){
    ll a, b, n;
    cin >> a >> b >> n;
    ll i = min(b-1, n);
    ll ans = ll(floor(a*i/b) - a*floor(i/b));
    cout << ans << endl;
    return 0;
}


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

const double PI = acos(-1);
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;
typedef pair<ll,pair<int,int>> P;

#define REP(i,n) for (int i = 0; i < (n); i++)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second

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

    map<char,char> mp;
    mp['A'] = 'T';
    mp['T'] = 'A';
    mp['C'] = 'G';
    mp['G'] = 'C';

    string s;
    cin >> s;
    int cnt = 0;
    int ans = 0;
    REP(i,sz(s)) {
        if (mp.count(s[i])) cnt++;
        else {
            ans = max(ans,cnt);
            cnt = 0;
        }
    }
    cout << max(ans,cnt) << endl;

    return 0;
}


Measured memory_bytes: 256
const input = require("fs").readFileSync("/dev/stdin", "utf8")
let cin = input.split(/ |\n/), cid = 0
const next = () => cin[cid++]
const nexts = (n) => cin.slice(cid, cid+=n).map(i=>parseInt(i))
const xArray = (n, v) => [...Array(n)].fill(v)

const N = parseInt(next())
let array = xArray(1e6+1, 0)
for (let i = 0; i < N; i++) {
    a = next()
    array[a]++
}
let ans = 0
for (let i = 0; i <= 1e6; i++) {
    if(array[i] === 0) continue;
    if(array[i] === 1) ans++;
    for (let j = i + i; j <= 1e6; j+=i) {
        array[j] = 0
    }
}
console.log(ans)


Measured memory_bytes: 61532
from math import sqrt

N,D=map(int,input().split())

pts=[]
for i in range(N):
    array=list(map(int,input().split()))
    pts.append(array)

ans=0
for i in range(N):
    dist=sqrt(pts[i][0]**2+pts[i][1]**2)
    if dist<=D:
        ans+=1

print(ans)

Measured memory_bytes: 45460
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,a,m,flag=0;
    scanf("%d",&n);
    m=n;
    while(m--)
    {
        scanf("%d",&a);
        if(a%2==0)
        {
            if(a%3==0 || a%5==0)
                flag++;
        }
        else
            flag++;
    }
    if(flag==n)
        printf("APPROVED");
    else
        printf("DENIED");
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<ll> c(n+1);
  
  rep(i,n) cin >> a[i];
  
  c[0]=0;
  for(int i = 1; i <= n;i++){
    c[i] = c[i-1] + a[i-1];
  }
  
  ll ans = 1LL << 60;
  for(int i = 1;i < n;i++){
    chmin(ans,abs(c[i]-(c[n]-c[i])));
  }
  cout << ans; 
          
  return 0;
}

Measured memory_bytes: 2560
#include<iostream>
#include<algorithm>
#define rep(i,s,n) for(int i=s;i<n;i++)
#define Z 15000
using namespace std;
int d[Z+1];
int main(){
	int n,m,k,r,l;
	while(true){
		cin>>n>>k>>m>>r;
		if(!(n+m+k+r))break;
		rep(i,0,Z)d[i]=0;
		k=1,l=n;
		rep(i,0,Z)d[i]+=k/l,k%=l,k*=10;
		if(m)rep(i,1,n){k=1,l=i*n;rep(j,0,Z)d[j]+=k/l,k%=l,k*=10;}
		for(int i=Z;i>0;i--)d[i-1]+=d[i]/10,d[i]%=10;
		cout<<d[0]<<".";
		rep(i,1,r+1)cout<<d[i];
		cout<<endl;
	}
	return 0;
}

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

typedef long long ll;

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

  ll n, m; cin >> n >> m;
  cout << (1900*m + 100*(n-m))*pow(2, m) << '\n';
  return 0;
}


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

int main(){
    long long N,K,n;
    long long res=0,ans=0;
    cin >> N >> K;

    vector<long long> v(N),vs(N);
    

    for (int i=0;i<N;i++){
        cin >> v[i];
        }
    vs = v;

    vector<long long> v2(40);     
    for (int i=0;i<N;i++){
        n = 0;
        while (v[i]>0){
            v2[n] += v[i]%2;
            v[i] /= 2;
            n++;
        }    
    }

    n = 39;
    reverse(v2.begin(), v2.end());
    for (long long i:v2){
        if (i<=N/2 && res+pow(2,n)<=K){
            res += pow(2,n);
        }
        n--;
        if (res>=K){
            break;
        }
    }

    for (long long i:vs){
        ans += i^res;
    }

    cout << ans << endl;
    }
    //sort(v.rbegin(), v.rend(), [](auto& x, auto& y){return x[1] < y[1];});

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

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;


int main() {

    ll A, B, C;
    cin >> A >> B >> C;

    if((A + B) - C >= 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int cmp(const int *a,const int *b){
  return *a-*b;
}
int main(){
  int n,a[100000][2];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d%d",&a[i][1],&a[i][0]);
  }
  qsort(a,n,sizeof(a[0]),cmp);
  printf("%d\n",a[0][0]+a[0][1]);
}

Measured memory_bytes: 1788
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @author Pavel Mavrin
 */
public class Main {

    private void solve() throws IOException {
        int n = nextInt();
        init(n);
        for (int i = 0; i < n - 1; i++) {
            addEdge(nextInt() - 1, nextInt() - 1);
        }
        if (dfs(0, -1) > 0) {
            out.println("Alice");
        } else {
            out.println("Bob");
        }
    }

    void init(int n) {
        this.n = n;
        this.m = (n - 1) * 2;
        last = 0;
        head = new int[n];
        nx = new int[m];
        dst = new int[m];
        Arrays.fill(head, -1);
    }


    void addEdge(int x, int y) {
        nx[last] = head[x];
        dst[last] = y;
        head[x] = last;
        last++;
        nx[last] = head[y];
        dst[last] = x;
        head[y] = last;
        last++;
    }

    private int dfs(int x, int p) {
        int j = head[x];
        int res = 0;
        while (j >= 0) {
            int y = dst[j];
            if (y != p) {
                res ^= dfs(y, x) + 1;
            }
            j = nx[j];
        }
        return res;
    }

    int n, m;
    int[] head;
    int[] nx;
    int[] dst;
    int last;

    // ------------------

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st;
    PrintWriter out = new PrintWriter(System.out);

    String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    private void run() throws IOException {
        solve();
        out.close();
    }

}


Measured memory_bytes: 50072
// IO
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm
#include <algorithm>
#include <cmath>
#include <numeric>

// container
#include <vector>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>

// others
#include <random>
#include <limits>
#include <functional>
#include <ctime>
#include <cassert>

// type alias
using lint = long long;
using ldouble = long double;
template <class T>
using greater_priority_queue = std::priority_queue<T, std::vector<T>, std::greater<T>>;


/* ----- class ----- */

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
using Edges = std::vector<Edge<Cost>>;

template <class Cost = int>
using Graph = std::vector<std::vector<Edge<Cost>>>;


/* ----- debug ----- */

#if __has_include("../setting/source/debug.hpp")
#include "../setting/source/debug.hpp"
#endif


/* ----- short functions ----- */

template <class T>
inline T sq(T a) { return a * a; }

template <class T>
inline T iceil(T n, T d) { return (n + d - 1) / d; }

template <class T>
T gcd(T a, T b) {
    while (b > 0) {
        a %= b;
        std::swap(a, b);
    }
    return a;
}

template <class T, class U>
T ipow(T b, U n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= b;
        n >>= 1;
        b *= b;
    }
    return ret;
}

// 0-indexed
template <class T, class U>
inline T kthbit(T a, U k) { return (a >> k) & 1; }

template <class T, class U>
inline T mask(T a, U k) { return a & ((1 << k) - 1); }

template <class T>
std::map<T, int> compress(std::vector<T>& v) {
    std::sort(v.begin(), v.end());
    v.erase(std::unique(v.begin(), v.end()), v.end());

    std::map<T, int> rev;
    for (int i = 0; i < v.size(); ++i) rev[v[i]] = i;
    return rev;
}

template <class T>
T Vec(T v) { return v; }

template <class T, class... Ts>
auto Vec(size_t l, Ts... ts) {
    return std::vector<decltype(Vec<T>(ts...))>(l, Vec<T>(ts...));
}


/* ----- constants ----- */

// const int INF = std::numeric_limits<int>::max() / 3;
// const lint INF = std::numeric_limits<lint>::max() / 3;
// const ldouble PI = acos(-1);
// const ldouble EPS = 1e-10;
// std::mt19937 mt(int(std::time(nullptr)));


using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> P(N);
    for (auto& p : P) cin >> p;

    int ans = 0;
    for (int i = 1; i < N - 1; ++i) {
        vector<int> s(3);
        for (int j = 0; j < 3; ++j) {
            s[j] = P[i + j - 1];
        }

        sort(s.begin(), s.end());
        if (s[1] == P[i]) ++ans;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
// #define M 1000000007
// long long hh(string s){
// long long a=1;
//   for(int i=0;i<s.length();i++){
//       int t = (s[i]-'a')+1;
//     a=(long long)(a*t+M)%M;
//   }
//   return a;
// }
int main(){
int n;
  cin>>n;
  vector<string> a(n);
  map<string, int> m;

  for(int i=0;i<n;i++){
    cin>>a[i]; 
    //long long b = hh(a[i]);
    //cout<<b<<endl;
    sort(a[i].begin(),a[i].end());
    m[a[i]]++;
  }
  map<string,int>::iterator it;
  long long ans=0;
  for(it=m.begin();it!=m.end();it++){
      int ct=it->second;
    long long t=(long long)((long long)ct*(long long)(ct-1))/2;
      ans+=t;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 18176
k = gets.chomp.split(' ').map(&:to_i).last
ps = gets.chomp.split(' ').map(&:to_i)

exps = {}
ps.each do |x|
  next unless exps[x].nil?
  exps[x] = (1..x).reduce(:+) / x.to_f
end

exps = ps.map { |x| exps[x] }

sum_exps = [0]
exps.each_with_index do |x, i|
  sum_exps[i + 1] = sum_exps[i] + exps[i]
end

max = 0
(k-1..exps.count-1).each do |i|
  sum = sum_exps[i+1] - sum_exps[i-k+1]
  max = sum if sum > max
end

puts max


Measured memory_bytes: 19160
#include <stdio.h>
#include <string.h>

int main(){
  char s[100];
  char t[100];
  scanf("%s",s);
  scanf("%s",t);
  int i,flag=0,n=strlen(s);
  for(i=0;i<n;i++){
    if(s[i]!=t[i]){
      flag++;
    }
  }
  if(flag==0){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}
  

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


#define lld long long 
#define mod 1000000007

lld dp[1001][1001];

string a[1001];

lld max(lld x,lld y)
{
	if(x>y)
		return x;
	return y;
}		
lld min(lld x,lld y)
{

	if(x<y)
		return x;
	return y;
}

lld power(lld x, lld y) 
{ 
    lld temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2); 
    if (y%2 == 0) 
        return temp*temp; 
    else
        return x*temp*temp; 
} 
/*
lld foo(lld i,lld j,lld n, lld m)
{
	
	lld ans=0;
	if(i==n || j==m)
	{
		return 0;
	}
	else if(dp[i][j]!=-1)
	{
		return dp[i][j];
	}
	
	if(i==n-1 && j==m-1)
	{
		return 1;
	}
	if(a[i+1][j]=='.')
	{
		ans=ans+foo(i+1,j,n,m);
		
	}
	if(a[i][j+1]=='.')
	{
		ans=ans+foo(i,j+1,n,m);
	}
	dp[i][j]=ans%mod;
	//cout<<"ppp";
	return dp[i][j];
}
*/

lld foo(lld i,lld j,lld n, lld m)
{
	
	//lld ans=0;
	if(i==n || j==m)
	{
		return 0;
	}
	if(dp[i][j]!=-1)
	{
		return dp[i][j];
	}
	if(a[i][j]=='#')
	{
		//dp[i][j]=0;
		//return dp[i][j];
		dp[i][j]=0;
		return 0;
	}
	if(i==n-1 && j==m-1)
	{
		return 1;
	}
	else
	{
		dp[i][j]=(foo(i+1,j,n,m)+foo(i,j+1,n,m))%mod;
	}
	return dp[i][j];
}
int main()
{
	lld n,m;
	cin>>n>>m;
	memset(dp,-1,sizeof(dp));
	for(lld i=0;i<n;i++)
	{
		cin>>a[i];
		
	}
	//cout<<a[2][2]<<"\n";
	cout<<foo(0,0,n,m)%mod<<"\n";
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
 
using namespace std;
const int size=123456;

int N;
int A[size];
int B[size];
string S;

bool check(int l,int f){
    for(int i=0; i<N+5; i++){
        B[i]=0;
    }
    B[0]=l;
    B[1]=f;
    for(int i=0; i<N; i++){
    if(A[i+1]==0){
        if(B[i+1]==1){
            if(B[i]==1){
                B[i+2]=1;
            }else{
                B[i+2]=2;
            }
        }else{
            if(B[i]==1){
                B[i+2]=2;
            }else{
                B[i+2]=1;
            }
        }
    }else{
        if(B[i+1]==1){
            if(B[i]==1){
                B[i+2]=2;
            }else{
                B[i+2]=1;
            }
        }else{
            if(B[i]==1){
                B[i+2]=1;
            }else{
                B[i+2]=2;
            }
        }
    }
  }
bool flag=0;
for(int i=0; i<N; i++){
    if(A[i+1]==0){
        if(B[i+1]==1){
            if(B[i]!=B[i+2]){
                flag=1; break;
            }
        }else{
            if(B[i]==B[i+2]){
                flag=1; break;
            }
        }
    }else{
        if(B[i+1]==1){
            if(B[i]==B[i+2]){
                flag=1; break;
            }
        }else{
            if(B[i]!=B[i+2]){
                flag=1; break;
            }
        }
    }
}
if(B[0]!=B[N]||B[1]!=B[N+1]) flag=1;
return flag;
}

int main(){

cin>>N>>S;

for(int i=0; i<N; i++){
    if(S[i]=='o') A[i+1]=0;
    else A[i+1]=1;
}

for(int j=1; j<=2; j++){
  for(int k=1; k<=2; k++){
    if(!check(j,k)){
    for(int i=0; i<N; i++){
        if(B[i+1]==1) printf("S");
        if(B[i+1]==2) printf("W");
    }
    cout<<endl;
    return 0;
    }
  }
}

cout<<-1<<endl;

return 0;
 
}

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

int a[3], t, i, j, k;

scanf("%d %d %d", &a[0], &a[1], &a[2]);

for(i=0; i<3-1; i++){
 for(j=3-1; j>i; j--){
  if(a[j]<a[j-1]){
   t=a[j];
   a[j]=a[j-1];
   a[j-1]=t;
  }
 }
}

k=(a[2]*10)+a[1]+a[0];
printf("%d\n", k);


return 0;
}


Measured memory_bytes: 128
n = int(input())
s = []
for i in range(n):
    s.append(input())
m = int(input())
t = []
for i in range(m):
    t.append(input())
x = 0
for i in range(n):
    ben = s.count(s[i]) - t.count(s[i])
    if ben > x:
        x = ben
print(x)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef int64_t i64;

int main()
{
  int K,A,B;
  cin >> K >> A >> B;
  int h;
  for(int i = A; i <= B; i++){
    if(i % K == 0){
   	  cout << "OK" << endl;
      return 0;
    }
  }
  cout << "NG" << endl;
}


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




int main()
{
  int N;
  cin >> N;
  vector<int> A;
  vector<vector<int>> BC(N);
  int abc;
  int ans = 0;
  for (int i = 0; i < 3; i++)
  {
    for (int j = 0; j < N; j++)
    {
      if (i == 2 & j == N - 1)
      {
        break;
      }
      cin >> abc;
      if (i == 0)
      {
        A.push_back(abc - 1);
      }
      else
      {
        BC.at(j).push_back(abc);
      }
    }
  }

  int now;
  for (int i = 0; i < N; i++)
  {
    now = A.at(i);
    ans += BC.at(now).at(0);
    if (i == N - 1)
    {
      break;
    }
    if (now + 1 == A.at(i + 1))
    {
      ans += BC.at(now).at(1);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

// 一行の文字列を読み込む
func nextLine() string {
	sc.Scan()
	return sc.Text()
}

// 数値（INT）を読み込む
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b := nextInt(), nextInt()


	tap := 0
	kuchi := 1
	for {
		if kuchi >= b {
			fmt.Println(tap)
			return
		}
		tap++
		kuchi += a - 1
	}
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int s;
int cnt=0;
int main()
{
	scanf("%d", &s);
	while(s != 4 && s != 2 && s != 1)
	{
		cnt++;
		if(s & 1)
		{
			s = 3 * s + 1;
		}
		else
		{
			s >>= 1;
		}
	}
	printf("%d\n", cnt + 4);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>
using namespace std;

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

typedef long long ll;

int main(void) {
    int a,b,c;
    cin >> a >> b >> c;
    int t=0;
    while (t<60){
        int k = (60*t+c)%(a+b);
        if (k<=a){
            cout << 60*t+c << endl;
            return 0;
        }
        t++;
    }
    cout << -1 << endl;

    return 0;
}

Measured memory_bytes: 1164
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n").map(Number);
while(true){
   var n=Arr.shift();
   if(n==0)break;
   var a=[];
   var b=[];
   for(var i=0;i<n;i++){
      var v=Arr.shift();
      a.push(v);
   }
   a.sort(function(a,b){return a-b;});
   for(var i=1;i<=n*2;i++){
      if(a.indexOf(i)==-1)b.push(i);
   }
   var now=0;
   var ab=0;
   while(true){
      if(a.length==0 || b.length==0)break;
      var one=0;
      if(ab==0){
         a=a.filter(function(v,index){
            if(v>now && one==0){one=1;now=v;return false;}
            else {return true;}
         });
      }
      if(ab==1){
         b=b.filter(function(v,index){
            if(v>now && one==0){one=1;now=v;return false;}
            else {return true;}
         });
      }
      if(one==0)now=0;
      ab=1-ab;
      }
      console.log(b.length);
      console.log(a.length);
}

Measured memory_bytes: 9780
#include <bits/stdc++.h>
using namespace std;
int a[50];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	int cnt=0;
	for(int i=1;i<n-1;i++){
		if(a[i]>a[i-1] && a[i]<a[i+1]){
			cnt++;
		}
		else if(a[i]<a[i-1] && a[i]>a[i+1]){
			cnt++;
		}
	}
	printf("%d\n",cnt);
	return 0;
}


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

int main() {
    int n, res = 0;
    cin >> n;
    int h[n+1];
    for(int i = 0; i < n; i++) cin >> h[i+1];
    h[0] = 0;;

    for(int i = 1; i < n+1; i++)    if(h[i-1] < h[i])   res += h[i] - h[i-1];

    cout << res << "\n";
}


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

static const int INF=1e9;
static const int MOD=1000000007;
typedef long long ll;
typedef pair<int,int> P;

double to_deg(double r) {
    return r * 180.0 / (atan(1.0) * 4.0);
}

int main(){
    double a,b,x;
    cin >> a >> b >> x;
    double n=(x*2.0)/(a*b);
    double ans;
    if(n<=a){
        ans=atan(b/n);
        ans=to_deg(ans);
    }else{
        n=2*b-(2*1.0*x)/(a*a);
        ans=atan(n/a);
        ans=to_deg(ans);
    }
    cout << setprecision(10) << ans << endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include <iostream>
#include<bitset>
#include<map>
#include<set>
#include<vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
bool isPrime(int x) {
    int i;
    if (x < 2)return false;
    else if (x == 2) return true;
    if (x % 2 == 0) return false;
    for (i = 3; i * i <= x; i += 2) if (x % i == 0) return false;
    return true;
}
int main() {
	int q, l, r;int k[100001];
    cin >> q;k[1] = 0;
	for (int i = 3;i < 100001;i += 2) {
        k[i] = k[i - 2];
        int o = (i + 1) / 2;
        if (isPrime(i) && isPrime(o)) {
            k[i]++;
        }
	}
    for (int i = 0; i < q;i++) {
        cin >> l >> r;
        if (l != 1) {
            cout << k[r] - k[l - 2] << endl;
        }
        else
            cout << k[r] << endl;
    }
}

Measured memory_bytes: 1024
result = 0

while True:
  val1, symbol, val2 = map(str,input().split())
  if symbol == "?":
    break
  elif symbol == "+":
    result = int(val1) + int(val2) 
  elif symbol == "-":
    result = int(val1) - int(val2)
  elif symbol == "*":
    result = int(val1) * int(val2)
  elif symbol == "/":
    result = int(val1) // int(val2)
  print(result)



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

int gcd(int a,int b){
    if(a%b == 0){
        return b;
    }else{
        return(gcd(b,a%b));
    }
}

int main(){
    int N,X;
    cin >> N >> X;
    int x[N];
    int ans;
    
    for(int i = 0; i < N; i++){
        cin >> x[i];
    }
    ans = abs(X-x[0]);
    for(int i = 1; i < N; i++){
        ans = gcd(ans, abs(X-x[i]));
    }


    
    cout << ans << endl;
    
}

Measured memory_bytes: 640
#include <stdio.h>
#include <stdlib.h>

#define SWAP(x, y) {int z; z = x; x = y; y = z;}

int bubbleSort(int *nums, int size)
{
	int i, j, swap_num = 0;

	for(i = size; 1 < i; i--) {
		for(j = 1; j < i; j++) {
			if(nums[j] < nums[j - 1]) {
				SWAP(nums[j], nums[j - 1]);
				swap_num++;
			}
		}
	}

	return swap_num;
}

void dispNums(int *nums, int size)
{
	int i;
	
	printf("%d", nums[0]);
	for(i = 1; i < size; i++)
		printf(" %d", nums[i]);
	printf("\n");
}

int main(void)
{
	int n, i, swap_num;
	int *nums;

	scanf("%d", &n);
	nums = malloc(sizeof(int) * n);
	for(i = 0; i < n; i++)
		scanf("%d", nums + i);
	swap_num = bubbleSort(nums, n);
	dispNums(nums, n);
	printf("%d\n", swap_num);
	return 0;
}

Measured memory_bytes: 604
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    private static final int MOD = 1000000007;

    public static long sum(long[] x, int n) {
        long s = 0;
        for (int i = 0; i < n; i++) {
            s += i * x[i] % MOD;
            s -= (n - 1 - i) * x[i] % MOD;
            s = (s + MOD) % MOD;
        }
        return s;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long[] x = new long[n];
        long[] y = new long[m];

        for (int i = 0; i < n; i++) {
            x[i] = sc.nextLong();
        }

        for (int j = 0; j < m; j++) {
            y[j] = sc.nextLong();
        }

        Arrays.sort(x);
        Arrays.sort(y);
        System.out.println(sum(x, n) * sum(y, m) % MOD);
    }
}


Measured memory_bytes: 93580
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long

using namespace std;

int main(){

    int H,W;cin>>H>>W;
    bool S[H][W];
    REP(i,H){
        string s;cin>>s;
        REP(j,W)S[i][j]=(s[j]=='#');
    }

    bool rect_[H][W-1];
    REP(i,H)REP(j,W-1)rect_[i][j]=S[i][j]^S[i][j+1];

    bool rect[H-1][W-1];
    REP(i,H-1)REP(j,W-1)rect[i][j]=rect_[i][j]^rect_[i+1][j];

    int length[H-1][W-1];
    REP(i,H-1){
        int cnt=0;
        REP(j,W-1){
            if(!rect[i][j])cnt++;
            else{
                for(int k =j-cnt;cnt>0;k++){
                    length[i][k]=cnt--;
                }
                cnt=0;
                length[i][j]=0;
            }
        }
        REP(j,cnt)length[i][W-1-cnt+j]=cnt-j;
    }

    int area =2;//最大面積０の場合は？
    stack<pair<int,int> > stk;
    REP(j,W-1){
        stk.push({-1,0});
        REP(i,H-1){
            pair<int,int> p = stk.top();
            if(p.first<length[i][j])stk.push({length[i][j],i+1});
            else if(p.first>length[i][j]){
                while(stk.top().first>length[i][j]){
                    p=stk.top();
                    stk.pop();
                    area = max(area,(p.first+1)*(i+1 - p.second +1));
                }
                stk.push({length[i][j],p.second});
            }
        }
        while(!stk.empty()){
            area = max(area,(stk.top().first+1)*(H-stk.top().second +1));
            stk.pop();
        }
    }

    cout<<max({area,H,W})<<endl;


    return 0;
}

Measured memory_bytes: 27648
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()

using namespace std;
string S;
int main(){
    cin >> S;
    int N = S.size();
    int ans = 0;
    
    string S2 = S;
    int ans2 = 0;
    
    rep(i,N-1){
        if(S[i] == S[i+1]){
            if(S[i] == '0') S[i+1] = '1';
            else S[i+1] = '0';
            ans++;
        }
    }
    
    if(S2[0] == '0'){
        S2[0] = '1';
        ans2++;
    }else{
        S2[0] = '0';
        ans2++;
    }
    
    rep(i,N-1){
        if(S2[i] == S2[i+1]){
            if(S2[i] == '0') S2[i+1] = '1';
            else S2[i+1] = '0';
            ans2++;
        }
    }    

    
    cout << min(ans,ans2) << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
long long f[87],n;
int main()
{
	cin>>n;
	f[0]=2;
	f[1]=1;
	for(int i=2;i<=n;i++){
		f[i]=f[i-1]+f[i-2];
	}
	cout<<f[n];
	return 0;
}

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

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;
typedef vector<pii> vpii;

#define pb(x) push_back(x)
#define ppb() pop_back()
#define mp(x,y) make_pair(x,y)
#define mod 1000000007
#define FOR0(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i = a; i < b; i++)
#define FORD(i,a,b) for(ll i=(a);i>=(int)(b);i--)
#define sf(n) scanf("%lld", &n)
#define sfc(x) scanf("%c", &x)
#define pf(x) printf("%lld", x)
#define pff(x) printf("%lf", x)
#define pfc(x) printf("%c", x)
#define pfs(x) printf("%s", x)
#define sf2(a,b) scanf("%lld %lld", &a, &b)
#define sf3(a,b,c) scanf("%lld %lld %lld", &a, &b, &c)
#define pfn(n) printf("%lld\n", n)
#define pfs(n) printf("%lld ", n)
#define ff first
#define ss second
#define mem(a,b) memset(a,b,sizeof(a))
#define sz size()
#define ll long long
#define all(c) (c).begin(),(c).end()
#define fast ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
const ll INF = 2e18;

bool prime[1000009];
unordered_map<ll,ll> largest_factor;
void SieveOfEratosthenes(ll n)
{
    memset(prime,true, sizeof(prime));
    prime[1]=false;
    for (ll p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (ll i=p*p; i<=n; i += p){
                prime[i] = false;
                largest_factor[i]=p;
            }

        }
    }
}


ll power(ll x,ll y)
{
    if (y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
}


ll mod_power(ll a,ll b,ll m){
    ll res=1;
    a%=m;
    while(b){
        if(b&1){
            res=res*a%m;
        }
        a=a*a%m;
        b>>=1;
    }
    return res;
}


int main(){
    fast
    ll a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if((a[0]==a[1] && a[1]!=a[2]) || (a[1]==a[2]&&a[1]!=a[0]))cout<<"Yes\n";
    else cout<<"No\n";
}




Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  
  while(1)
  {
    if(a <= 0 || c <= 0)
    {
      break;
    }
    c -= b;
     if(a <= 0 || c <= 0)
    {
      break;
    }
    a -= d;
     if(a <= 0 || c <= 0)
    {
      break;
    }
  }
  
  if(a <= 0)
  {
    cout << "No";
  }
  else
  {
    cout << "Yes";
  }
  
  return 0;
}

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

using namespace std;

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

int main(){
 int n;
  cin >>n;
  vector<long> v(n);
  long sum=0;
 rep(i,n){
  long a,b;
   cin >> a >> b;
   v[i]=a+b;
   sum-=b;
 } 
  
  sort(v.begin(),v.end(),greater<long>());
  
  for(int i=0;i<n;i+=2) sum+=v[i];
  
  cout << sum << endl;
}

Measured memory_bytes: 1024
// 2019/05/14
// AtCoder Beginner Contest 053 - A
// (stdin: type Ctrl + D after input)
 
"use strict";
 
function Main(in_input){
    // Modify Input
    var in_lines = in_input.split("\n");
    var in_line1 = in_lines[0].split(" ");
    var x = parseInt(in_line1[0], 10);
 
    var ans = "";
    // Judge
    if(x < 1200){
        ans = "ABC";
    } else {
        ans = "ARC";
    }
 
    // Output
    console.log(ans);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
import java.util.Scanner;


public class Main {

	/**
	 * @param args
	 */

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[][] ans = new double[n+1][n+1];
		ans[0][0]=1;
		for (int i=0;i<n;i++) {
			double p = sc.nextDouble();
			ans[i+1][0]=ans[i][0]*(1-p);
			for (int j=0;j<n;j++) {
				ans[i+1][j+1]=ans[i][j]*p+ans[i][j+1]*(1-p);
			}
		}
		
		double out = 0;
		for (int i=(n+1)/2;i<=n;i++) {
			out += ans[n][i];
		}
		System.out.println(out);
	}

}


Measured memory_bytes: 137480
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define sz(a) ((int)a.size())
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijoMOD(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i<=n;i++){
    num*=yakusu[i];
  }
  return num;
}

int H,W;
vs s(50);
vi dv ={-1,0,1,0};vi du={0,-1,0,1};
int cnt=1;
int dfs(int u,int v){
  s[u][v]='.';
  
  rep(i,4){
   
      int nu =u +du[i],nv=v+dv[i];
      if(nu<0||nu>=H||nv<0||nv>=W)continue;
      if(s[nu][nv]=='.')continue;
      cnt ++;
      dfs(nu,nv);
    
  }
  return cnt;

}
int keta_wa(int x){
  int tot=0;
  while(x>0){
    tot +=x%10;
    x/=10;
  }
  return tot;
}



//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//vc Alp ={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
//cout<<""<<endl;
int main(){
ll N,K;cin>>N>>K;vl x(N);rep(i,N)cin>>x[i];
  ll cnt=1000000000;
  ll lef,rig;
  
  rep(i,N-K+1){
    lef=x[i];rig=x[i+K-1];
    cnt=min(cnt,min(abs(lef),abs(rig))+abs(rig-lef));
  }
  cout<<cnt<<endl;
}







Measured memory_bytes: 1024
import java.util.Scanner;
class Main {
	int W = 0,H = 0,I = 0,F = 0;
	public void pr() {
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 || W != 0) {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
	}
	public static void main(String[] args) {
		new Main().pr();
	}
}

Measured memory_bytes: 26792
n=int(input())
a=[list(map(int,input().split())) for _ in range(n)]

for k in range(n):
  for i in range(n):
    for j in range(n):
      if a[i][j]>a[i][k]+a[k][j]:
        print(-1)
        exit(0)

ans=0
for i in range(n):
  for j in range(i+1,n):
    ok=True
    for k in range(n):
      if i==k or j==k:
        continue
      if a[i][j]==a[i][k]+a[k][j]:
        ok=False
        break
    if ok:
        ans+=a[i][j]
print(ans)


Measured memory_bytes: 44252
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let n = read::<usize>();
    let mut a = vec![];
    for i in 0..n {
        a.push(read::<i64>());
    }
    if a[0] != 0 {
        println!("-1");
        return;
    }
    if (1..n).any(|x| a[x] > a[x - 1] + 1) {
        println!("-1");
        return;
    }
    let mut ans = 0;

    for i in 1..n {
        if a[i] == a[i - 1] + 1 {
            ans += 1;
        } else {
            ans += a[i];
        }
    }
    println!("{}", ans);
}

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

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


Measured memory_bytes: 3760
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)

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

void solve(std::string S){
    if(S.substr(0, 4)=="YAKI")
        cout << YES << endl;
    else
    {
        cout << NO << endl;
    }
    
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <cassert>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'
#define FIR first
#define SEC second
#define PB push_back
#define SZ(x) ((int)x.size())

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

template<class U, class V>
istream& operator >>(istream& in, pair<U, V>& pr) {
    return in >> pr.first >> pr.second;
}

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

template<class T>
ostream& operator <<(ostream& out, vector<T> vec) {
    for (T& e : vec)
        out << e << " ";
    return out << endl;
}

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

void solveSingleCase(int caseNo)
{
    int N;
    cin >> N;
    VEC(int) A(N), B(N);
    READVEC(A);
    READVEC(B);
    
    int ret = 0;
    FOR(bit, 0, 29) {
        VEC(int) zeros, ones;
        for (int b : B) {
            if ((b & (1 << bit)) == 0)
                zeros.PB(b & ((1 << bit) - 1));
            else
                ones.PB(b & ((1 << bit) - 1));
        }

        sort(ALL(zeros));
        sort(ALL(ones));

        lint count = 0;
        for (int a : A) {
            int ar = a & ((1 << bit) - 1);
            VEC(int)& n = (a & (1 << bit)) ? zeros : ones;
            VEC(int)& p = (a & (1 << bit)) ? ones : zeros;
            // cout << "SZ = " << SZ(n) << " " << SZ(p) << endl;

            int bl = (1 << bit) - ar;
            int count2 = lower_bound(ALL(n), bl) - BEGIN(n);
            int count3 = END(p) - lower_bound(ALL(p), bl);

            // cout << bit << " " << count2 << " " << count3 << endl;
            count += count2 + count3;
        }

        if (count % 2 == 1)
            ret += 1 << bit;
    }

    cout << ret << endl;
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int T = 1;
    // cin >> T;
    FOR(tcase, 1, T + 1) {
        solveSingleCase(tcase);
    }
    return 0;
};


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

int main() {
  int  K,s,count=0;
  cin>>K>>s;
  for(int i=0;i<=K;i++){
 	 for(int j=0;j<=K;j++){
       int a=s-i-j;
       if(0<=a&&a<=K) count++;
     }
  }
  cout<<count<<endl;
}
  

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

int main() {
  int s;
  int t = 0;
  cin >> s;
  if (s % 2) { t++; }
  s = s / 10;
  if (s % 2) { t++; }
  s = s / 10;
  if (s % 2) { t++; }
  cout << t << endl;
}

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

#define int long long
#define itn int
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'
#define SZ(x) ((int)(x).size())
#define bit(n) (1LL << (n))
constexpr int MOD = 1e9 + 7;

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
using P = pair<int, int>;
using vec = vector<int>;
template <typename T>
using mat = vector<vector<T>>;

// clang-format off
template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) { return stream << p.first << "," << p.second; }
template <typename T>
void print(const vector<T> vec) { rep (i, vec.size() - 1) cout << vec[i] << ' '; cout << vec[vec.size() - 1] << '\n'; }
template <typename Arg>
void print(const Arg arg) { cout << arg << '\n'; }
template <typename Head, typename... Args>
void print(const Head head, const Args... args) { cout << head << " "; print(args...); }
template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) { rep (i, v.size()) cin >> v[i] >> w[i]; }
template <typename T>
void init(vector<T>& v) { rep (i, v.size()) cin >> v[i]; }
template <typename T>
T sum_(vector<T> vec, T init = 0) { return std::accumulate(all(vec), T(init)); }
template<typename T>
bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <typename T>
int index(const T& vec, const typename T::iterator it) { return distance(vec.begin(), it); }
template <typename T = int>
mat<T> mmat(int n, int m=0) { return mat<T>(n, vector<T>(m)); }
template <typename T = int>
vector<T> ivec(int n) { vector<T> v(n); init(v); return v; }
// clang-format on

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    print(a * b / gcd(a, b));

    return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
par=[-1 for i in range(n)]    #par<0なら自身が親で要素の個数、>0なら子で親の位置示す

def root(a):
    if par[a]<0:
        return a
    else:
        return root(par[a])

def size(a):
    return -par[root(a)]

def connect(a,b):
    a=root(a)
    b=root(b)
    if a==b:
        return False
    if size(a)<size(b):
        a,b=b,a
    par[a]+=par[b]
    par[b]=a
    return True

a=[]
for i in range(m):
    a.append([int(j)-1 for j in input().split()])

ans=0
for i in range(m):
    par=[-1 for i in range(n)] 
    for j in range(m):
        if j==i:
            continue
        if root(a[j][0])!=root(a[j][1]):
            connect(a[j][0],a[j][1])
    if -1*min(par)!=n:
        ans+=1
print(ans)




Measured memory_bytes: 44528
l,r = map(int, input().split())

if l//2019 != r//2019 or l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    ans = 2018
    for i in range(l,r+1):
        for j in range(i+1,r+1):
            ans = min(ans, (i*j)%2019)
    print(ans)

Measured memory_bytes: 3060
a = [[0 for i in range(100)] for j in range(100)]
b = [[0 for i in range(100)] for j in range(100)]
n, m, l = map(int, input().split())
for i in range(n):
    a[i][:m] = map(int, input().split())
for i in range(m):
    b[i][:l] = map(int, input().split())
for i in range(n):
    for j in range(l):
        c = 0
        for k in range(m):
            c += a[i][k] * b[k][j]
        print(c, end='')
        if j < l - 1:
            print(' ', end='')
        else:
            print()

Measured memory_bytes: 8704
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int T = sc.nextInt();

		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

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


			list1.add(sc.nextInt());
			list2.add(sc.nextInt());

		}
		sc.close();

		List<Integer> TrueList = new ArrayList<Integer>();

		for(int i = 0; i < list1.size(); i++) {
			int b = list2.get(i);
			if(b <= T) {
				TrueList.add(list1.get(i));
			}
		}

		int min = -1;

		for(int i = 0; i < TrueList.size(); i++) {
				int a = TrueList.get(i);
			if(a < min || min == -1) {
				min = a;

			}
		}

		if(min != -1) {
			System.out.println(min);
		}else {
			System.out.println("TLE");
		}

	}

}

Measured memory_bytes: 24148
// 基本テンプレート
 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

signed main() {
    int N; cin >> N;
    if(N == 0) cout << 0 << endl;
    else {
        string ans = "";
        int base = 1;
        while(N != 0) {
            if(abs(N) % abs(base * 2)) ans += '1', N -= base;
            else ans += '0';
            base *= -2;
        }
        reverse(ans.begin(), ans.end());
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int gcd_func(int x,int y);

int main(void){
  int a,b,gcd;

  cin>>a>>b;
  gcd = gcd_func(a,b);
  cout << gcd <<endl;

  return 0;
}

int gcd_func(int x,int y){
  int lrg,sml,remnant;
  if(x == y){
    return x;
  }else if(x > y){
    lrg = x;sml = y;
  }else{
    lrg = y;sml = x;
  }

  while(true){
    remnant = lrg % sml;
    if(remnant == 0){
      return sml;
    }
    lrg = sml;
    sml = remnant;
  }
}



Measured memory_bytes: 3112
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define rep1(i,n)for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=(int)(n)-1;0<=i;i--)
#define rrep1(i,n) for(int i=(int)(n);1<=i;i--)

#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(obj) (obj).begin(),(obj).end() 

#define pcount __builtin_popcount
#define SZ(x) ((int)(x).size())
#define LEN(x) ((int)(x).length())

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define endl "\n"

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;}

typedef long long lint;

using namespace std;
int main(){
	string s;
	cin>>s;
	s.at(6-1)=' ';
	s.at(14-1)=' ';
	cout<<s<<endl;
}


Measured memory_bytes: 256