akhauriyash/Code-Regression huggingface dataset:
strs = gets.to_s.split("")

cnt = 0

idx = 1
prev_idx = 0
prev_str = strs[0]

while idx < strs.size
  current_str = strs.slice(idx, idx - prev_idx).join
  idx += 1
  next if prev_str == current_str
  prev_idx = idx - 1
  prev_str = current_str
  cnt += 1
end
puts cnt


Measured memory_bytes: 25596
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int x=stdIn.nextInt(),a=stdIn.nextInt(),b=stdIn.nextInt(),c,d;
		if(x-a>0) c=x-a;
		else c=a-x;
		if(x-b>0) d=x-b;
		else d=b-x;
		System.out.print(c>d?"B":"A");
	}
}

Measured memory_bytes: 21844
h, w = (int(i) for i in input().split(' '))
m = []

def trans(string, h ,w):
    m = []
    for i in range(0, w):
        m.append(string[i::w])

    return m, w, h

def cut_dot(string_list, h, w):
    m = []
    cnt = 0
    for i in range(h):
        if string_list[i].count('.') != w:
            m.append(string_list[i])
        else:
            cnt += 1
    if cnt:
        return m, h-cnt, w, True
    else:
        return m, h-cnt, w, False

for i in range(h):
    m.append(input())

loop = True
while loop:
    m, h ,w, loop = cut_dot(m,h,w)
    if loop:
        m, h, w = trans(''.join(m), h, w)
        
for i in m:
    print(i)


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

int main(){
	string s;
	cin >> s;
	int n = s.size();
	if(s == "keyence"){
		cout << "YES" << endl;
		return 0;
	}
	for(int i = 0; i < n; i++){
		for(int j = i; j < n; j++){
			string t = "";
			for(int k = 0; k < n; k++){
				if(!(i <= k && k <= j)) t += s[k];
			}
			if(t == "keyence"){
				cout << "YES" << endl;
				return 0;
			}
		}
	}
	cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using vst=vector<string>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };


int main(){cout<<fixed<<setprecision(10);
		   string s[3];
           rep(i,0,3)cin>>s[i];
           YES(s[0][s[0].size()-1]==s[1][0]&&s[1][s[1].size()-1]==s[2][0]);
          }

Measured memory_bytes: 3408
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

int main()
{
	string a,b;
	cin >> a >> b;
	string temp = a;
	int t = a.size();
	while(t--)
	{
		rotate(a.rbegin(),a.rbegin() + 1,a.rend());
		if(a == b){
			puts("Yes");
			return 0;
		}	
	}
	puts("No");
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second

int main(){
    string s, t;
    cin >> s >> t;
    sort(all(s));
    sort(all(t));
    reverse(all(t));
    if(s < t) puts("Yes");
    else puts("No");
}


Measured memory_bytes: 3588
#!/usr/bin/env python3
import sys
from math import pow


def solve(X: int):
    def func(A):
        return pow(X+A**5, 1/5)

    for A in range(-1000, 1000):
        for B in range(-1000, 1000):
            if X == A**5-B**5:
                print(A, B)
                return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9140
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

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

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 30;


bool table[11000];
const int W=60*24*7;
const int D=60*24;

int main(void){
	int s,n,t,p,m;
	string we,ti;
	while(cin >> s >> n >> t >> we >> ti >> p >> m){
		if(s==0)
			break;

		rep(i,W) table[i]=false;

		int loop=((we=="All")?7:1);

		if(ti=="All")
			rep(i,D*loop) table[i]=true;
		else if(ti=="Day"){
			rep(i,loop)rep(j,D/2) table[i*D+D/4+j]=true;
		}else{
			rep(i,loop){
				rep(j,D/4){ 
					table[i*D+j]=true;
					table[i*D+3*D/4+j]=true;
				}
			}
		}

		int res=0;
		rep(i,W){
			int rec=0,cur=i;
			rep(j,m){
				if(table[cur%W]&&table[(cur+s)%W])
					rec++;
				cur+=t;
			}
			res=max(res,rec);
		}

		double ans=1.0-pow(1.0-1.0/p,n*res);
		cout.precision(10);
		cout << fixed << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1292
from collections import defaultdict

N ,M = list(map(int,input().split(" ")))
ac = 0
wa = 0
ac_probs = set()
wa_probs = set()
di =defaultdict(lambda :0)
for _ in range(M):
    p, s =  input().split(" ")
    if s == "AC":
        ac_probs.add(p)
    elif s == "WA":
        if p not in ac_probs:
            di[p] += 1

for temp in ac_probs:
    wa += di[temp]

print(len(ac_probs),wa)

Measured memory_bytes: 65496
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int sll;
typedef long double ld;
#define A 1000000007
#define D 100000000000000ll
#define B 998244353ll
#define C 1000000000000000000ll
#define M 4000
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<pair<ll,ll>, null_type,less_equal<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI acos(-1)
#define subt cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n" 

int main() 
{
    FAST;
    ll n,k;
    cin>>n>>k;
    ll a[n];
    ve<ll> vp,vn;
    ll ans=1;
    bool b=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if(a[i]==0)
            b=1;
        if(a[i]>0)
            vp.pb(a[i]);
        if(a[i]<0)
            vn.pb(a[i]);
    }
    n=vp.size();
    ll m=vn.size();
    sort(vp.begin(),vp.end());
    sort(vn.begin(),vn.end());
    ll x=0,y=n-1,co=0,tp=0,tn=0;
    while(y>=0 && co<k)
    {
        co++;
        y--;
        tp++;
    }
    while(co<k && x<m)
    {
        co++;
        x++;
        tn++;
    }
    if(co<k)
    {
        cout<<0;
        return 0;
    }
    if(tn&1)
    {
        if(tp!=0 && tn!=m)
        {
            tp--;
            tn++;
            y++;
            x++;
        }
        else
        {
            if(b)
                cout<<0;
            else
            {
                ve<ll> vec;
                for(int i=0;i<n;i++)
                    vec.pb(vp[i]);
                for(int i=0;i<m;i++)
                    vec.pb((-1)*vn[i]);
                sort(vec.begin(),vec.end());
                for(int i=0;i<k;i++)
                    ans=(ans*vec[i])%A;
                ans=(A-ans)%A;
                cout<<(A+ans)%A;
            }
            return 0;
        }
    }
    while(y<n-2 && x<=m-2 && (vp[y+2]*vp[y+1])<(vn[x]*vn[x+1]))
    {
        y+=2;
        x+=2;
    }
    for(int i=0;i<x;i++)
        ans=(ans*vn[i])%A;
    for(int i=n-1;i>y;i--)
        ans=(ans*vp[i])%A;
    cout<<(A+ans)%A;
    subt;
    return 0;
}

Measured memory_bytes: 8300
#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
 
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define mod 1000000007
using ll = long long;
using namespace std;
int main(){
  int n,l;
  cin >> n >> l;
  int ans = 0;
  rep(i, n) ans += l + i;
  if(l >= 0) ans -= l;
  else ans -= min(0, l + n - 1);
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const long long INF = LLONG_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i, r, n) for(int i=(ll)(r); i<(ll)(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ll long long int
using namespace std;
ll ans = 0, sum = 0, n, k, counter = 0, w, h, m;
string s;
vector<ll> v;
vector<pair<ll, ll>> vp;
vector<vector<ll>> vv(50, vector<ll>(50, INF));
map<ll, ll> mp;

int main()
{
	ll a, b, x;
	cin >> a >> b >> x;
	cout << b / x - a / x + (!a ? 1 : 0) + (!(a%x)&&a?1:0) << endl;
}

Measured memory_bytes: 256
//clang 3.8.0

#include <iostream>
using namespace std;
#define		endl		"\n"
#define		ll			long long int
#define		mod			1000000007
#define		f(i,a,b)	for(ll i = (ll)(a); i < (ll)(b); i++)
#define		rf(i,a,b)   for(ll i = (ll)(a); i > (ll)(b); i--)
#define		ull			unsigned long long
#define		ld			long double


int main()
{
    ll n;
    cin >> n;
    ll sum = 0;
    for (ll i = 0; i <= n; i++)
    {
        if (i % 3 != 0 && i % 5 != 0) {
            sum += i;
        }
    }
    cout << sum << endl;
}

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

typedef uint32_t u32;
typedef uint64_t u64;

class Team {
public:
  int id;
  int ac_num;
  int pena;
  int miss[16];
  Team() {
    ac_num = pena = 0;
    for(int& I : miss) I = 0;
  }    
private:
};

bool operator < (const Team& left, const Team& right) {
  if( left.ac_num != right.ac_num ) return -left.ac_num < -right.ac_num;
  if( left.pena != right.pena ) return left.pena < right.pena;
  return left.id > right.id;
}

bool operator == (const Team& left, const Team& right) {
  if( left.ac_num != right.ac_num ) return false;
  if( left.pena != right.pena ) return false;
  return true;
}

int main() {
  
  int M, T, P, R;
  int m, t, p, j;
  for(;;) {
    Team team[128];
    for(int i = 0; i < 128; ++i) team[i].id = i;
    std::cin >> M >> T >> P >> R;
    if( M == 0 and T == 0 and P == 0 and R == 0 ) break;
    for(int i = 0; i < R; ++i) {
      std::cin >> m >> t >> p >> j;
      if( j == 0 ) {
        team[t].pena += team[t].miss[p] * 20 + m;
        team[t].ac_num += 1;
      }
      else {
        team[t].miss[p] += 1;
      }
    }
    std::sort(team + 1, team + T + 1);
    std::cout << team[1].id;
    for(int i = 2; i <= T; ++i) {
      std::cout << (team[i-1] == team[i] ? '=' : ',') << team[i].id;
    }
    std::cout << std::endl;
  }

  
  return 0;
}

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

S = input()
n_list = list(S)
min_diff = float("inf")

for i in range(len(n_list)):
    n = int("".join(n_list[i : i + 3]))
    min_diff = min(min_diff, abs(753 - n))

ans = min_diff
print(ans)


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

#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;

struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N), B(N), C(N);
    for(int i = 0; i < N; i++) cin >> A[i];
    for(int i = 0; i < N; i++) cin >> B[i];
    for(int i = 0; i < N; i++) cin >> C[i];
    sort(all(A));
    sort(all(B));
    sort(all(C));
    ull sum = 0;
    for(int i = 0; i < N; i++) {
        ll less = lower_bound(all(A), B[i]) - A.begin();
        ll more = C.end() - upper_bound(all(C), B[i]);
        sum += less * more;
    }
    cout << sum << endl;
}

Measured memory_bytes: 2560
ans = []
loop do
  n   = gets.to_i
  min = 1010
  max = 0
  sum = 0

  if n == 0 then break
  else
    n.times do
      x = gets.to_i
      if min > x then min = x end
      if max < x then max = x end
      sum += x
    end
    ans << (sum - max - min) / (n - 2)
  end
end

ans.each do |a|
  puts a
end



Measured memory_bytes: 6852
#include <iostream>
#include <algorithm>
#include <string>
#include <set>

#define sz(x) int((x).size())
#define phb push_back
using namespace std;

const int kDir[8][2] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};

int H, W;
string P[10];

void read();
void solve();

int main() {
	while (cin >> H >> W, H + W)
		read(), solve();
	
	return 0;
}

void read() {
	for (int i = 0; i < H; ++i)
		cin >> P[i];
}

void solve() {
	static int visit[10][20], vst_cnt;
	string res;
	set< string > s;
	auto cmpf = [&] (const string &ra, const string &rb) -> string {
		if (sz(ra) != sz(rb))
			return sz(ra) > sz(rb) ? ra : rb;
		else
			return min(ra, rb);
	};
	
	for (int i = 0; i < H; ++i)
		for (int j = 0; j < W; ++j)
			for (int d = 0; d < 8; ++d) {
				string t;
				vector< string > v;
				
				int i_ = i, j_ = j;
				++vst_cnt;
				while (visit[i_][j_] != vst_cnt) {
					t.phb(P[i_][j_]), visit[i_][j_] = vst_cnt;
					if (sz(t) >= 2) {
						if (s.count(t) != 0)
							res = cmpf(res, t);
						v.phb(t);
					}
					i_ = (i_ + kDir[d][0] + H) % H, j_ = (j_ + kDir[d][1] + W) % W;
				}
				
				for (auto itr = v.begin(); itr != v.end(); ++itr)
					s.insert(*itr);
			}
	
	cout << (res != "" ? res : "0") << "\n";
}

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

typedef long long int llint;

struct P {
  int x, y;
  P(){}
  P(int x, int y) : x(x), y(y){}
};

char mas[100][100];
int memo[100][100];
int h, w;
int score = 0;

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

int main()
{
  memset(memo, -1, sizeof(memo));
  
  cin>> h >> w;

  for(int i = 1; i <= h; i++) {
    cin>> mas[i] + 1;
    mas[i][0] = mas[i][w + 1] = '#';
    for(int j = 1; j <= w; j++) if(mas[i][j] == '.') score++;
  }
  for(int i = 0; i <= w + 1; i++) mas[0][i] = mas[h + 1][i] = '#';

  
  queue<P> que;
  que.push(P(1, 1));
  memo[1][1] = score - 1;
  
  while(!que.empty()) {

    P q = que.front(); que.pop();
    
    if(q.x == w && q.y == h) break;
      
    for(int i = 0; i < 4; i++) {
      int mx = q.x + dx[i];
      int my = q.y + dy[i];
      
      if(mas[my][mx] == '#' || memo[my][mx] != -1) continue;
      memo[my][mx] = memo[q.y][q.x] - 1;
      que.push(P(mx, my));
    }

  }

  cout<< memo[h][w] <<endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
	public static void main(String[]args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int total=1;
		String s=sc.next();
		for(int i=0;i<n-1;i++){
			if(s.charAt(i)!=s.charAt(i+1)){
				total++;
			}
		}
		System.out.println(total);
	}
}

Measured memory_bytes: 23764
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		String S = stdIn.nextLine();
		String T = stdIn.nextLine();
		
		if(S.length() + 1 == T.length() && S.equals(T.substring(0, S.length()))) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

}

Measured memory_bytes: 35900
//i ll be the king
#include<bits/stdc++.h>
#define ll long long int
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define rep(n) for(ll i2=0;i2<n;i2++)
#define vmp(v,a,b) v.push_back(make_pair(a,b))
#define si(a) scanf("%lld",&a)
#define pi(a) printf("%lld",a)
#define aset(a,n,k) for(ll i3=0;i3<n;i3++)a[i3]=k; 	
#define mod 1000000007
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define f first
#define s second
using namespace std;	

int main()
{
	sync;
	ll n;
	cin>>n;
	ll arr[n+1];
	for(ll i=1;i<=n;i++)cin>>arr[i];
	pair<ll,ll> dp[n+1][n+1];
	for(ll i=1;i<=n;i++)
	{
		for(ll j=1;j+i<=n+1;j++)
		{
			ll ind=j+i-1;
			if(ind==j)
			{
				dp[j][ind].f=arr[j];
				dp[j][ind].s=0;
			}
			else
			{
				dp[j][ind].f=max(arr[j]+dp[j+1][ind].s,arr[ind]+dp[j][ind-1].s);
				dp[j][ind].s=arr[j]+dp[j+1][ind].f+dp[j+1][ind].s-dp[j][ind].f;
			}
		}
	}
	cout<<dp[1][n].f-dp[1][n].s;
}



Measured memory_bytes: 141056
#import math
import itertools
#import numpy as np
#from collections import deque


INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n,m=INTM()
    cnct=[]
    for i in range(m):
        temp=LIST()
        temp=temp[1:]
        cnct.append(temp)
    ps=LIST()
    ans=0
    
    for bit in range(2**n):
        check=[0]*m
        for i in range(n):
            if (bit>>i)&1:
                for k in range(m):
                    if i+1 in cnct[k]:
                        check[k]+=1
        
        flg=True
        for k in range(m):
            if check[k]%2!=ps[k]:
                flg=False
        
        if flg:
            ans+=1
    
    print(ans)


if __name__=='__main__':
    do()

Measured memory_bytes: 9240
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
    string s, t;

    cin >> s;
    cin >> t;

    s = s + s;
    int n = t.size();
    for (int i = 0; i < n; i++) {
        if (t == s.substr(i, n)) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    a = [1, 3, 5, 7, 8, 10, 12]
    b = [4, 6, 9, 11]
    x, y = map(int, input().split())
    if (x in a and y in a) or (x in b and y in b):
        print('Yes')
    else:
        print('No')


main()


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

using namespace std;
int dizi[100006];

int main(){
	int a;
	cin>>a;
	int mx=0;
	int kez=0;
	for(int i = 0 ;i<a;i++){
		cin>>dizi[i];
	}
	for(int i = 1 ;i<a;i++){
		if(dizi[i]<=dizi[i-1]){
			//~ cout<<dizi[i-1]<<" "<<dizi[i]<<" "<<kez<<endl;
			//~ (kez==0)?kez++:kez=kez;
			kez++;
		}
		else{
			mx=max(mx,kez);
			kez=0;
		}
	}
	cout<<max(mx,kez);
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int a = sc1.nextInt();
		int b = sc1.nextInt();

		if (a > b) {
			System.out.println("a > b");
		}
		else if (a < b) {
			System.out.println("a < b");
		}
		else {
			System.out.println("a == b");
		}

		sc1.close();

	}

}


Measured memory_bytes: 26012
import std.stdio, std.string, std.array, std.algorithm, std.conv, std.typecons, std.numeric, std.math;

void main()
{
    auto hwk = readln.split.to!(int[]);
    auto H = hwk[0];
    auto W = hwk[1];
    auto K = hwk[2];
    long[][] MAP;
    foreach (_; 0..H) MAP ~= readln.chomp.split("").to!(long[]);

    long solve(long[][] mm) {
        auto changed = true;
        long r, c;
        while (changed) {
            foreach_reverse (i; 0..H) {
                foreach (j; 0..W) {
                    if (mm[i][j] == 0) {
                        foreach_reverse (k; 0..i) if (mm[k][j] > 0) {
                            mm[i][j] = mm[k][j];
                            mm[k][j] = 0;
                            break;
                        }
                    }
                }
            }
            changed = false;
            foreach (i; 0..H) {
                foreach_reverse (l; K..W+1) {
                    foreach (x; 0..W+1-l) if (mm[i][x] > 0) {
                        foreach (j; x+1..x+l) if (mm[i][x] != mm[i][j]) goto ng;
                        changed = true;
                        r += mm[i][x] * l * 2L^^c;
                        foreach (j; x..x+l) mm[i][j] = 0;
                        ng:
                    }
                }
            }
            ++c;
        }
        return r;
    }

    long r;
    foreach (i; 0..H) {
        foreach (j; 0..W) {
            auto mm = new long[][](H, W);
            foreach (y; 0..H) foreach (x; 0..W) if (y != i || x != j) mm[y][x] = MAP[y][x];
            r = max(r, solve(mm));
        }
    }
    writeln(r);
}

Measured memory_bytes: 1276
use std::cmp::min;
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    n: usize,
    k: usize,
    a: [usize; n]
    }
    let mut ans = usize::max_value();
    for i in 0..1 << n{
        let i:usize = i;
        let q = i.count_ones() as usize;
        if q < k {
            continue
        }
        let mut c = 0;
        let mut h = a[0];
        for j in 1..n{
            if 1 << j & i > 0 && h >= a[j]{
                c += h - a[j] + 1;
                h += 1;
            } else if h < a[j] {
                h = a[j];
            }
        }
        ans = min(c, ans);
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  ll x[5];
  REP(i, 5){
    cin >> x[i];
    if(x[i] == 0){
      cout << i+1 << endl;
      return 0;
    }
  }
  return 0;
}

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

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    
    ll h, w, k; cin >> h >> w >> k;
    string c[h]; zep(i, 0, h)cin >> c[i];
    
    ll ans = 0;
    zep(i, 0, (1LL << h)){
    	zep(j, 0, (1LL << w)){
    		ll cnt = 0;
    		
    		zep(ii, 0, h){
    			zep(jj, 0, w){
    				if(c[ii][jj] == '#' && (i & (1LL << ii)) && (j & (1LL << jj))){
    					cnt++;
    				}
    			}
    		}
    		
    		if(cnt == k)ans++;
    	}
    }
    
    print(ans)
    
    return 0;
}

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


void solve(long long N){
    cout << N * N * N << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int N, count = 0, maxcount = 0;
    scanf("%d", &N);
    int H[N];
    for (int i = 0; i < N; i++)
    {
        scanf("%d", &H[i]);
    }

    for (int i = 0; i < N - 1; i++)
    {
        if (H[i] >= H[i + 1])
        {
            count++;
        }
        if (H[i] < H[i + 1])
        {
            count = 0;
        }
        if (count > maxcount)
        {
            maxcount = count;
        }
    }
    printf("%d", maxcount);
    return 0;
}

Measured memory_bytes: 640
#!usr/bin/env pypy3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]


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


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)


class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self._group_size = [1 for _ in range(n)]
        self.num_of_groups = n

    def find(self, x):
        if self.parent[x] == x:
            return x
        px = self.parent[x]
        root = self.find(px)
        self.parent[x] = root
        return root

    def union(self, x, y):
        px = self.find(x)
        py = self.find(y)
        if px == py:
            return
        if self.rank[px] < self.rank[py]:
            self.parent[px] = py
            self._group_size[py] += self._group_size[px]
        else:
            self.parent[py] = px
            self._group_size[px] += self._group_size[py]
        if self.rank[px] == self.rank[py]:
            self.rank[py] += 1
        self.num_of_groups -= 1

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def group_size(self, x):
        px = self.find(x)
        return self._group_size[px]


def main():
    N, M, K = LI()
    AB = [LI1() for _ in range(M)]
    CD = [LI1() for _ in range(K)]

    uf = UnionFind(N)

    friend = [[] for _ in range(N)]
    block = [[] for _ in range(N)]

    for (a, b) in AB:
        friend[a].append(b)
        friend[b].append(a)
        uf.union(a, b)
    for (c, d) in CD:
        block[c].append(d)
        block[d].append(c)

    for i in range(N):
        gs = uf.group_size(i)
        fc, bc = 0, 0
        for fi in friend[i]:
            fc += int(uf.is_same(i, fi))
        for bi in block[i]:
            bc += int(uf.is_same(i, bi))
        # print(i, gs, fc, bc)
        print(gs - fc - bc - 1, end=" ")


main()


Measured memory_bytes: 95404
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

    private static PrintWriter out;

    private static <T> void mprintln(T ... ar){
        for(T i: ar) out.print(i + " ");
        out.println();
    }

    public static void main(String[] args) throws FileNotFoundException{

        // Input from file
        // File inputFile = new File("JavaFile.txt");
        // File outputFile = new File("JavaOutputFile.txt");
        // FileReader fileReader = new FileReader(inputFile);
        // Here it ends

        MyScanner sc = new MyScanner();
        // MyScanner sc = new MyScanner(fileReader);

        out = new PrintWriter(new BufferedOutputStream(System.out)); // Output to console
        // out = new PrintWriter(new PrintStream(outputFile)); // Output to file

        getAns(sc);

        out.close();
    }

    /*
     *Don't use builtin function (Math.ceil)
     */

    static final long MOD = (long) (1e9 + 7);

    private static void getAns(MyScanner sc){
        int n = sc.ni(), k = sc.ni(), x = sc.ni(), y = sc.ni();
        int cur = Math.min(n, k);
        int ans = cur * x;
        n -= cur;
        ans += n * y;
        out.println(ans);
    }

    static class MyScanner{
        BufferedReader br;
        StringTokenizer st;

        MyScanner(FileReader fileReader){
            br = new BufferedReader(fileReader);
        }

        MyScanner(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nn(){
            while(st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch(IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine(){
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }

        char nc(){
            return nn().charAt(0);
        }

        int ni(){
            return Integer.parseInt(nn());
        }

        long nl(){
            return Long.parseLong(nn());
        }

        double nd(){
            return Double.parseDouble(nn());
        }

        int[] niArr0(int n){
            int[] ar = new int[n];
            for(int i = 0; i < n; i++) ar[i] = ni();
            return ar;
        }

        int[] niArr1(int n){
            int[] ar = new int[n + 1];
            for(int i = 1; i <= n; i++) ar[i] = ni();
            return ar;
        }

        long[] nlArr0(int n){
            long[] ar = new long[n];
            for(int i = 0; i < n; i++) ar[i] = nl();
            return ar;
        }

        long[] nlArr1(int n){
            long[] ar = new long[n + 1];
            for(int i = 1; i <= n; i++) ar[i] = nl();
            return ar;
        }
    }
}

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

int main(){
    int n;
    cin>>n;
    vector<int> a(n), cnt(1000001), isprime(1000001,1);
    for(int i=0;i<n;i++){
        cin>>a[i];
        ++cnt[a[i]];
    }
    for(int i=2;i<=1000000;i++){
        if(!isprime[i])continue;
        for(int j=2*i;j<=100000;j+=i){
            isprime[j]=0;
        }
        for(int j=1;i*j<=1000000;j++){
            cnt[i*j]+=cnt[j];
        }
    }
    int ans=0;
    for(int i=0;i<n;i++){
        if(cnt[a[i]]==1)++ans;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 11924
# coding: UTF-8

CONTEST_NUM = 26

class Optimizer:

    def __init__(self, days, s, c):
        self._days = days
        self._s = s
        self._c = c

    def optimize(self):
        # 貪欲法による手法
        t = []
        for d in range(self._days):
            max_d_value = 0
            max_contest = 0
            for i in range(CONTEST_NUM):
                d_value = self._s[d][i] + self._c[i] * (d + 1)
                if d_value > max_d_value:
                    max_d_value = d_value
                    max_contest = i
            t.append(max_contest + 1)
        return t


def main():
    ## 引数読み込み
    days = int(input()) # D
    c = tuple(map(int, input().split())) # c[i]
    s = [] # s[d][i]
    for i in range(days):
        s.append(tuple(map(int, input().split())))

    ## 試しに指標計算
    t = Optimizer(days, s, c).optimize()

    ## print out
    for v in t:
        print(v)

if __name__ == "__main__":
    main()


Measured memory_bytes: 9092
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX 1000000
#define SQRTMAX 20000


typedef long long int int64;

typedef struct
{
    int64 bases[100];
    int exps[100];
    int numofbase;
}divisors;

int ptable[SQRTMAX]={2};
char b_isnotprime[MAX] = {0};
int maxprime = 2;
int pnum = 1;

void makeptable(int n);
divisors getdiv(int n);
int numofdiv(int n);

//int nod[1000010]={0};

int main()
{
    makeptable(10000);
    int n,i,ans=0;
    scanf("%d",&n);

    for(i=1;i<n;i++)
    {
        //nod[i]=numofdiv(i);
        ans+=numofdiv(i);
    }
    printf("%d\n",ans);


}

void makeptable(int n)//nまでの素数テーブルをつくる
{
    int j,k,nowprime,nextprime = maxprime;
    while (nextprime < n) {
        nowprime = nextprime;
        j=nowprime;
        while(b_isnotprime[j]==1)j++;
        nextprime=j;
        for (k=j; k<=MAX; k+=j)if(b_isnotprime[k]==0)b_isnotprime[k] = 1;

        //nextprime=j;
        ptable[pnum-1]=nextprime;
        pnum++;
        //if(pnum%1000==0)printf("%d th prime : %d was made\n",pnum-1,nextprime);
    }
    maxprime =nextprime;
    //printf("%d th prime : %d was made\n",pnum-1,maxprime);
}

divisors getdiv(int n)
{
    int64 m,prevm=-1;
    int sqtn,nowp=1,i=0;

    int64 dvsr[20000];
    int x=0;
    int j;

    //素数テーブルがあるか、なかったら作る
    sqtn=(int)(sqrt((double)n));
    if(maxprime<sqtn)makeptable(sqtn);

    //1になるまで割り切っていく
    nowp=ptable[0];
    m=n;
    while(m!=1) {
        for(i=0;nowp<=sqtn;i++) {
            nowp = ptable[i];
            while(m%(int64)nowp==0) {
                m/=(int64)nowp;
                // if(m!=1)printf("dvsrided %d\n",nowp);
                //else printf("and dvsrided %d\n",nowp);
                dvsr[x++]=(int64)nowp;
            }
        }
        //x++;
        if(m!=prevm)prevm=m;
        else if(m==1)break;
        else
        {
            //if(n!=m)printf("and dvsrided %lld\n",m);
            //else printf("%lld is a prime number!\n",m);
            dvsr[x++]=m;
            break;
        }
    }
    i=0;

    divisors ret;
    for(i=0;i<100;i++)
    {
        ret.bases[i]=0;
        ret.exps[i]=0;
    }
    int basenum=0;

    for(j=0;j<x;j++)
    {
        if(j==0||(j!=0&&dvsr[j-1]!=dvsr[j]))
        {
            ret.bases[basenum]=dvsr[j];
            ret.exps[basenum]=1;
            basenum++;
        }
        else if(j!=0&&dvsr[j-1]==dvsr[j])
        {
            //printf("numofbase=%d\n",numofbase);
            ret.exps[basenum-1]++;
        }
        //printf("%lld",dvsr[j]);
        //dvsr[j]=0;
    }

    ret.numofbase=basenum;
    return ret;
}

int numofdiv(int n)
{
    divisors div = getdiv(n);
    int basenum = div.numofbase;
    int k,ret=1;

    for(k=0;k<basenum;k++)
    {
        ret*=div.exps[k]+1;
    }
    return ret;
}


Measured memory_bytes: 3196
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<bits/stdc++.h>
using namespace std;
function<void(void)> ____ = [](){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);};
using LL = int_fast64_t;
LL gcd(LL a, LL b){ return b ? gcd(b,a%b):a; }
int main(){
    ____();
    LL a, b;
    cin >> a >> b;
    cout << a * b / gcd(a,b) << endl;
    return 0;
}

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

using namespace std;
using ll = long long;
using PII = std::pair<int, int>;
using PLL = std::pair<ll, ll>;

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


const int mod = 1e9 + 7;

int main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int n, left, right, mid;
    cin >> n;
    string s, seat[n+1];

    left = 0; right = n;

    cout << 0 << endl;
    cin >> s;
    if (s == "Vacant")
        return 0;
    seat[0] = seat[n] = s;

    while(1)
    {
        mid = (left + right) / 2;
        cout << mid << endl;
        cin >> s;
        if (s == "Vacant")
            return 0;
        seat[mid] = s;

        if ((mid  - left) % 2 == 0 && seat[mid] != seat[left])
            right = mid;
        else if ((mid  - left) % 2 == 0 && seat[mid] == seat[left])
            left = mid;
        else if ((mid  - left) % 2 != 0 && seat[mid] != seat[left])
            left = mid;
        else if ((mid  - left) % 2 != 0 && seat[mid] == seat[left])
            right = mid;
    }



    return 0;
}

Measured memory_bytes: 1620
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb push_back
#define ff first 
#define ss second  
typedef pair<ll,ll> pp;
bool com(pp x,pp y){
    return x.ff<y.ff;
} 
ll power(ll a,ll b){
    ll res=1;
    while(b){
        if(b&1){
            res=(a*res)%10;
        }
        a=(a*a);
        b/=2;
    }
    return res;
} 
void solve(){
    int a[5],ans;
    for(int i=0;i<5;i++){
        cin>>a[i];
        if(!a[i]) ans=i;
    }
    cout<<ans+1;
}
int main() {
	// your code goes here
	//isprime();
	//prime(); 
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//int t;
	//cin>>t;
	//while(t--) 
	    solve();
	return 0; 
	
}


Measured memory_bytes: 3580
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;

public class Main {
  public static void main(String args[] ) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


    String input = br.readLine();
    ArrayList<String> list = new ArrayList<String>();

    String word = "";
    String character = "";

    for (String s: input.split(" ")) {
      list.add(s);
    }

    int ls =  list.size();
    int max_w = 0;
    int max_c = 0;

    for (int i = 0; i < ls; i++) {
      int count = 0;
      int length = list.get(i).length();

      for (int j = 0; j < ls; j++) {
        if(list.get(i).equals(list.get(j))){
           count++;
         }
      }

      if(count > max_w){
        max_w = count;
      }

      if (length > max_c) {
        max_c = length;
      }
    }

    for (int i = 0; i < ls; i++) {
      int count = 0;
      int length = list.get(i).length();
      for (int j = 0; j < ls; j++) {
        if(list.get(i).equals(list.get(j))){
           count++;
         }
      }

      if(count == max_w){
        word = list.get(i);
      }

      if(length == max_c){
        character = list.get(i);
      }
    }
    System.out.println(word + " " + character);
  }
}

Measured memory_bytes: 24632
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>

using namespace std;
typedef long long ll;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))
#define all(x) x.begin(),x.end()


int main()
{
	string s; cin >> s;
	int len = s.size();
	vector<int> ans(len);
	rep(i, 0, len - 1)
	{
		int rNum = 0;
		while (s[i] == 'R')
		{
			++rNum;
			++i;
		}
		ans[i - 1] += (rNum + 1) / 2;
		ans[i] += rNum / 2;
	}
	for (int i = len - 1; i >= 0; --i)
	{
		int lNum = 0;
		while (s[i] == 'L')
		{
			++lNum;
			--i;
		}
		ans[i + 1] += (lNum + 1) / 2;
		ans[i] += lNum / 2;
	}
	for (int x : ans)
	{
		cout << x << " ";
	}
	cout << "" << endl;
}

Measured memory_bytes: 1024
import qualified Data.ByteString.Char8 as BS
import Data.Maybe

readInt = fst . fromJust . BS.readInt

readIntList = map readInt . BS.words

getIntList = readIntList <$> BS.getLine

main = do
  [n, m] <- getIntList
  print $ (1900 * m + (n - m) * 100) * (2 ^ m)


Measured memory_bytes: 3732
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
typedef long long ll;
const ll longinf=1LL<<60;
using namespace std;
int n;
int b[200];
int a[200];
int ans;


int main()
{
    cin>>n;
    for (int i=1; i<n; ++i)
        cin>>b[i];
    for (int i=1; i<=n; ++i)
    {
        if (i==1) a[i]=b[i];
        else if (i==n) a[i]=b[i-1];
        else a[i]=min(b[i],b[i-1]);
        ans+=a[i];
    }
    cout<<ans<<endl;

    return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
using namespace std;
typedef long long LL;
LL gi () {
    LL ret=0; char ch=getchar();
    while((ch<'0' || ch>'9') && ch!='-') ch=getchar();
    char c=ch=='-'?getchar():ch;
    while(c>='0' && c<='9') ret=ret*10+c-'0',c=getchar();
    return ch=='-'?-ret:ret;
}
const int N = 1000;
int n,a[N];
int main () {
    n = gi();
    int mx = 1, mn = 1;
    for(int i=1;i<=n;i+=1) {
        a[i] = gi();
        if(a[i] > a[mx]) mx = i;
        if(a[i] < a[mn]) mn = i;
    }
    printf("%d\n",2*n-1);
    if(abs(a[mx]) > abs(a[mn])) {
        for(int i=1;i<=n;i+=1) printf("%d %d\n",mx,i);
        for(int i=1;i<n;i+=1) printf("%d %d\n",i,i+1);
    } else {
        for(int i=1;i<=n;i+=1) printf("%d %d\n",mn,i);
        for(int i=n;i>1;i-=1) printf("%d %d\n",i,i-1);
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
    #define ll long long
    #define rep(i,a,b) for(i=a;i<b;i++)
    #define pb push_back
    #define all(v) v.begin(),v.end()
    #define F first
    #define S second
    #define CLR(a) memset((a),0,sizeof(a))
    #define mp make_pair
    #define hell 1000000007

    using namespace std;
     //int g[105][105];
    //vector < int > wt(100004);
   // vector < int > a;
    //vector < int > v(30500);
    //int cst[102][100005];
    //int ansr[100005];
 //ll int sum,x=0,c=0,n,m,flag=0,a1,a2,flag1=0,flag2=0;
    //vector < vector < int > > adj(5000, vector < int > (5000));
 //int  dp[1000006];
   // int level[500];

    void solve()
    {
         ll int i,j=0,r=200,p,q,y=0,ans=0,d,h,flag=0,n,m,a,b,c;

     cin>>a>>b>>c>>d;
      y=b/c-((a-1)/c);
      y+=(b/d-((a-1)/d));
      h=__gcd(c,d);
       h=(c*d)/h;
       y-=(b/h-((a-1)/h));
       cout<<(b-a-y+1);


    }



    int main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        int t=1;
        //cin>>t;
        while(t--)
        solve();
    }

       /*

  void bfs( int i , int j)
       {
           vis[i][j]= true;
         queue < int > que;
         que.push(k);
         while(!que.empty())
         {
            int x= que.front();
            que.pop();
             for ( int i=1;i<=n;i++)
             {
                 if((!g[1][n] and g[x][i] ) or (g[1][n] and ! g[x][i]))
                 {
                   if(!vis[i])
                   {
                       que.push(i);
                       level[i]=level[x]+1;
                       vis[i]= true;
                   }
                 }
             }
         }
       }

      ll int por(ll int a,ll int b)
         {
            ll int k=1;
            while(b>0)
            {
                if(b%2) k=k*a,k%=hell;
                b/=2;
                a*=a; a%=hell;
            }
            return k;
         } */


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main()
{
   string S;
   cin >> S;
   int N = S.length();
   int cnt = 0;
   for (int i = 1; i < N; i++){
       if (S[i] != S[i-1]) {
           cnt++;
       }
   }
   cout << cnt << endl;
   return 0;
}


Measured memory_bytes: 512
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

import decimal as dec

a,b = sarr()
a,b = dec.Decimal(a), dec.Decimal(b)
ans = int(a*b)
print(ans)


Measured memory_bytes: 37752
#include <iostream>
#include <vector>
#include <map>

#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;

int main(int argc, char const* argv[])
{
    string s;
    cin >> s;
    map<string,int> mp;
    rep(i,s.length()){
        mp[to_string(s[i])]++;
    }

    if(mp.size() != 2){
        cout << "No" << endl;
        return 0;
    }else{
        for (auto& x:mp) {
            if(x.second != 2){
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
import numpy as np

N = int(input())
M, *A = sorted(map(int, input().split()), reverse=True)
if N == 2:
    print(M, *A)
    quit()

argmin = np.abs(np.array(A, dtype=np.int64) - M / 2).argmin()
print(M, A[argmin])


Measured memory_bytes: 23096
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

int main(){
    long long n;
    cin >> n;
    int ans = 0;
    for(long long i = 2; i * i <= n; i++){
        if(n % i != 0) continue;
        long long z = i;
        while(n % z == 0){
            n /= z;
            z *= i;
            ans++;
        }
        while(n % i == 0) n /= i;
    }
    if(n != 1) ans++;
    cout << ans << endl;
}

Measured memory_bytes: 3620
#include <iostream>

int main() {
    int k, s;
    std::cin >> k >> s;

    int cnt = 0;
    for(int x=0; x<=k; x++){
        for(int y=x; y<=k; y++){
            for(int z=y; z<=k; z++){
                if(x+y+z==s){
                    if (x==y && y==z) 
                        cnt++;
                    else if(x==y || y==z || z==x)
                        cnt+=3;
                    else
                        cnt+=6;                                     
                }
            }
        }
    }
    std::cout << cnt << std::endl;

}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
int main (void){
        long long int N,ans=0,tmp,A,B[20],C;
        int M;
        scanf("%lld\n",&N );
        scanf("%d\n",&M );
        scanf("%lld\n",&C );
        for (int i = 0; i < M; i++) {
          scanf("%lld\n",&B[i] );
        }
        for (long long int i = 0; i < N; i++) {
          tmp=0;
          for (int j = 0; j < M; j++) {
            scanf("%lld\n",&A );
            tmp+=A*B[j];
          }
          if (tmp+C>0) {
            ans++;
          }
        }
        printf("%d\n",ans );
        return 0;
}


Measured memory_bytes: 128