akhauriyash/Code-Regression huggingface dataset:
/*\
|*|  @author     : sobhanbera
|*|  @since      : 19-10-2018
|*|  @created on : 22-08-2020 07:43:28 PM
\*/
#pragma GCC optimize("O3")
#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;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

#define FORUS(nr, a, b, step) for(int nr = a; step < 0 ? nr > b : nr < b; nr += step)
#define FOR(a) FORUS(nr, 0, a, 1)
#define FORR(a) FORUS(nr, a, -1, -1)

#define dbg(x) cerr << (#x) << " -> " << (x) << endl
#define len(arr) (sizeof(arr) / sizeof(arr[0]))
#define sz(v) (v).size()

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const unsigned long long INF = 0xffffffffffffffff; //18446744073709551615
const int AAX = 0x3B9ACA09;                       //1e9+9;
const int MOD = 0x3B9ACA00;                      //1e9;

string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* s) { return (string) s; }
string to_string(vector<bool> vec) {
	string res;
	for(unsigned int i = 0; i < sz(vec); ++i) res += char('0'+vec[i]);
	return res;
}
template <size_t N> string to_string(bitset<N> bi) {
	string res = "";
	for (size_t i = 0; i < N; i++) res += static_cast<char>('0' + bi[i]);
	return res;
}
template<class A> string to_string(A a) {
    bool fi=1;
    string res;
    for(auto& x : a) {
		if(!fi) res+=' ';
		fi=0;
		res+=to_string(x);
	}
    return res;
}

template<class A> void read(A& a) {
	cin >> a;
}
template<class B, class... A> void read(B& b, A&... a) {
	read(b);
	read(a...);
}
template<class A> void read(vector<A>& a) {
	for(auto& i : a)
		read(i);
}
template<typename T, size_t n> void read(T(&arr)[n]) {
	for(size_t i = 0; i < n; ++i)
		read(arr[i]);
}

void debug() { cerr << endl; }

template<class A> void print(A a) {
	cout << a;
}
template<class A> void prints(A a) {
	cout << a << ' ';
}
template<class A> void println(A a) {
	cout << a << endl;
}

template<class B, class... A> void print(B b, A... a) {
	print(b);
	print(a...);
}
template<class B, class... A> void prints(B b, A... a) {
	prints(b);
	prints(a...);
}

void println() { print("\n"); }
template<class A> void print(vector<A> a) {
	for(int i = 0; i < sz(a) - 1; ++i)
		prints(a[i]);
	print(a[sz(a) - 1]);
}
template<typename T, size_t n> void print(T const(& arr)[n]) {
	for(size_t i = 0; i < n - 1; ++i)
		prints(arr[i]);
	print(arr[len(arr) - 1]);
}

template<class B, class... A> void println(B b, A... a) {
	println(b);
	println(a...);
}
template<class A> void println(vector<A> a) {
	for(int i = 0; i < sz(a); ++i)
		println(a[i]);
}
template<typename T, size_t n> void println(T const(& arr)[n]) {
	for(size_t i = 0; i < n; ++i)
		println(arr[i]);
}

void test_cases() {
	string s; read(s);
	int sum = 0;
	for(char c : s) sum += c - '0';
	println(sum % 9 ? "No" : "Yes");
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t = 1;
	//cin >> t;
	for(int i = 1; i <= t; ++i) test_cases();
    return EXIT_SUCCESS;
}



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

# AtCoder Grand Contest
# Problem A


def get_most_significant_digit(number: int):
    separated_number = list(map(int, str(number)))
    return separated_number[0]


def count_digit(number: int):
    return len(str(number))


def generate_candidate_value(most_significant_digit, digit_count):
    filled_with_9 = 10 ** (digit_count - 1) - 1

    if digit_count > 1:
        candidate_value = str(most_significant_digit) + str(filled_with_9)
    else:
        candidate_value = str(most_significant_digit)
    return int(candidate_value)


def sum_digit(number: int, candidate_value: int):
    result = sum(list(map(int, str(candidate_value))))

    if number >= candidate_value:
        return result
    else:
        return result - 1


if __name__ == '__main__':
    number = int(input())

    # See: https://img.atcoder.jp/agc021/editorial.pdf
    most_significant_digit = get_most_significant_digit(number)
    digit_count = count_digit(number)
    candidate_value = generate_candidate_value(most_significant_digit,
                                               digit_count)

    result = sum_digit(number, candidate_value)
    print(result)


Measured memory_bytes: 3064
using System;

class main{
	static void Main(){
		string[] str1 = Console.ReadLine().Trim().Split(' ');
		int A = int.Parse(str1[0]);
		int B = int.Parse(str1[1]);
		int ans = B - A + 1;
		for(int i = A; i <= B; i++){
			string str2 = i.ToString();
			for(int j = 0; j < str2.Length; j++){
				if(str2[j] != str2[str2.Length - j - 1]){
					ans--;
					break;
				}
			}
		}
		Console.WriteLine(ans);
	}
}

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

int main()
{
    int A, B, C, K;
    int sum = 0;
    cin >> A >> B >> C >> K;

    if(A >= K){
        sum = K;
    }
    else if((A+B >= K)){
        sum = A;
    }
    else{
        sum = A - (K-A-B);
    }
    
    cout << sum << endl;

    return 0;
}


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

int n;
char wcz[1007];

int czy[1007];

long long wyn;

void check()
{
    czy[n]=1;
    long long aktu=0;
    for (int i=1; i<=n; i++)
    {
        aktu*=10;
        aktu+=wcz[i]-'0';
        if (czy[i])
        {
            wyn+=aktu;
            aktu=0;
        }
    }
}

void rek(int v)
{
    if (v==n)
    {
        check();
        return;
    }
    czy[v]=0;
    rek(v+1);
    czy[v]=1;
    rek(v+1);
}

int main()
{
    scanf("%s", wcz+1);
    while(wcz[n+1])
        n++;
    rek(1);
    printf("%lld\n", wyn);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)

using namespace std;

void solve() {
	int n;
	cin >> n;
	vector <pair <string, int>> v(n);

	rep(i, 0, n) {
		cin >> v[i].x >> v[i].y;
	}
	string st;
	cin >> st;
	int res = 0;

	int i = 0;
	while(st.compare(v[i].first)) {
		i++;
	}
//	cout << i << endl;
	for(int k = i + 1; k < n; k++) 
		res += v[k].y;
	cout << res << endl;

}

int main() {
	int t = 1;
	//cin >> t;
	while(t--)
		solve();

	return 0;
}


Measured memory_bytes: 256
N=int(input())
s=[]
t=[]
answer=0
for i in range(N):
  s.append(int(input()))
  answer+=s[i]
  if s[i]%10!=0:
    t.append(s[i])

if answer%10!=0:
  print(answer)
  exit()

if len(t)==0:
  print(0)
  exit()
  
t.sort()

print(answer-t[0])

Measured memory_bytes: 3064
/*
    Author: Alam Khan
    AUST CSE 40th Batch

*/

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

typedef long long ll;
typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
#define pb     push_back
#define inf     2e18
#define low     -2e18
#define PI        acos(-1.0)
#define endl  "\n"
#define FAST  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr freopen("input.txt","r",stdin)
#define fw freopen("output.txt","w",stdout)
const int sz = 1e5+9;
ll a[sz*10];
ll num[1000009];
vector<ll> prime;
ll N = 1000000;
void seive()
{
    ll i,j;
    for(i=1;i<=N;i++)
        num[i]  = i;
    for(i=4; i<=N; i+=2)
        num[i] = 2;
    for(i=3; i<=sqrt(N); i+=2)
    {
        if(num[i]==i)
        {
            for(j=i*i; j<=N; j+=2*i)
            {
                num[j] = i;
            }
        }
    }
}
bool f = 0;
map<ll,ll> ma;
void func(ll n)
{
    //cout<<n<<" "<<f<<endl;
    if(n==1)
        return;
    if(num[n]==n)
    {
        if(ma.find(n)!=ma.end())
        {
            f = 1;
        }
        ma[n]++;
        return;
    }
    ll y = num[n];
    while(n%y==0)
    {
        //cout<<n<<" "<<y<<endl;
        n  = n/y;
    }
    if(ma.find(y)!=ma.end())
    {
        f = 1;
    }
    ma[y]++;
    func(n);
}
int main()
{
    ll i,n,t,k,j,x=0,y=0,m;
    seive();
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        x=  __gcd(x,a[i]);
    }

    if(x!=1)
    {
        cout<<"not coprime"<<endl;
        return 0;
    }

    for(i=0;i<n;i++)
    {
        func(a[i]);
    }
    if(f)
    {
        cout<<"setwise coprime"<<endl;
    }
    else cout<<"pairwise coprime"<<endl;
    return 0;
}



Measured memory_bytes: 24068
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;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 SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

struct edge{
  int to;
  double cost;
};

int n, m, k;
vector<edge> v[3010];
vector<int> s;

vector<double> dijkstra(int s){
  vector<double> d(n, INF);
  d[s]=0;
  priority_queue<pair<double, int> > p;
  p.push(make_pair(0, s));
  
  while(!p.empty()){
    int u=p.top().second;
    p.pop();

    REP(i, v[u].size()){
      int to=v[u][i].to;
      double cost=v[u][i].cost;

      if(d[to]>d[u]+cost){
	d[to]=d[u]+cost;
	p.push(make_pair(-d[to], to));
      }
    }
  }

  return d;
}

int main(){
  scanf("%d%d%d", &n, &m, &k);
  REP(i, m){
    int from, to;
    double cost;
    scanf("%d%d%lf", &from, &to, &cost);
    v[from-1].push_back((edge){to-1, cost});
    v[to-1].push_back((edge){from-1, cost});
  }

  vector<double> dist(n, INF);
  REP(i, k){
    int shop;
    scanf("%d", &shop);
    vector<double> d;
    d=dijkstra(shop-1);

    REP(i, n) dist[i]=min(dist[i], d[i]);
  }

  double ans=0;
  REP(i, n){
    ans=max(dist[i], ans);
    REP(j, v[i].size()){
      ans=max(ans, (dist[i]+dist[v[i][j].to]+v[i][j].cost+1)/2);
    }
  }

  cout << (int)ans << endl;
}

Measured memory_bytes: 7080
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
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;}

const int nm = 200000 + 10;

int main(){
    int n; cin >> n;
    int a[nm], b[nm];
    rep(i, n) {
        int t; cin >> t;
        a[i] = t; b[i] = t;
    }
    sort(a, a+n);
    rep(i, n) {
        if(b[i] == a[n-1]){
            cout << a[n-2] << endl;
        } else {
            cout << a[n-1] << endl;
        }
    }
}

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

int main() {
	string s;
	cin >> s;
	int x = -1;
	int y = -1;
	char a = s[0];
	char b = s[0];
	for (int i = 1; i < s.size(); i++) {
		if (s[i] == b) {
			x = i;
			y = i + 1;
			break;
		} else if (s[i] == a) {
			x = i - 1;
			y = i + 1;
			break;
		}
		a = b;
		b = s[i];
	}
	cout << x << " " << y << endl;
	return 0;
}

Measured memory_bytes: 512
import collections
S=str(input())
cc=collections.Counter(S)
alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','m','o','p','q','r','s','t','u','v','w','x','y','z']

for i in range(26):
    if cc[alphabet[i]]==0:
        print(alphabet[i])
        exit()
    if i==25:
        print('None')
        exit()



Measured memory_bytes: 9388
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
#define pi acos(-1)
using namespace std;
ll n;
ll ara[100009];
ll dp[100009];
ll  k;
ll call(ll ind )
{
    if(ind==n-1) return 0;
    ll a=LLONG_MAX,b=LLONG_MAX;
    ll &ret=dp[ind];
    if(ret!=-1) return ret;
    for(int i=1;i<=k;i++)
    {
        if(ind+i<n) a=abs(ara[ind]-ara[ind+i])+call(ind+i);
        b=min(b,a);
    }
    return ret=b;
}
int  main()
{
    memset(dp,-1,sizeof dp);
    cin>>n>>k;
    for(ll i=0;i<n;i++) cin>>ara[i];
    cout<<call(0)<<endl;
}


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

int main() {
  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: 3540
N,L = map(int, input().split())
Taste = [0] * (N+1)
min = 999
mini = -999

for i in range(1,N+1):
    Taste[i] = L+i-1
for j in range(1,N+1):
    if min > abs(Taste[j]):
        min = abs(Taste[j])
        mini = j
s = sum(Taste) - Taste[mini]
print(s) 

Measured memory_bytes: 3064
def main():
    N = int(input())
    A = [0] * (N + 1)
    cnt = 0
    for i in range(N):
        A[i] = int(input())

    for i in range(N):
        cnt += A[i] // 2
        A[i] %= 2

        if A[i] > 0 and A[i+1] > 0:
            cnt += 1
            A[i] -= 1
            A[i+1] -= 1

    print(cnt)


if __name__ == "__main__":
    main()

Measured memory_bytes: 44632
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    int N;cin >> N;
    vector<string> S(N);
    rep(i,N)cin >> S[i];

    map<string,int> m;
    rep(i,N){
        m[S[i]]++;
    }

    int ch = 0;
    for(auto a : m){
        string s = a.F;
        int c = a.S;
        chmax(ch,c);
    }

    vector<string> ans;
    for(auto a : m){
        if(a.S == ch)ans.push_back(a.F);
    }

    sort(all(ans));
    for(auto a : ans){
        cout << a << endl;
    }

}


Measured memory_bytes: 28528
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<ll,ll,ll> T;
const long long INF = 1LL<<60;
const int MOD = 1000000000+7;
#define rev(s) (string((s).rbegin(), (s).rend()))
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
// cout << fixed << setprecision(10) << ans << endl; 有効桁数指定
// *min_element(c + l, c + r) *max_element(c + l, c + r) 配列の中のmin-max
// int dx[8]={1,1,0,-1,-1,-1,0,1};
// int dy[8]={0,1,1,1,0,-1,-1,-1};
// int dx[4]={1,0,-1,0};
// int dy[4]={0,1,0,-1};
// ~ は、-1の時だけfalse

class AStationAndBus {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        string s;cin>>s;
        if (s[0]==s[1]&&s[1]==s[2]) {
            cout<<"No"<<endl;
        } else {
            cout<<"Yes"<<endl;
        }
    }
};


int main() {
	AStationAndBus solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main() {
  int a,b,c,d,e,i;
  scanf("%d%d%d",&a,&b,&c);
  if (b<=c) {
    printf("NO\n");
    return 0;
  } else {
    d=a;
    e=d%b;
    for (i=0; i<b; i++) {
      d=d%b;
      if (d==c) {
        printf("YES\n");
        return 0;
      } else if (i!=0&&d==c) {
        printf("NO\n");
        return 0;
      }
      d+=a;
    }
  }
  printf("NO\n");
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>                                           
 
//#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
 
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(s) (int)s.size()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define s second
#define f first
 
 
using namespace std;
 
 
typedef pair < long long, long long > pll;    
typedef pair < int, int > pii;
typedef unsigned long long ull;         
typedef vector < pii > vpii;
typedef vector < int > vi;
typedef long double ldb;  
typedef long long ll;  
typedef double db;                             
 
 
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
const int inf = 1e9, maxn = 4e5 + 148, mod = 1e9 + 7, N = 3e3 + 11;
const db eps = 1e-12, pi = 3.14159265359;
const ll INF = 1e18;


int n, t, dp[N][N], ans;	
pii a[N];

main () {
	cin >> n >> t;
	--t;
	forn (i, 1, n) 
		cin >> a[i].f >> a[i].s; 

	sort(a + 1, a + 1 + n);

	dp[0][0] = 0;
	forn (i, 1, n) {
		forn (j, 0, t) 
			dp[i][j] = dp[i - 1][j];
		
		forn (j, 0, t) {
			if (j + a[i].f <= t)
				dp[i][j + a[i].f] = max(dp[i][j + a[i].f], dp[i - 1][j] + a[i].s);  
//			cerr << dp[i - 1][j] << ' ' << a[i].s << endl;
			ans = max(ans, dp[i - 1][j] + a[i].s);			
		}
	}
	cout << ans << endl;
}


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

typedef long long ll;

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

    int n;
    string s,t;
    cin >> n >> s >> t;
    for(int i=0;i<n;i++){
        cout << s[i] << t[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long
#define fo(i,n) for(int i=0;i<=n;i++)
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int t, n, c;
	cin >> t;
	cout << (2 * 3.141 * t);
}

Measured memory_bytes: 3748
/*
    @uthor: Varun Mishra
    "varun21999" ->  Codechef, Codeforce, Hackerrank, Hackerearth;
*/
//#include<boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
#define int            long long int
#define ull            unsigned int
#define ld             long double
#define pb             push_back
#define pa             pair<int,int>
#define ppa            pair<pair<int,int>,int>
#define pap            pair<int,pair<int,int>>
#define v1d            vector<int>
#define v2d            vector<vector<int> >
#define vpa            vector<pair<int,int>>
#define M              1000000007
#define MN             LLONG_MIN
#define MX             LLONG_MAX
#define ff             first
#define ss             second
#define endl           "\n"
#define v1s            vector<string>
#define all(v)         v.begin(),v.end()
#define S(v)           sort(v.begin(),v.end())
#define RS(v)          sort(v.rbegin(),v.rend())
#define R(v)           reverse(v.begin(),v.end())
#define mxpq(T)        priority_queue <T>
#define mnpq(T)        priority_queue<T,vector<T>,greater<T>>
#define T              int tc;cin>>tc;while(tc--)
#define p2d(v)         for(auto a:v){for(auto b:a)cout<<b<<" ";cout<<endl;}
#define p1d(v)         for(auto a:v)cout<<a<<" ";cout<<endl;
#define ppd(v)         for(auto a:v)cout<<a.ff<<" "<<a.ss<<endl;
#define forIloop(i,n)  for(auto i=0;i<n;i++);
#define forDloop(i,n)  for(auto i=n-1;i>=0;i--);
#define qqq 400005
#define isEven(n)  (!n & 1);
const int MOD = 1e9 + 7;
// bool isEven(int n){
//     return (!(n & 1));
// }
// int popcount(int num){
//     num = num - ((num >> 1) & 0x55555555);
//     num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
//     return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
// }
// int powerOfTwo(int n){
//     return 1 << n;
// }

// int arr[1000001];
// bool temet = false;


void codeforce2(){
    int a,b; cin>>a>>b;
    int ans = a*b;
    int temp = __gcd(a,b);
    cout << ans/temp << endl;
}




int32_t main(){

    cout<<fixed<<setprecision(16);
    cin.sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    
    /*#ifndef _DEBUG
     freopen("input.txt",  "r",  stdin);
     freopen("output.txt", "w", stdout);
    #endif*/
    //auto start = high_resolution_clock::now();

    // Lucario();
    //codeforceContest();
    //hackerEarth();
    //codeChef();
    codeforce2();

   /* auto stop = high_resolution_clock::now();
    auto duration = duration_cast<seconds>(stop - start);
    cout << "Time: "<<duration.count()<<endl;*/
    return 0;
}

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

#define pb push_back
#define ff first
#define ss second

const long long MAXN = 1e5 + 21, inf = 1e18 + 21, LG = 20;

long long n;
long long a[MAXN];
long long ans;

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    for (int i = 1; i < n; i++) {
        ans += (a[i] / 2);
        if (a[i + 1] > 0) {
            ans += (a[i] % 2);
            a[i + 1] -= (a[i] % 2);
        }
    }
    
    ans += (a[n] / 2);

    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 1532
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
 
#define rep(i,n) for(ll i=0; i<(ll)(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define PB push_back
 
int main() {
    ll a,b,v,w,t;
    cin >> a >> v >> b >> w >> t;
    
    ll len = abs(b-a);
    if (len > (v-w)*t) cout << "NO" << endl;
    else cout << "YES" << endl;
}

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

template <typename T> ostream &operator<<(ostream &o,vector<T> &v)
{for(T &x:v)o<<(&x!=&v[0]?" ":"")<<x;return o;}

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

	vector<int> d(n);
	for (int &x: d)
		cin >> x;

	auto b = d.begin();
	for (int i = 1; i <= n; i++) {
		sort(b, b + i);
		cout << d << endl;
	}
}


Measured memory_bytes: 3132
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int main(){
    int n,m;
    cin>>n>>m;
    if (n % m != 0){
        printf("%d\n",n/m + 1);
    }
    else{
        cout<<n/m<<endl;

    }
}


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

/* https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/4/ALDS1_4_B
input:
5
1 2 3 4 5
3
3 4 1
output:
3

input2:
3
1 2 3
1
5
output2:
0

input3:
5
1 1 2 2 3
2
1 2
output3:
2

 */
int binarySearch(int A[], int n, int key) {
    // A[n] = key;
    // int i = 0;
    // while(A[i] != key) i++;
    // return i != n;

    int left = 0;
    int right = n;
    int mid;
    while(left < right) {
        mid = (left + right) / 2;
        if(key == A[mid]) return 1;
        if(key > A[mid]) {
            left = mid + 1;
        } else if(key < A[mid]) {
            right = mid;
        }
    }
    return 0;
}
int main() {
    int n, q;
    int S[100000];
    int key;
    int ans = 0;

    scanf("%d", &n);
    for(int i = 0; i < n; i++) scanf("%d", &S[i]);
    scanf("%d", &q);
    for(int i = 0; i < q; i++) {
        scanf("%d", &key);
        if(binarySearch(S, n, key)) ans++;
    }

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

    return 0;
}



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

using namespace std;

#define ll long long

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

    int n,w;
    cin >> n >> w;

    pair<int,int> a[n];
    for(int i = 0; i < n; i++)
    {
        cin >> a[i].first >> a[i].second;
    }

    sort(a,a+n);

    ll dp[w+1][n+1];

    for(int i = 0; i <= w; i++)
    {
        dp[i][0] = 0;
    }

    for(int j = 0; j <= n; j++)
    {
        dp[0][j] = 0;
    }

    for(int i = 1; i <= w; i++)
    {
        for(int j = 1; j <= n; j++)
        {
            dp[i][j] = dp[i][j-1];

            if(i - a[j-1].first >= 0)
            {

                dp[i][j] = max(dp[i][j], dp[i-a[j-1].first][j-1] + a[j-1].second);
            }
        }
    }

    cout << dp[w][n];
}


Measured memory_bytes: 79232
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define ktya(x) sort(all(x))
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 1e18
#define INFLL 1000000000000000007LL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)
#define PI (acos(-1))
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
//ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
ll x1,yy1,x2,yy2;
int N;
vector<pair<ll,ll> >data;
vi a,b;
ll cost[55][55];
vi tr[214514];
int dep[214514];
void dfs(int x,int d){
	dep[x]=d;
	rep(i,tr[x].size()){
		int now=tr[x][i];
		if(dep[now]==-1)dfs(now,d+1);
	}
}
int main(){
	cin>>N;
	rep(i,N-1){
		int a,b;
		cin>>a>>b;a--;b--;
		tr[a].pb(b);
		tr[b].pb(a);
	}
	rep(i,N)dep[i]=-1;
	dfs(0,0);
	int ma=0;
	int me=0;
	rep(i,N){
		if(ma<dep[i]){
			me=i;
			ma=max(ma,dep[i]);
		}
	}
	//cout<<me<<" "<<ma<<endl;
	rep(i,N)dep[i]=-1;
	ma=0;
	dfs(me,0);
	rep(i,N){
		if(ma<dep[i]){
			me=i;
			ma=max(ma,dep[i]);
		}
	}
	if((ma)%3==1){
		cout<<"Second"<<endl;
	}else{
		cout<<"First"<<endl;
		
	}
}

Measured memory_bytes: 21632
s = gets.chomp.chars

ans = 0
prev = nil
while s.size > 0
  tmp = s.shift
  if s.size < 2 && tmp == s[0]
    tmp += s.shift
    ans += 1
    break
  end
  if s.size < 1
    ans += 1
    break
  end
  if tmp == prev
    tmp += s.shift
    if tmp == s[0]
      tmp += s.shift
    end
  end
  prev = tmp
  ans += 1
end

puts ans

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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n;
	cin >> n;
	vector<pair<string,long long>> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i].first >> a[i].second;
	}
	string str;
	cin >> str;
	long long res=0;
	for(int i=n-1;i>=0;i--){
		if(str==a[i].first) break;
		res+=a[i].second;
	}
	cout << res << "\n";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
 int i,j,k,l,n,m;
 cin>>n>>m;
 i=n+m;
 j=n-m;
 k=n*m;
 if(i>=j&&i>=k)
 cout<<i;
 else if(j>=i&&j>=k)
 cout<<j;
 else
 cout<<k;
 return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int n, p, ans = 0, mini = 222222;

    scanf("%d" ,&n);
    while (n--)
    {
        scanf("%d" ,&p);

        if (mini >= p)
            ++ans;

        if (mini > p)
			mini = p;
    }

    printf("%d" ,ans);
    return 0;
}

Measured memory_bytes: 128
using System;

class TEST
{
    public static void Main()
    {
        string valuestirng = Console.ReadLine();
        int value = 0;

        foreach (char value1 in valuestirng)
        {
            value += int.Parse(value1.ToString());
        }

        if (value % 9 == 0)
            Console.WriteLine("Yes");
        else
            Console.WriteLine("No");
    }
}

Measured memory_bytes: 32776
import sys
import math
import itertools
import bisect
from copy import copy,deepcopy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

X,K,D = I()
if X >= 0:
    if K*D <= X:
        print(abs(X-K*D))
        exit()
    num1 = X-(X//D)*D
    num2 = num1-D
    if (X//D)%2 == 0:
        f = 0
    else:
        f = 1
    if (X//D)%2 != (K-X//D)%2:
        if f == 0:
            f = 1
        else:
            f = 0
    if f == 0:
        print(abs(num1))
    else:
        print(abs(num2))
else:
    X *= -1
    if K*D <= X:
        print(abs(X-K*D))
        exit()
    num1 = X-(X//D)*D
    num2 = num1-D
    if (X//D)%2 == 0:
        f = 0
    else:
        f = 1
    if (X//D)%2 != (K-X//D)%2:
        if f == 0:
            f = 1
        else:
            f = 0
    if f == 0:
        print(abs(num1))
    else:
        print(abs(num2))

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

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

//pow(llpow,modpow)
template<class T> ll llpow(ll x,T n){ll ans=1;if(x==0)ans=0;while(n){if(n&1)ans*=x;x*=x;n>>=1;}return ans;}
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;}
//最大公約数
template<class T> inline T gcd(T x,T y){if(y==0)return x; else {return gcd(y,x%y);}}
//最小公倍数
template<class T> inline T lcm(T x,T y){return x/gcd(x,y)*y;}
//逆元
long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}

#define rep(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL<<60;
int a[100];

template<class T> void printvec(T a[],int size){
    for(int i=0;i<size-1;i++){
        cout<<a[i]<<" ";
    }
    cout<<a[size-1]<<endl;
}

//挿入ソート(昇順0,降順1)
template<class T> int insertion_sort(T a[],int size,int which){
    if(which!=0&&which!=1)return -1;
        for(int i=1;i<size;i++){
        T v=a[i];
        int p=i-1;
        if(which==0){
            while(a[p]>v&&p>=0){
                a[p+1]=a[p];
                p--;
            }
        }
        else{
            while(a[p]<v&&p>=0){
                a[p+1]=a[p];
                p--;
            }
        }
        a[p+1]=v;
        printvec(a,size);
        }
    return 0;
}
int main( ){
    int n;
    cin>>n;
    rep(i,0,n)cin>>a[i];
    printvec(a,n);
    insertion_sort(a,n,0);
    return 0;
}





Measured memory_bytes: 3016
using System;
using System.Text; 
using System.Collections.Generic;
using System.Linq;

public class Remainder
{
    static char[,] cab;
    static string[] pic;
    static long H;
    static long W;

    static public void Main ()
    {
        var HW = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        H = HW[0];
        W = HW[1];
     
        
        if(H*500 >= W){
            Console.WriteLine("Yes");
        }else{
            Console.WriteLine("No");
        } 
        

    }
    
    

}


Measured memory_bytes: 13268
public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		java.util.Scanner scanner = new java.util.Scanner(System.in);

		System.out.println((Main.calc(scanner.nextInt()))?"Yes":"No");
	}

	
	public static boolean calc(int n) {
		for (int i4 = 0; i4*4 <= n; i4++) {
				if((n-i4*4)%7 == 0) {
					return true;
				}
		}
		return false;
	}
}

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

int main(){
  string s;
  cin >> s;
  int ai=-1, zi=s.length();
  for(int i=0; i<s.length(); i++){
    if(s[i]=='A'){
      ai=i;
      break;
    }
  }
  for(int i=s.length()-1; i>=0; i--){
    if(s[i]=='Z'){
      zi=i;
      break;
    }
  }
  cout << zi-ai+1;
  return 0;
}
  


Measured memory_bytes: 640
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

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



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

void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}

void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long 

#define pii pair<int,int >
#define vec vector<int >

#define pb push_back
#define mp make_pair
#define fr first
#define sc second

#define FOR(i,l,r) for(int i=l,i##_r=r;i<=i##_r;i++)

const int maxn = 1e6+10;
const int inf = 1e9;
const lf eps = 1e-8;
const int mod = 1e9+7;

char s[maxn];
int head[maxn],tot,n,col[maxn],ans,c;
struct edge{int to,nxt;}e[maxn<<1];

void ins(int u,int v) {
    // printf("%d %d\n",u,v);
    e[++tot]=(edge){v,head[u]},head[u]=tot;
}

int bfs(int s) {
    queue<int > q;q.push(s);
    while(!q.empty()) {
        int x=q.front();q.pop();c=max(c,col[x]);
        for(int i=head[x];i;i=e[i].nxt)
            if(!col[e[i].to]) col[e[i].to]=col[x]+1,q.push(e[i].to);
            else if(abs(col[e[i].to]-col[x])!=1) return 0;
    }return 1;
}

int main() {
    read(n);
    for(int i=1;i<=n;i++) {
        scanf("%s",s+1);
        for(int j=i+1;j<=n;j++) if(s[j]=='1') ins(i,j),ins(j,i);
    }
    int ans=-1;
    for(int i=1;i<=n;i++) {
        for(int j=1;j<=n;j++) col[j]=0;
        col[i]=1;c=0;
        if(bfs(i)) ans=max(ans,c);
    }write(ans);
    return 0;
}


Measured memory_bytes: 4608
n,m=map(int,input().split())
d=[[float('inf') for i in range(n)] for i in range(n)]
r=[list(map(int,input().split())) for i in range(m)]

from scipy.sparse.csgraph import floyd_warshall

for u,v,c in r:
    u,v=u-1,v-1
    d[u][v]=d[v][u]=c

d=floyd_warshall(d).tolist()

cnt=0
for u,v,c in r:
    u,v=u-1,v-1
    if d[u][v]!=c:
        cnt+=1
print(cnt)

Measured memory_bytes: 14764
n = int(input())
from collections import defaultdict
d = defaultdict(int)
mod = 1000000007
for i in range(2,n+1):
  for j in range(2,i+1):
    while i%j ==0 and i != 0:
      d[j] += 1
      i//=j
ans = 1
for i in d.values():
  ans *= (i+1)
  ans %= mod
print(ans)

Measured memory_bytes: 3436
import scala.io.StdIn.readLine

object Main extends App {
  val Array(n, m, x) = readLine().split(' ').map(_.toInt)
  val as = readLine().split(' ').map(_.toInt).toSeq
  
  val tollGatesLower = as.filter(_ < x).length
  val tollGatesHigher = as.filter(x < _).length
  println(Seq(tollGatesLower, tollGatesHigher).min)
}

Measured memory_bytes: 58608
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long N;
    cin >>N;
    long long a=1;
    long long b=1;
    long long c=1;
    long long mod=1000000007;
    for(int i=0;i<N;i++){
        a*=9;
        if(a>mod){
            a%=mod;
        }
    }
       a*=2;
        if(a>mod){
            a%=mod;
        }
    for(int i=0;i<N;i++){
        b*=8;
            if(b>mod){
            b%=mod;
        }
    }
    for(int i=0;i<N;i++){
        c*=10;
        if(c>mod){
            c%=mod;
        }
    }
     int d=c-a+b;
     if(d<0){
         d+=mod;
     }
     cout <<d<<endl;

}

Measured memory_bytes: 3624
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>

using namespace std;
const int MAXN = 100 + 10;

int n;
long double data[MAXN];
long double result;

int main(){
	scanf("%d", &n);
	
	for(register int i=1; i<=n; i++){
		scanf("%llf", &data[i]);
		result += data[i];
	}
	
	result /= n;
	
	long double minn = 123456789;
	int id = 0;
	
	for(register int i=1; i<=n; i++){
		if(abs(data[i] - result) < minn){
			minn = abs(data[i] - result);
			id = i;
		}
	}
	
	printf("%d", id - 1);

	return 0;
}


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

using namespace std;

#define ll long long
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    pair<string, string> color;
    cin >> color.first >> color.second;
    pair<int, int> balls;
    cin >> balls.first >> balls.second;
    string temp;
    cin >> temp;
    if (temp == color.first) balls.first--;
    else balls.second--;
    cout << balls.first << " " << balls.second << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define N 1000000
#define M 50000
int searchII(int *,int ,int ,int );
int main(){
    int n, q, S[N], T[M], i, j, c = 0;
    scanf("%d", &n);
    for (i = 0;i < n;i++) scanf("%d", S + i);
    scanf("%d", &q);
    for (i = 0;i < q;i++) scanf("%d", T + i);
    for (i = 0;i < q;i++)
        c += searchII(S, T[i], 0, n);
    printf("%d\n", c);
    return 0;
}
int searchII(int *S, int t, int min, int max){
    int mid;
    while (min < max) {
        mid = (min + max) / 2;
        if (S[mid] == t) return 1;
        t > S[mid] ? (min = mid + 1) : (max = mid);
    }
    return 0;
}

Measured memory_bytes: 2652
#!/usr/bin/env python3

def divide_two(k,c=0):
    if k % 2 != 0:
        return c
    else:
        return divide_two(k//2,c+1)

def makeLst(k):
    l = [0]*k
    for i in range(k):
        l[i] = divide_two(i+1)
    return l


def solve(n):
    l = makeLst(n)
    max_val = max(l)
    for i in reversed(range(n)):
        if l[i] == max_val:
            return i+1

    return 0

def main():
    N = int(input())
    print(solve(N))


if __name__ == '__main__':
    main()


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

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define INF 1e9
#define LINF 1e18
const int mod = 1e9+7;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pi;
typedef long long i64;

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

  string s;
  cin >> s;
  int n = s.size();

  vi last(26, -1), Max(26, 0);
  rep(i, 0, n) {
    int j = s[i] - 'a';
    Max[j] = max(Max[j], i - last[j]);
    last[j] = i;
  }
  rep(i, 0, 26) Max[i] = max(Max[i], n - last[i]);
  cout << *min_element(all(Max)) - 1 << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
using namespace std;
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
const int MAXN=100005;
struct edge{int x,y,next;}a[2*MAXN];int len,last[MAXN];
void ins(int x,int y){len++;a[len].x=x;a[len].y=y;a[len].next=last[x];last[x]=len;}
bitset<30> bi[MAXN],temp;int mx;
void solve(int x,int fa)
{
	bool tf=false;int fi=-1;
	for(int k=last[x];k;k=a[k].next)
	{
		int y=a[k].y;
		if(y!=fa)
		{
			solve(y,x);
			temp=bi[x]&bi[y];for(int i=29;i>=0;i--)if(temp[i]){fi=max(fi,i);break;}
			bi[x]|=bi[y];
		}
	}
	for(int i=0;i<=fi;i++)bi[x][i]=0;
	while(bi[x][fi+1])++fi,bi[x][fi]=0;
	bi[x][fi+1]=1;mx=max(mx,fi+1);
}
int n;
int main()
{
	n=read();
	for(int i=1;i<n;i++)
	{
		int x=read(),y=read();
		ins(x,y);ins(y,x);
	}solve(1,0);pr2(mx);
	return 0;
}


Measured memory_bytes: 9344
import java.util.*;
import java.util.Map.Entry;
 
class Main {
	 static int mod =  (int) (Math.pow(10,9)+7);
//	 static int mod = 998244353;
   public static void main(String[] args) {
	   
       Scanner sc = new Scanner(System.in);
       int N = sc.nextInt();
//       int M = sc.nextInt();
       String S = sc.next();
//       String T = sc.next();
       char[] s = S.toCharArray();
//       char[] t = T.toCharArray();
       boolean[] m = new boolean[1000];
       for (int i=0; i<1000; i++) {
    	   	int c1=i%10;
    	   	int c2=i/10%10;
       		int c3=i/100;
       		boolean flg1=false;
       		boolean flg2=false;
       		boolean flg3=false;
       		for(int j=0;j<N;j++) {
       			if(flg1==false&&c1==Character.getNumericValue(s[j])) {
       				flg1=true;
       				continue;
       			}
       			if(flg2==false&&flg1==true&&c2==Character.getNumericValue(s[j])) {
       				flg2=true;
       				continue;
       			}
       			if(flg2==true&&c3==Character.getNumericValue(s[j])) {
       				flg3=true;
       				break;
       			}
       		}
       		if(flg3==true) {
       			m[i]=true;
       		}
       }
       
       int ans=0;
       for(int i=0;i<1000;i++) {
    	   if(m[i]==true) {
    		   ans++;
    	   }
       }

       System.out.println(ans);
   }
      

}

Measured memory_bytes: 22456
#include<cstdio>
const int mod=998244353;
int a[1000010],f[1000010];
long long inv(int a,int p=mod){return a==1?1:(1+p*(a-inv(p%a,a)))/a%p;}
int main(){
	int N,s=0;scanf("%d",&N);
	for(int i=0;i<N;i++){
		int x;scanf("%d",&x);
		s=(s+mod-x)%mod;
		a[x]=(a[x]+x)%mod;
	}
	for(int i=*f=1;i<=1000000;i++)f[i]=1ll*f[i-1]*i%mod;
	long long I=inv(f[1000000]);
	for(int i=1000000;i;i--)f[i]=1ll*f[i-1]*I%mod,I=I*i%mod;
	for(int i=1;i<=1000000;i++){
		for(int j=i*2;j<=1000000;j+=i)(f[j]+=mod-f[i])%=mod;
		int sum=0;
		for(int j=i;j<=1000000;j+=i)(sum+=a[j])%=mod;
		s=(s+1ll*f[i]*sum%mod*sum)%mod;
//		printf("f[%d]=%d a[%d]=%d\n",i,f[i],i,a[i]);
	}
	s=s*(mod+1ll>>1)%mod;
	printf("%d\n",s);
}

Measured memory_bytes: 7936
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int sed(int N) {
    int a = N;
    int c = 0;
    bool b = true;
    while(b){
        if (a == 0) {
            b = false;
        }
        c += a % 10;
        a /= 10;
    }
    return c;
}
int main() {
    int N; cin >> N;
    int ans = 10e9 + 1;
    for (int i = 1; i <= N / 2; ++i) {
        int a = N - i;
        ans = min(ans, sed(i) + sed(a));
    }
    printf("%d\n", ans);
}


Measured memory_bytes: 3756
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
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; }
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	ll X; cin >> X;
	ll ansa = -LLINF, ansb = -LLINF;
	ll cnt = 0;
	vector<pair<ll, ll> > as;
	while(1){
		ll b = pow(cnt, 5);
		ll a = X + b;
		as.push_back({a, cnt});
		if(pow(cnt+1, 5) - b > X) break;
		cnt++;
	}
	cnt = 0;
	while(1){
		ll b = pow(cnt, 5);
		if(b > 1e9) break;
		if(X - b < 0) break;
		ll a = X - b;
		as.push_back({a, -cnt});
		cnt++;
	}
	sort(ALL(as));
	ll ans = 0;

	rep(i, 200){
		ll can = pow((ll)i, 5);
		rep(j, as.size()){
			if(can == as[j].first){
				ansa = i;
				ansb =as[j].second;
				break;
			}
		}
		if(ansa != -LLINF) break;
	}

	cout << ansa << " " << ansb << endl;
	return 0;
}


Measured memory_bytes: 4116
from math import acos, degrees
a,h,x = (int(x) for x in input().split())
S = x / a
Ss = a*h - S
a_start = a-(2*Ss / h - a)
if a_start > a:
    h_start = 2 * Ss / a
    big = (h_start**2 + a**2) ** 0.5
    angle = degrees(acos(a/big)) 
    
else:
    hb = 2*S / ((h**2+a_start**2)**0.5)
    angle = degrees(acos(hb/h))
print(angle)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define loop(i,a,b) for(ll i=a; i<b; i++)
#define revloop(i,a,b) for(ll i=a; i>=b; i--)
#define pb push_back
#define vl vector<ll>
#define vvl vector<vl>
#define pl pair<ll,ll>
#define vpl vector<pl>
#define all(c) (c).begin(), (c).end()
#define sz(a) ((a).size())
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i!=(c).end(); i++))
#define mp make_pair
#define ss second
#define ff first
#define ld long double
const ll INF = 1e13;
const ll N = 301;
const ll mod= 1000000007;
bool prime(ll x)
{
	if(x<2) return false;
	for(ll i=2; i*i<=x; i++) if(x%i==0) return false;
	return true;
}
vl fac(N);
void fact()
{
	fac[0]=1;
	loop(i,1,N) fac[i]=(fac[i-1]*i)%mod;
}
 ld dp[N][N][N];
void solve()
{
 
  ll n;
  cin>>n;
  ld p[n+1];
  ld dp[n+1][n+1], res=0;
  loop(i,1,n+1) cin>>p[i];
  loop(i,0,n+1) loop(j,0,n+1) dp[i][j]=0;
  dp[1][0] = 1-p[1];
  loop(i,2,n+1) dp[i][0] = dp[i-1][0]*(1-p[i]);
  dp[1][1] = p[1];
  loop(i,2,n+1) dp[i][i] = dp[i-1][i-1]*p[i];
  loop(i,1,n+1) loop(j,1,i) dp[i][j] = dp[i-1][j]*(1-p[i]) + dp[i-1][j-1]*p[i];
  loop(i,n/2+1,n+1) res+=dp[n][i];
  cout<<fixed<<setprecision(10)<<res;
}

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t=1;
    //cin>>t;
    while(t--) solve();
 return 0;
}

Measured memory_bytes: 140928
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
void PANA2020B()
{
	ull H, W;
	cin >> H >> W;
  	if (H == 1 || W == 1)
	{
		cout << 1 << endl;
		return;
	}
	ull x = (H + 1) / 2;
	ull y = H / 2;
	ull z = (W + 1) / 2;
	ull w = W / 2;
	ull ans = x * z + y * w;
	cout << ans << endl;
}
int main()
{
	PANA2020B();
	return 0;
}


Measured memory_bytes: 256