akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
    using namespace std;
     
    int main()
    {
        int a, b, c;
        cin >> a >> b >> c;
        int cnt = 0;
        if (a == b)
        {
            cnt++;
        }
        if (b == c)
        {
            cnt++;
        }
        if (c == a)
        {
            cnt++;
        }
        if (cnt == 1)
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }

Measured memory_bytes: 256
use proconio::{fastout, input};
use std::cmp;

const MOD: u64 = 2019;

#[fastout]
fn main() {
    input! {
        l: u64,
        mut r: u64,
    }

    if r >= l + 2019 {
        r = l + 2018;
    }

    let mut v = Vec::with_capacity(2020);

    for i in l..=r {
        v.push(i % MOD);
    }

    let mut ans = 2018;

    for i in &v {
        for j in &v {
            if i == j {
                continue;
            }
            ans = cmp::min(ans, (i * j) % MOD);
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 2192
N, D = map(int, input().split())

point_list = []
for _ in range(N):
    X = list(map(int, input().split()))
    point_list.append(X)

import math
def calc_distance(arr1, arr2):
    total = 0
    for x, y in zip(arr1, arr2):
        total += (x - y) ** 2
    return math.sqrt(total)

ans = 0
for i in range(len(point_list)):
    for j in range(i + 1, len(point_list)):
        ans += calc_distance(point_list[i], point_list[j]).is_integer()
        
print(ans)

Measured memory_bytes: 38384
using System;
class Program
{
    static void Main(string[] args)
    {
        var d=Read();
        var t="Christmas";
        for(var i=d;i<25;i++){
            t+=" Eve";
        }
        Write(t);
    }

    static void Write(string s) { Console.WriteLine(s); return; }
    static void Write(long n) { Console.WriteLine(n.ToString()); return; }
    static string ReadStr() { return Console.ReadLine(); }
    static string[] ReadStrs() { return Console.ReadLine().Split(' '); }
    static long Read() { return long.Parse(Console.ReadLine()); }
    static long[] Read(long n)
    {
        long[] p = new long[n];
        string[] t = Console.ReadLine().Split(' ');
        for(long i = 0; i < n; i++) { p[i] = long.Parse(t[i]); }
        return p;
    }
    static long abs(long n) { return (n > 0) ? n : -n; }
    static long gcd(params long[] n) { long p = n[0]; for (long i = 1; i < n.Length; i++) { p = gcd(p, n[i]); } return p; }
    static long gcd(long a, long b) { return (a==0)?b:gcd(b % a, a); }
    static long lcm(params long[] n) { long p = n[0]; for (long i = 1; i < n.Length; i++) { p = lcm(p, n[i]); } return p; }
    static long lcm(long a, long b) { return a * b / gcd(a, b); }
    static long max(params long[] n) { long p = n[0]; for (long i = 1; i < n.Length; i++) { p = (p>n[i])?p:n[i]; } return p; }
    static long min(params long[] n) { long p = n[0]; for (long i = 1; i < n.Length; i++) { p = (p<n[i])?p:n[i]; } return p; }
    static void YN(bool t) { Console.WriteLine(t ? "YES" : "NO"); }
    static void Yn(bool t) { Console.WriteLine(t ? "Yes" : "No"); }
    static void yn(bool t) { Console.WriteLine(t ? "yes" : "no"); }
    static string clip(string s, int start, int count)
    {
        if (start + count < s.Length) { s = s.Remove(start + count); }
        if (start > 0) { s = s.Remove(0, start); }
        return s;
    }
}


Measured memory_bytes: 13140
#include <stdio.h>
#include <math.h>

int N, A[100010], all = 0;

int direc(int i) {
	if ((A[i + 1] - A[i] <= 0 && A[i + 2] - A[i + 1] <= 0) || (A[i + 1] - A[i] >= 0 && A[i + 2] - A[i + 1] >= 0))return 0;
	else return 1;
}

int main() {
	scanf("%d", &N);
	for (int i = 0; i < N; i++) scanf("%d", &A[i + 1]);
	A[0] = 0, A[N + 1] = 0;
	for (int i = 0; i <= N; i++) all += abs(A[i] - A[i + 1]);
	for (int i = 0; i < N; i++) {
		if (direc(i) == 0)printf("%d\n", all);
		else printf("%d\n", all - abs(A[i + 1] - A[i])- abs(A[i + 1] - A[i+2])+ abs(A[i + 2] - A[i]));
	}
	return 0;
}

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

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

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

int main(void){
    string s,t;
    cin >> s;
    cin >> t;
    if(s[0]==t[0]&&s[1]==t[1]&&s[2]==t[2]){
        cout << "3" << endl;
    } else if((s[0]==t[0]&&s[1]==t[1]) || (s[0]==t[0]&&s[2]==t[2]) || (s[2]==t[2]&&s[1]==t[1])){
        cout << "2" << endl;
    } else if( s[0]==t[0] || s[1]==t[1] || s[2]==t[2] ){
        cout << "1" << endl;
    } else {
        cout << "0" << endl;
    }
    return 0;
}


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

using namespace std;
long long n,m,cur;
long long ans[100005],u[100005],v[100005];
struct DSU{
	long long connected;
	long long par[100005],sz[100005];
	void init(long long n){
		for(long long i=1;i<=n;i++){
			par[i]=i;
			sz[i]=1;
		}
		connected=n;
	}
	long long getPar(long long k){
		while(k!=par[k]){
			par[k]=par[par[k]];
			k=par[k];
		}
		return k;
	}
	long long getSize(long long k){
		return sz[getPar(k)];
	}
	void unite(long long u, long long v){
		long long par1=getPar(u),par2=getPar(v);
		if(par1==par2)
			return;
		connected--;
		if(sz[par1]>sz[par2])
			swap(par1, par2);
		cur-=sz[par1]*sz[par2];
		sz[par2]+=sz[par1];
		sz[par1]=0;
		par[par1]=par[par2];
	}
};
DSU dsu;
int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>n>>m;
	dsu.init(n);
	cur=n*(n-1)/2;
	for(long long i=1;i<=m;i++)
		cin>>u[i]>>v[i];
	for(long long i=m;i>=1;i--)
	{
		ans[i]=cur;
		dsu.unite(u[i],v[i]);
	}
	for(long long i=1;i<=m;i++)
		cout<<ans[i]<<endl;
	return 0;
} 

Measured memory_bytes: 5248
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>

#define BUF_SIZE 200

int get_int2(int *a1, int *a2) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d", a1, a2);
#else
#error
#endif
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
#ifdef BUF_SIZE
    char line[BUF_SIZE];
    char *tmpbuf = line;
    int i;
    if(!fgets(line, BUF_SIZE, stdin)) return -1;
    for(i = 0; i < size; i++) {
        char *tmp = strtok(tmpbuf, " ");
        arr[i] = strtol(tmp, NULL, 10);
        tmpbuf = NULL;
    }
#else
#error
#endif
    return 0;
}

#define NUM_MAX 15
#include <limits.h>

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) > (b) ? (b) : (a))

int main(void) {
    int num, colors;
    get_int2(&num, &colors);
    
    int buildings[NUM_MAX];
    fget_array(buildings, num);

    int pat;
    uint64_t min_cost = LONG_MAX;
    // LSB1 always 1; mostfront building should be always colored!
    for(pat = 1; pat < (1<<num); pat+=2) {
        uint64_t cost = 0;
        if(__builtin_popcount(pat) != colors) continue;
        int idx;
        int height = buildings[0];
        for(idx = 1; idx < num; idx++) {
            // update height
            if(pat & (1<<idx)) {
                // required height
                height = (height >= buildings[idx]) ? height+1 : buildings[idx];
                cost += height - buildings[idx];
            } else {
                height = max(height, buildings[idx]);
            }
        }
#ifdef DEBUG
        printf("%d -> %lld\n", pat, cost);
#endif
        min_cost = min(min_cost, cost);
    }
    printf("%lld\n", min_cost);
    return 0;
}

Measured memory_bytes: 128
let readIntArray () =
    stdin.ReadLine().Split(" ") |> Array.map int64

let rec solve sum before list =
    match list with
    | [] -> sum
    | x :: xx -> if x > before then solve sum x xx else solve (sum + (before - x)) before xx

stdin.ReadLine()

readIntArray ()
|> Array.toList
|> solve 0L 0L
|> printfn "%d"


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

namespace Atcoder
{
    class Program2
    {
        public static void Main(string[] args)
        {
            string[] arg = Console.ReadLine().Split(' ');
            Console.WriteLine(int.Parse(arg[0]) * int.Parse(arg[1]) / 2);

        }
    }
}


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

int main() {
	long long int test,n,i,j,k,x,y,t;
	cin>>n;
	long a[n],dp[n];
	for(i=0;i<n;i++){
	    cin>>a[i];
	}
	dp[0]=0;
	dp[1]=dp[0]+abs(a[1]-a[0]);
	k=2;
	for(i=2;i<n;i++){
	    dp[i]=1e9;
	    x=k;
	    j=1;
	    while(x--){
	        dp[i]=min(dp[i],dp[i-j]+abs(a[i]-a[i-j]));
	        j++;
	    }
	}
/*	for(i=0;i<n;i++){
	    cout<<dp[i]<<" ";
	}*/
	cout<<dp[n-1]<<endl;
}


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

using namespace std;


//repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)

#define MOD 1000000007
#define sp ' '


using ll = long long;


ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    double a[n];
    double mn = 99999;
    int idx;
    int sum = 0;
    double mean;

    rep(i, n){
        cin >> a[i];
        sum += a[i];
    }

    mean = static_cast<double>(sum) / n;


    rep(i, n){
        a[i] = abs(a[i] - mean);
    }

    rep(i, n){
        if(a[i] < mn){
            mn = a[i];
            idx = i;
        }
    }

    cout << idx << endl;


    return 0;
}


Measured memory_bytes: 256
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b = readInts()
print(a*b)


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

int main()
{
    string a, b, c;
    cin >> a >> b >> c;
    if (a[(int)a.length() - 1] == b[0] && b[(int)b.length() - 1] == c[0])
    {
        cout << "YES";
    }else
    {
        cout << "NO";
    }
    
}

Measured memory_bytes: 256
N,K=input().split()
N,K=int(N),int(K)
A=input().split()

A=[int(N) for N in A]

prev=0
foll=0
for i in range(N):
    for j in range(i):
        if A[i]>A[j]:
            prev+=1
    for j in range(i,N):
        if A[i]>A[j]:
            foll+=1

a = (K*(K-1)//2)%(10**9+7)
b = foll*K%(10**9+7)
u= (prev+foll)*a+b
print(u%(10**9+7))

Measured memory_bytes: 3316
#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
typedef pair<int, int>P;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll MOD = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 5000100;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
ll dp[101010];

//union-find木について
ll par[101010];
ll rank2[101010];

void init(ll n) {
	rep(i, n) {
		par[i] = i;
		rank2[i] = 0;
	}
}

ll find(ll x) {
	if (par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

void unite(ll x, ll y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rank2[x] < rank2[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rank2[x] == rank2[y]) {
			rank2[x]++;
		}
	}
}

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

//long longしか使わない
//素数は1より大きい
int main() {
	long double a, b;
	cin >> a >> b;
	ll ans = a * b;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3716
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
/////////

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

////定数
const int INF = (int)1e9 + 10;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
template<typename T>
void chmax(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void chmin(T& a, T b) {
	a = min(a, b);
}

template<typename T>
void IN(vector<T> &A,int N=-1) {
	if (N == -1) {
		N = A.size();
	}
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
	}
}

template<typename T>
void SO(vector<T> &A,bool F=false) {
	sort(A.begin(), A.end());
	if (F) {
		reverse(A.begin(), A.end());
	}
}
//////////////

void solve() {
	LL A, B, N;
	cin >> A >> B >> N;
	LL a = A / B;
	LL b = A % B;
	LL y = min(B - 1,N);
	LL ans = a * y + (b * y) / B;
	cout << ans << endl;
}

signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}

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

int main(){
  int n, m;
  cin >> n >> m;
  vector<int> ans(n), b(m);
  rep(i, m) {
    int s, t;
    cin >> s >> t;
    s--; t--;
    ans[s]++;
    ans[t]++;
  } 
  rep(i, n){
    cout << ans[i] << endl;
  }

}

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

int main()
{
    string s,t,s1="",t1="";
    cin>>s>>t;
    int a[26]={0},b[26]={0};
    for(int i=0;i<s.size();i++)
    a[s[i]-97]++;
    for(int i=0;i<t.size();i++)
    b[t[i]-97]++;
    int i=0,j=0;
    while(i<26)
    {
        while(a[i])
        s1+=i+97,a[i]--;
        i++;
    }
    i=25,j=0;
    while(i>=0)
    {
        while(b[i])
        t1+=i+97,b[i]--;
        i--;
    }
    if(s1<t1)
    cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll MOD = 1e9+7;

int main(){
    string S;
    cin >> S;
    ll Q;
    cin >> Q;
    string head = "";
    string tail = "";
    bool rev = false;
    REP(q,Q){
        int t;
        cin >> t;
        if(t == 1){
            rev = !rev;
        }
        else{
            int f;
            char c;
            cin >> f >> c;
            if(f == 1){
                if(rev) tail += c;
                else head += c;
            }
            else{
                if(rev) head += c;
                else tail += c;
            }
        }
    }

    reverse(head.begin(), head.end());
    S = head + S + tail;

    if(rev)
        reverse(S.begin(), S.end());


    cout << S << endl;
    return 0;
}


Measured memory_bytes: 1348
import java.util.Scanner;

class Main {
    static int h,w;
    static char[][] grid;
    static int[][] count;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        h = Integer.parseInt(sc.next());
        w = Integer.parseInt(sc.next());
        grid = new char[h][w];
        count = new int[h][w];
        int offset = 0;
        int cnt = 0;
        for(int i=0;i<h;i++){
            grid[i] = sc.next().toCharArray();
            cnt = 0;
            offset = 0;
            for(int j=0;j<w;j++){
                if(grid[i][j]=='.'){
                    cnt++;
                }else{
                    for(int k=offset;k<j;k++){
                        count[i][k] += cnt;
                    }
                    offset = j+1;
                    cnt = 0;
                }
            }
            for(int k=offset;k<w;k++){
                count[i][k] = cnt;
            }
        }
        int max = 0;
        for(int i=0;i<w;i++){
            cnt  = 0;
            offset = 0;
            for(int j=0;j<h;j++){
                if(grid[j][i]=='.'){
                    cnt++;
                }else{
                    for(int k=offset;k<j;k++){
                        count[k][i] += cnt;
                        max = Math.max(max, count[k][i]);
                    }
                    offset = j+1;
                    cnt = 0;
                }
            }
            for(int k=offset;k<h;k++){
                count[k][i] +=cnt;
                max = Math.max(max, count[k][i]);
            }
        }
        System.out.println(max-1);
        sc.close();
    }

    
}

Measured memory_bytes: 69872
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
using namespace std;

#define LL long long
#define DB double
#define MAXN 1000000
#define MOD 998244353
#define Pr pair<int,int>
#define X first
#define Y second
#define INF 1000000000000000000
#define mem(x,v) memset(x,v,sizeof(x))

LL read(){
	LL x=0,F=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')F=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*F;
}

int add(int a,int b){return (a+b>=MOD)?a+b-MOD:a+b;}
int dec(int a,int b){return (a-b<0)?a-b+MOD:a-b;}
int mul(int a,int b){return (1LL*a*b)%MOD;}
int fst_pow(int a,int b){
	int res=1;
	while(b){
		if(b&1)res=mul(res,a);
		a=mul(a,a),b>>=1;
	}
	return res;
}

int n,m,ans;
int fac[MAXN+5],ifac[MAXN+5];
void prepare(){
	fac[0]=1;
	for(int i=1;i<=MAXN;i++)fac[i]=mul(fac[i-1],i);
	ifac[MAXN]=fst_pow(fac[MAXN],MOD-2);
	for(int i=MAXN;i>=1;i--)ifac[i-1]=mul(ifac[i],i);
}
int Comb(int a,int b){return mul(fac[a],mul(ifac[a-b],ifac[b]));}

int main(){
	prepare();
	n=read(),m=read();
	if(n>m)swap(n,m);
	for(int i=1;i<=n;i++)
	ans=add(ans,mul(Comb(i*2,i),Comb(n+m-2*i,n-i)));
	ans=mul(ans,mul(ifac[2],fst_pow(Comb(n+m,n),MOD-2)));
	printf("%d\n",add(ans,max(n,m)));
}

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

const int mo=int(1e9+7);
int n,a[100],f[55][105][105],ans;

void upd(int &x,int y){if ((x+=y)>=mo)  x-=mo;}

void work()
{
	scanf("%d",&n);
	for (int i=1; i<2*n; i++)  scanf("%d",&a[i]);
	sort(a+1,a+2*n);
	f[n][1][1]=1;
	for (int i=n; i>1; i--)
		for (int j=1; j<=2*(n-i)+1; j++)
			for (int k=1; k<=2*(n-i)+1; k++)
				if (f[i][j][k])
					{
						int nj=j+(a[i]!=a[i-1])+(a[2*n-i]!=a[2*n-i+1]);
						int nk=k+(a[i]!=a[i-1]);
						for (int l=1; l<nk; l++)  upd(f[i-1][nj-(nk-l-1)][l],f[i][j][k]);
						upd(f[i-1][nj][nk],f[i][j][k]);
						for (int l=nj; l>nk; l--)  upd(f[i-1][nj-(l-nk-1)][nk+1],f[i][j][k]);
					}
	for (int i=1; i<2*n; i++)
		for (int j=1; j<2*n; j++)
			upd(ans,f[1][i][j]);
	printf("%d",ans);
}

int main()
{
	work();
	return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
#define endl "\n"


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin>>s;
    int c=1, ans=0;
    if(s=="SSS") cout<<"0"<<endl;
    else{
    for(int i=1;i<s.length();++i){
        if(s[i]=='R' && s[i]==s[i-1]) c++;
        if(c>ans) ans=c;
        if(s[i]!=s[i-1]) c=1;
    }

    cout<<ans<<endl;
    }
}



  
  
    
  
    

    


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define sz(v) (int)v.size() 
#define all(v) v.begin(), v.end()
void dbg_out() { cerr << "\b\b]\n"; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T){ cerr << H << ", "; dbg_out(T...);}
#define watch(...) cerr << "[" << #__VA_ARGS__ << "]: [", dbg_out(__VA_ARGS__)


/****************************** CODE IS HERE ***********************************/

const int N = 1e5 + 4;
vector <int> g[N];
bitset <N> used;
vector <int> v;
vector <int> path(N, 0);

void topsort(int u) {
    used[u] = true;
    for (int nebr: g[u]) {
        if (!used[nebr])
            topsort(nebr);
    }
    v.push_back(u);
}


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

    int n, m; cin >> n >> m;
    for (int i = 0, x, y; i < m; ++i) {
        cin >> x >> y;
        g[x].push_back(y);
    }
    for (int i = 1; i <= n; ++i){
        if (!used[i])
            topsort(i);
    }
    reverse(all(v));
    for (int i = n-1; i >= 0; --i) {
        int u = v[i];
        for (int v: g[u])
            path[u] = max(path[u], path[v]+1);
    }

    int ans = *max_element(all(path));
    cout << ans;



    return 0;
}

/*
If you see the graph, it is DAG, so it must have a node which has path length = 0 and this is the base case
and as you already guessed that recurrence relation would be:
    f(u) = max(f(u), f(v) + 1), u-->v for each node u and its neighbour v.
    So, to be sure you start from that node which is least depend on others you need to do topsort.

*/

Measured memory_bytes: 8828
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int main()
{
	int h, w, k;
	cin >> h >> w >> k;
	char a[801][801];
	int sx, sy;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			cin >> a[i][j];
			if(a[i][j] == 'S'){
				sx = i;
				sy = j;
			}
		}
	}
	vector<vector<int> > tesu(h, vector<int>(w, -1));
	queue<pair<int, int> > qu;
	qu.push(make_pair(sx, sy));
	tesu[sx][sy] = 0;
	int ans = (min(min(sx, h - 1 - sx), min(sy, w - 1 - sy)) - 1) / k + 2;
	int dx[4] = {1, 0, -1, 0};
	int dy[4] = {0, 1, 0, -1};
	while(!qu.empty()){
		int x = (qu.front()).first;
		int y = (qu.front()).second;
		qu.pop();
		if(tesu[x][y] >= k) continue;
		for(int i = 0; i < 4; i++){
			int nx = x + dx[i];
			int ny = y + dy[i];
			if(nx < 0 || ny < 0 || nx >= h || ny >= w || tesu[nx][ny] >= 0 || a[nx][ny] == '#') continue;
			tesu[nx][ny] = tesu[x][y] + 1;
			if(nx == 0 || nx == h - 1 || ny == 0 || ny == w - 1) ans = 1;
			else ans = min(ans, (min(min(nx, h - 1 - nx), min(ny, w - 1 - ny)) - 1) / k + 2);
			qu.push(make_pair(nx, ny));
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3456
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
using namespace std;
long long MOD = 1e9 + 7;

int N;
vector<int> res;

int main() {
	cin >> N;
	while (N != 0) {
		if (N & 1) {
			res.push_back(1);
			N--;
			N /= -2;
		}
		else {
			res.push_back(0);
			N /= -2;
		}
	}
	if (res.size() == 0)cout << 0 << endl;
	else {
		for (int n = res.size() - 1; n >= 0; n--)cout << res[n];
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string a,b;
int main()
{
	getline(cin,a);getline(cin,b);
	sort(b.begin(),b.end(),greater<char>());
	sort(a.begin(),a.end());
	if(a<b) printf("Yes\n");
	  else printf("No\n");
	return 0;
 } 

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

using namespace std;

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define pb emplace_back
#define ll long long
#define ld long double

const int INF = 2e9 + 1;
const ll INFLL = 1e18 + 1;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        if (i % 3 != 0 && i % 5 != 0) ans += i;
    }
    cout << ans;
    return 0;
}



Measured memory_bytes: 3560
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n, k;
  cin >> n >> k;
  multiset<ll> se;
  vector<int> a(n);
  rep(i, n) cin >> a.at(i);
  rep(i, n){
    ll add = 0;
    rep2(j, i, n){
      add += a.at(j);
      se.insert(add);
    }
  }

  ll ans = 0;
  rrep(bit, 45){
    int co = 0;
    for(auto l : se){
      if((l & (1LL << bit)) != 0) co++;
    }
    if(co >= k){
      auto itr = se.begin();
      while(itr != se.end()){
        if((*itr & (1LL << bit)) == 0){
          itr = se.erase(itr);
        }else{
          itr++;
        }
      }
      // cerr << endl;
      // for(auto i : se){
      //   cerr << i << " ";
      // }
      // cerr << endl;
      ans += 1LL << bit;
    }
    // cerr << co << " " << bit << " " << ans << endl;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 27056
#include<bits/stdc++.h>
using namespace std;
int N,c,a[1005],ans;
bool ps(int x,int y)
{
	if(x>y)return 1;
	return 0;
}
int main()
{
    cin>>c>>N;
	for(int i=0;i<c;i++)
	{
		cin>>a[i];
	}
	sort(a,a+c,ps);
	for(int i=0;i<N;i++)
	{
		ans+=a[i];
	}
	cout<<ans<<endl;


    return 0;
}

Measured memory_bytes: 256
#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 ll long long
#define endl "\n"
#define ar array
#define pb push_back
#define sz(X) ((int)(X).size())
#define ordered_set tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
#define sort_unique(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define get_pos(c, x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define debug(...) {printf("[DEBUG] ");cout+(__VA_ARGS__);}
#define all(X) (X).begin(), (X).end()
#define  No cout<<"NO"<<endl;
#define  Yes cout<<"YES"<<endl;
#define  nl cout<<endl;

template<typename T>
ostream &operator+(ostream &out, const vector<T> &vec) {
    for (const auto &x : vec) {
        out << x << " ";
    }
    out << "\n";
    return out;
}

template<typename T>
ostream &operator*(ostream &out, const vector<T> &vec) {
    for (const auto &x : vec) {
        out + x;
    }
    return out;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &vec) {
    for (auto &x : vec) {
        in >> x;
    }
    return in;
}

template<class T>
bool ckmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; }

template<class T>
bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const ll INF = 1e18 + 6;

void solve() {
    int h, w, k;
    cin >> h >> w >> k;
    string a[h];
    for(int i=0;i<h;i++){
        cin>>a[i];
    }
    ll ans=0;
    for (int mask1 = 0; mask1 < (1 << h); mask1++) {
        for (int mask2 = 0; mask2 < (1 << w); mask2++) {
            int cnt=0;
            for(int i=0;i<h;i++){
                for (int j = 0; j <w ; ++j) {
                    if((mask1&(1<<i))&&(mask2&(1<<j))&&a[i][j]=='#'){
                        cnt++;
                    }
                }
            }
            if(cnt==k){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    //cin >> t;
    while (t--)solve();
    // cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
    return 0;
}
//look if it requires ll


Measured memory_bytes: 3580
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (x, y) = scan!(i64, i64);
    if (x - y).abs() <= 1 {
        println!("Brown")
    } else {
        println!("Alice")
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fr(i,n,x) for(int i=0;i<n;i+=x)
#define pb push_back
#define ff first
#define ss second 

int main(){	
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  	int n;
  	cin>>n;
  	string s;
  	map<string,int> m;
  	while(n--){
  		cin>>s;
  		m[s]++;
	  }
	  cout<<"AC x "<<m["AC"]<<endl;
		cout<<"WA x "<<m["WA"]<<endl;
		cout<<"TLE x "<<m["TLE"]<<endl;
		cout<<"RE x "<<m["RE"]<<endl;	  
  		
	
}


Measured memory_bytes: 3664
import java.util.Scanner;

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

	static boolean isPrime(int a) {
		if(a == 2) {
			return(true);
		} else if(a < 2 || a % 2 ==0) {
			return(false);
		} else {
			for(int i = 3; i <= Math.sqrt(a); i++) {
				if(a % i == 0) {
					return(false);
				}
			}
			return(true);
		}
	}
}



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

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = a; i >= (n); i--)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	ll n, sum = 100;
  cin >> n;
  rep(i, n) {
    sum = ceil(sum * 1.05);
  }
  cout << sum * 1000 << endl;
	return 0;
}


Measured memory_bytes: 3144
class Convolution:
    sum_e = (911660635, 509520358, 369330050, 332049552, 983190778, 123842337, 238493703, 975955924, 603855026, 856644456, 131300601, 842657263, 730768835, 942482514, 806263778, 151565301, 510815449, 503497456, 743006876, 741047443, 56250497, 0, 0, 0, 0, 0, 0, 0, 0, 0)
    sum_ie = (86583718, 372528824, 373294451, 645684063, 112220581, 692852209, 155456985, 797128860, 90816748, 860285882, 927414960, 354738543, 109331171, 293255632, 535113200, 308540755, 121186627, 608385704, 438932459, 359477183, 824071951, 0, 0, 0, 0, 0, 0, 0, 0, 0)
    ROOT = 3
    def __init__(self, mod):
        self.MOD = mod

    def __butterfly(self, arr):
        n = len(arr)
        h = (n - 1).bit_length()
        for ph in range(1, h + 1):
            w = 1 << (ph - 1)
            p = 1 << (h - ph)
            now = 1
            for s in range(w):
                offset = s << (h - ph + 1)
                for i in range(p):
                    l = arr[i + offset]
                    r = arr[i + offset + p] * now
                    arr[i + offset] = (l + r) % self.MOD
                    arr[i + offset + p] = (l - r) % self.MOD
                now *= Convolution.sum_e[(~s & -~s).bit_length() - 1]
                now %= self.MOD

    def __butterfly_inv(self, arr):
        n = len(arr)
        h = (n - 1).bit_length()
        for ph in range(1, h + 1)[::-1]:
            w = 1 << (ph - 1)
            p = 1 << (h - ph)
            inow = 1
            for s in range(w):
                offset = s << (h - ph + 1)
                for i in range(p):
                    l = arr[i + offset]
                    r = arr[i + offset + p]
                    arr[i + offset] = (l + r) % self.MOD
                    arr[i + offset + p] = (self.MOD + l - r) * inow % self.MOD
                inow *= Convolution.sum_ie[(~s & -~s).bit_length() - 1]
                inow %= self.MOD

    def __call__(self, a, b):
        n = len(a)
        m = len(b)
        if not n or not m: return []
        if min(n, m) <= 50:
            if n < m:
                n, m = m, n
                a, b = b, a
            res = [0] * (n + m - 1)
            for i in range(n):
                for j in range(m):
                    res[i + j] += a[i] * b[j]
                    res[i + j] %= self.MOD
            return res
        z = 1 << (n + m - 2).bit_length()
        a += [0] * (z - n)
        b += [0] * (z - m)
        self.__butterfly(a)
        self.__butterfly(b)
        for i in range(z):
            a[i] *= b[i]
            a[i] %= self.MOD
        self.__butterfly_inv(a)
        a = a[:n + m - 1]
        iz = pow(z, self.MOD - 2, self.MOD)
        for i in range(n + m - 1):
            a[i] *= iz
            a[i] %= self.MOD
        return a




def atcoder_practice2_f():
    import sys
    input = sys.stdin.buffer.readline

    N, M = map(int, input().split())
    A = [int(x) for x in input().split()]
    B = [int(x) for x in input().split()]

    convolution = Convolution(998244353)
    print(*convolution(A, B))


if __name__ == "__main__":
    atcoder_practice2_f()


Measured memory_bytes: 197340
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
const int MAX_NUM = 1000000001;
void solve() {
	int64 N, K; cin >> N >> K;
	vector<int64> h(N);
	for (int64 i = 0; i < N; ++i) {
		cin >> h[i];
	}
	sort(all(h));
	int64 ans = MAX_NUM;
	int64 slide = K - 1;
	for (int64 i = 0; i < N - K + 1; ++i) {
		ans = min(ans, h[i + slide] - h[i]);
	}
	cout << ans << endl;
	return;
}
int main() {
	solve();
	return 0;
}

Measured memory_bytes: 1024
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, BinaryHeap};
#[allow(unused_imports)]
use std::iter::FromIterator;

mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;

    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }

    #[allow(dead_code)]
    pub fn get<T: FromStr>() -> T
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    }

    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }

    #[allow(dead_code)]
    pub fn get2<T: FromStr, U: FromStr>() -> (T, U)
    where
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }

    #[allow(dead_code)]
    pub fn get3<S: FromStr, T: FromStr, U: FromStr>() -> (S, T, U)
    where
        <S as FromStr>::Err: Debug,
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }
}

#[allow(unused_macros)]
macro_rules! debug {
    ($x: expr) => {
        println!("{}: {:?}", stringify!($x), $x)
    }
}

fn main() {
    let r: f64 = util::get();
    let g: f64 = util::get();

    println!("{}", 2.0 * g - r);
}


Measured memory_bytes: 4352
#include"bits/stdc++.h"
using namespace std;
using ll = long long;

int main() {
    ll N, M;
    cin >> N >> M;
    vector<vector<ll>> A(N, vector<ll>(M));
    for (ll i = 0; i < N; i++) {
        for (ll j = 0; j < M; j++) {
            cin >> A[i][j];
            A[i][j]--;
        }
    }

    vector<bool> ok(M, true);
    ll ans = INT_MAX;

    for (ll i = 0; i < M; i++) {
        vector<ll> selected_num(M, 0);
        for (ll j = 0; j < N; j++) {
            for (ll k = 0; k < M; k++) {
                if (ok[A[j][k]]) {
                    selected_num[A[j][k]]++;
                    break;
                }
            }
        }

        ll max_num = 0, max_index = -1;
        for (ll j = 0; j < M; j++) {
            if (selected_num[j] > 0) {
                if (selected_num[j] > max_num) {
                    max_num = selected_num[j];
                    max_index = j;
                }
            }
        }

        ans = min(ans, max_num);

        ok[max_index] = false;
    }

    cout << ans << endl;
}

Measured memory_bytes: 4160
using System;

namespace Atcoder_program_test_Csharp
{
    using System;
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
            int N = int.Parse(str[0]);  //数値で受け取りたい場合は変換する
            int A = int.Parse(str[1]);
            int B = int.Parse(str[2]);
            int A2 = A * N;
            if (B >= A2)
            {
                Console.Write(A2);
            }
            else Console.Write(B);
            Console.ReadKey();
        }
    }
}

Measured memory_bytes: 11220
#include <iostream>
#include <algorithm>

using namespace std;

int N, K;
int A[100010];

int simulate() {
	int ret = 1;
	int i = K;
	while (i < N) {
		i += (K - 1);
		ret++;
	}

	return ret;
}

int main() {
	cin >> N >> K;
	//for (int i = 0; i < N; i++) {
	//	cin >> A[i];
	//}

	cout << simulate() << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

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

Measured memory_bytes: 584
s = [i for i in  list(input())]
x = 0
i = 0
a = []
result = []
while x < len(s)-1:
    while s[x] == s[i]:
        i += 1
        if i > len(s)-1:
            break
    a.append([s[x],int(i-x)])
    x = i
if a[-1][0] != 'L':
    a.append(['L',1])
for p in range(len(a)):
    if a[p][0] == 'R':
        result.extend([0]*(a[p][1]+1))
        result[len(result)-2] += a[p][1]//2+a[p][1]%2
        result[len(result)-1] += a[p][1]//2
    elif a[p][0] == 'L':
        result[len(result)-2] += a[p][1]//2
        result[len(result)-1] += a[p][1]%2+a[p][1]//2
        result.extend([0]*(a[p][1]-1))
print(' '.join(map(str, result)))

Measured memory_bytes: 21312
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int N,K,X,Y;cin >> N >> K >> X >> Y;
  if(N<K)K=N;
  cout << K*X + (N-K)*Y << endl;
  return 0;
}


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

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        string s = sc.Next();
        long[] nums = new long[s.Length + 1];

        for (int i = 0; i < s.Length; i++)
        {
            if (s[i] == '<')
            {
                nums[i + 1] = Math.Max(nums[i + 1], nums[i] + 1);
            }
        }
        for (int i = s.Length - 1; i >= 0; i--)
        {
            if (s[i] == '>')
            {
                nums[i] = Math.Max(nums[i], nums[i + 1] + 1);
            }
        }

        long answer = nums.Sum();

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


Measured memory_bytes: 16864
/*input
RDULULDURURLRDULRLR
*/

#include <bits/stdc++.h>

using namespace std;

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

	string s;
	cin >> s;

	bool flag = true;

	for(int i = 0; i < s.length(); i++) {
		if(i & 1) {
			if(s[i] == 'L' or s[i] == 'U' or s[i] == 'D') {

			}
			else {
				flag = false;
			}
		}
		else {
			if(s[i] == 'R' or s[i] == 'U' or s[i] == 'D') {
				
			}
			else {
				flag = false;
			}
		}
	}

	if(flag) cout << "Yes\n";
	else cout << "No\n";

	return 0;
} 

Measured memory_bytes: 384