akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int mod = 1e9+7;
 
int main()
{
    int n;
    cin >> n;
    vector<int> a(n+10,0);
    for(int i = 1; i <= n; i++) cin >> a[i];

    ll ans1 = 0,ans2 = 0,now = 0;
    for(int i = 1; i <= n; i++){
        if(i%2 == 1 && now+a[i] <= 0) ans1 += abs(now+a[i]) + 1,now = 1;
        else if(i%2 == 0 && now+a[i] >= 0) ans1 += abs(now+a[i]) + 1,now = -1;
        else now += a[i];
    }
    now = 0;
    for(int i = 1; i <= n; i++){
        if(i%2 == 1 && now+a[i] >= 0) ans2 += abs(now+a[i]) + 1,now = -1;
        else if(i%2 == 0 && now+a[i] <= 0) ans2 += abs(now+a[i]) + 1,now = 1;
        else now += a[i];
    }

    cout << min(ans1,ans2) << endl;

    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;


int main(){
    long long a[100];
    long long b;
    cin>>b;
    int counter=0;
    while(b>0){
        a[counter]=b%10;
        b=(b-a[counter])/10;
        counter+=1;
        
    }
    long long ans=1000000;
    long long p=0;
    for(int i=0;i<counter-2;++i){
        p=abs(753-100*a[i+2]-10*a[i+1]-a[i]);
        if(p<ans){
            ans=p;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define debug(x) cerr << #x " = " << (x) << endl;
#define P(x) cerr << #x << endl;    
#define int long long
typedef pair<int, int> pii;
const int mod = 1000000007;


int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed << setprecision(9);
    
    
    int n;
	cin >> n;
	string s;
	cin >> s;
	
	for(int i = 0; i < (int) s.length(); ++ i)
	{
		s[i] = ((s[i] - 'A' + n) % 26) + 'A';
	}
	cout << s << '\n';
    
    return 0;
}






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

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n,A,B,C,D;
	cin>>n>>A>>B>>C>>D;
	for(int i=0;i<=n-1;i++)
		if(1LL*C*(n-1-i)-1LL*D*i<=B-A&&B-A<=1LL*D*(n-1-i)-1LL*C*i){
			cout<<"YES"<<endl;
			return 0;
		}
	cout<<"NO"<<endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		int strN = 2; //文字列を何行受け取るか
		for(int i = 0; i < strN; i++){
			line += br.readLine() + " ";
		}
		String[] param = line.split(" ");
		BiggerInteger(param);
	}

	static void BiggerInteger(String[] param) {
		BigDecimal a = new BigDecimal(param[0]);
		BigDecimal b = new BigDecimal(param[1]);

		if( a.compareTo(b) == 1){
			System.out.println("GREATER");
		} else if (a.compareTo(b) == -1){
			System.out.println("LESS");
		} else {
			System.out.println("EQUAL");
		}
	}

}

Measured memory_bytes: 23508
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const ll INF = LLONG_MAX/3;

/*-----Library-----*/

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

struct UnionFind {
    vector<int> par; // 親ノード
    vector<int> rank; // ランク
    vector<int> sizeuf; //要素数
    UnionFind(int n = 1) {
        init(n);
    }

    void init(int n = 1) {
        par.resize(n); rank.resize(n); sizeuf.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            rank[i] = 0;
            sizeuf[i]=1;
        }
    }

    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        sizeuf[x]+=sizeuf[y];
        return true;
    }

    int size(int x){
        return sizeuf[root(x)];
    }
};

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

long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}
//コンビネーション
/*
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; 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(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 */
/*-----Library-----*/
const int MOD=1234567;
signed main(){
	int n;
	cin>>n;
	int et[110000],ea[110000];
	rep(i,n)cin>>et[i]>>ea[i];
	double p[110000];
	p[0]=1000000000;
	rep(i,1,n+1)p[i]=p[i-1]*(10-ea[i-1])/10;
	int q;
	cin>>q;
	rep(i,q){
		int l,r;
		cin>>l>>r;
		int ll=lower_bound(et,et+n,l)-et-1;
		int rr=lower_bound(et,et+n,r)-et-1;
		ll++;rr++;
		cout<<setprecision(10)<<1000000000*p[rr]/p[ll]<<endl;
	}
}



Measured memory_bytes: 5652
#include<iostream>
using namespace std;
int main()
{
    // string s;
    int N;
    cin >> N;
    // int c = 0;

    if (N >= 1000){
      cout << "ABD"  << endl;
    }else {
      cout << "ABC"  << endl;
    }

    
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<utility>
#define rep(i,a) for( int i = 0; i != (a); ++i )

typedef std::pair<double, int> P;

int n;
double y;
P ans( 0, 0 );

int main()
{
	while( scanf( "%d", &n ), n )
	{
		ans = P( 0, 0 );
		scanf( "%lf", &y );
		
		rep( i, n )
		{
			int b, t;
			double r;
			scanf( "%d%lf%d", &b, &r, &t );
			--t;
			if( t )
				ans = std::max( ans, P( pow( 1.0+r/100.0, y ), b ) );
			else
				ans = std::max( ans, P( 1.0+y/100.0*r, b ) );
		}

		printf( "%d\n", ans.second );
	}

	return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
#define FORV(i, v) for (auto i = v.begin(); i != v.end(); i++)
using namespace std;

using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1001001001;
const long long INFLL = LLONG_MAX / 3;
const double eps = (1e-9);

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

  ll n, a, b, c, d, e;
  cin >> n >> a >> b >> c >> d >> e;

  ll mi = min(a, b); chmin(mi, c); chmin(mi, d); chmin(mi, e);
  ll ans = 4 + (n+mi-1) / mi;

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
    input!(n: usize, m: usize, a: [proconio::marker::Usize1; n]);
    let mut seq = vec![0; m + 2];
    fn add(l: usize, r: usize, x: i64, seq: &mut [i64]) {
        let d = r - l;
        seq[l] += x;
        seq[l + 1] += -x + 1;
        seq[l + d] += -x - d as i64;
        seq[l + d + 1] += x + d as i64 - 1;
    }
    fn collect(seq: &[i64]) -> Vec<i64> {
        let mut seq = seq.to_vec();
        for _ in 0..2 {
            for i in 0..seq.len() - 1 {
                seq[i + 1] += seq[i];
            }
        }
        let m = seq.len() - 2;
        assert_eq!(&[seq[m], seq[m + 1]], &[0, 0]);
        for _ in 0..2 {
            seq.pop();
        }
        seq
    }
    for i in 0..n - 1 {
        let s = a[i];
        let t = a[i + 1];
        if s < t {
            if 1 < t - s {
                add(s + 1, t + 1, 0, seq.as_mut_slice());
            }
        } else {
            if s < m - 1 {
                add(s + 1, m, 0, seq.as_mut_slice());
            }
            add(0, t + 1, (m - 1 - s) as i64, seq.as_mut_slice());
        }
    }

    let mut standard = 0;
    let mut prv = a[0];
    for &x in a.iter().skip(1) {
        standard += if prv < x { x - prv } else { x + m - prv } as i64;
        prv = x;
    }
    println!("{}", standard - collect(&seq).iter().max().unwrap());
}


Measured memory_bytes: 4848
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long, long> > vllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a * b / gcd(a, b);
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  // ll n;
  // cin >> n;
  // ll n, m;
  // cin >> n >> m;
  ll n, c, k, cnt = 0, til = 0;
  cin >> n >> c >> k;
  ll arr[n];
  fi(0, n) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  fi(0, n) {
    if(arr[i] > til || cnt > c) {
      ans++;
      cnt = 1;
      til = arr[i] + k;
    }
    cnt++;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

ll N, Z, W, a[3000];

signed main(){
    cin >> N >> Z >> W;
    REP(i, N) cin >> a[i];
    if(N == 1){
        PRINT(abs(a[0] - W));
        return 0;
    }
    PRINT(max(abs(a[N - 2] - a[N - 1]), abs(W - a[N - 1])));
    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
const int64_t INF=9999999999999999;
int main() {
 int S;
 cin>>S;
 int a=S/100;
 int b=S%100;
 if(a>=1&&a<=12){if(b>=1&&b<=12){cout<<"AMBIGUOUS"<<endl;}
                 else{cout<<"MMYY"<<endl;}}
 else{if(b>=1&&b<=12){cout<<"YYMM"<<endl;}
      else{cout<<"NA"<<endl;}}


 return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int a, b, c; cin >> a >> b >> c;
    int m = max({ a,b,c });
    int ans = 0;
    ans += (m - a) / 2 + (m - b) / 2 + (m - c) / 2;
    a += (m - a) / 2 * 2, b += (m - b) / 2 * 2, c += (m - c) / 2 * 2;
    
    int cnt = (a == m) + (b == m) + (c == m);
    if (cnt == 1)++ans;
    else if (cnt == 2)ans += 2;
    cout << ans << "\n";
}


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

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

    vector<int> a(n);

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


    int ans = INT_MAX;
    for(int p = 1; p <= 100; p++){
        int sum = 0;
        for (int i = 0; i < n; ++i) {
            sum += (p - a[i]) * (p - a[i]);
        }
        ans = min(ans,sum);

    }

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

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

int N,M;
vint bucket[111111];
signed main(){
	cin>>N>>M;
	rep(i,N){
		int a,b;
		cin>>a>>b;
		if(a>M)continue;
		bucket[M-a].pb(b);
	}

	priority_queue<int>que;
	int ans=0;
	for(int i=M-1;i>=0;i--){
		for(auto x:bucket[i])que.push(x);
		if(que.size()==0)continue;
		ans+=que.top();
		que.pop();
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 5888
#include <iostream> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include<math.h>
//#define int long long
#define m_p make_pair
#define mod 1000000007
#define rep(i,n)  for(int i=0; i<(int)(n); i++)
#define all(v)  v.begin(),v.end()
using namespace std;

int jousu(int, int);
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int kurai(int x00, int y00) {
	int z00 = (x00 % jousu(10, y00)) / jousu(10, y00 - 1);
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}



int main() {
	int a, b,ans;
	cin >> a >> b;
	if ((b - 1) % (a - 1) != 0)ans = (b - 1) / (a - 1) + 1;
	else ans = (b - 1) / (a - 1);
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using ll = long long;
const ll INF = 1000000000000;

int main()
{
    int n,m,x;
    std::cin >> n >> m >> x;
    std::vector<ll> a(n), b(m), q(x);
    for(auto &i : a)std::cin >> i;
    for(auto &i : b)std::cin >> i;
    for(auto &i : q)std::cin >> i;

    std::vector<std::pair<ll,ll>> dist_right(x);
    std::vector<std::pair<ll,ll>> dist_left(x);
    for(int i = 0; i < x; i++){
        auto itr_s = std::lower_bound(a.begin(),a.end(),q[i]);
        auto itr_t = std::lower_bound(b.begin(),b.end(),q[i]);
        dist_right[i].first = *itr_s - q[i];
        dist_right[i].second = *itr_t - q[i];
        if(itr_s == a.end())dist_right[i].first = INF;
        if(itr_t == b.end())dist_right[i].second = INF;
    }
    //leftの準備(逆順ソート)
    for(auto &i : a)i *= -1;
    for(auto &i : b)i *= -1;
    for(auto &i : q)i *= -1;
    std::sort(a.begin(),a.end());
    std::sort(b.begin(),b.end());
    for(int i = 0; i < x; i++){
        auto itr_s = std::lower_bound(a.begin(),a.end(),q[i]);
        auto itr_t = std::lower_bound(b.begin(),b.end(),q[i]);
        dist_left[i].first = *itr_s - q[i];
        dist_left[i].second = *itr_t - q[i];
        if(itr_s == a.end())dist_left[i].first = INF;
        if(itr_t == b.end())dist_left[i].second = INF;
    }
    //for(int i = 0; i < x; i++)std::cout << dist_left[i].first << " : " << dist_left[i].second << " :: " << dist_right[i].first << " " << dist_right[i].second << std::endl;

    //全組み合わせ探索
    for(int i = 0; i < x; i++){
        ll min = INF;
        min = std::min(min,std::max(dist_right[i].first,dist_right[i].second));
        min = std::min(min,std::max(dist_left[i].first, dist_left[i].second));
        min = std::min(min,dist_left[i].first*2 + dist_right[i].second);
        min = std::min(min,dist_left[i].second*2 + dist_right[i].first);
        min = std::min(min,dist_left[i].first + dist_right[i].second*2);
        min = std::min(min,dist_left[i].second + dist_right[i].first*2);
        std::cout << min << std::endl;

    }

}

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

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX

const double EPS = 1e-14;
const double PI  = acos(-1.0);


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

  bool suki[m];
  REP (i, m) suki[i] = true;

  int a;
  REP (i, n) {
    int k;
    cin >> k;
    bool ks[m] = {false};
    REP (j, k) {
      cin >> a;
      ks[a - 1] = true;
    }
    REP (j, m) if (!ks[j]) suki[j] = false;
  }

  int ans = 0;
  REP (i, m) if (suki[i]) ans++;

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo N
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000005



int main(){
	
	string S;
	cin>>S;
	
	if(S=="ABC")cout<<"ARC"<<endl;
	else cout<<"ABC"<<endl;
	
	return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
// typedef __int128_t Int;
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  int n, m, d;
  cin >> n >> m >> d;
  double ans = 0;
  if (d == 0) {
    ans = 1.0 / n * (m - 1);
  } else {
    ans = (n - d) * 2.0 / n / n * (m - 1);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

class Main{


	static	int[][] map;
	static int[] a;
	static int[] b;
	static	int H ;
	static	int W ;


	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);			//文字の入力
		H = sc.nextInt();
		W = sc.nextInt();
		int N = sc.nextInt();
		a = new int[N];
		map = new int[H][W];

		b = new int[N];
		int[][] test = new int[H][W];


		for(int i = 0;i < N;i++){
			a[i] = sc.nextInt();
		}
		//Arrays.sort(a);

		for(int i = 0;i < N;i++){
			test[0][0] = i+1;
			b[i]++;
			dfs(i,test,0,0,1);
			test[0][0] = 0;
			b[i]--;


		}





	}

	static void dfs(int nowcolor,int[][] test,int y,int x,int count){

//		System.out.println("y " + y+" x "+x + " color "+nowcolor + " count "+count);
//		for(int i = 0;i < H;i++){
//			for(int j = 0;j < W;j++){
//				System.out.print(test[i][j]);
//			}
//			System.out.println();
//
//		}

		if(count == H*W){			//全部塗り終わったら終了
			for(int i = 0;i < H;i++){
				for(int j = 0;j < W;j++){
					System.out.print(test[i][j]);
					System.out.print(" ");

				}
				System.out.println();
			}
			System.exit(0);					//終了	
		}

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

		for(int i = 0;i < 4;i++){
			int nx = x + dx[i];
			int ny = y + dy[i];

			if(b[nowcolor] >= a[nowcolor]){				//現在の色が条件数濡れていたら次の色に行く.
				nowcolor++;
			}

			if(nx >= 0 && nx <= W-1 && ny >= 0 && ny <= H-1 &&  test[ny][nx] == 0){						//まだ塗ってなかったら、塗る
				b[nowcolor]++;
				test[ny][nx] = nowcolor+1;
				count++;
				dfs(nowcolor, test, ny, nx, count);
				count--;
				b[nowcolor]--;
			}
		}

		return;




	}

}




Measured memory_bytes: 35796
/**
 * @brief AtCoder Beginner Contest 054<br>
 * C - One-stroke Path
 *
 * dfsパターン
 * @see https://atcoder.jp/contests/abc054/tasks/abc054_c
 */
#include <iostream>
using namespace std;

constexpr int MAX_N = 8;
int N, M;
bool graph[MAX_N + 1][MAX_N + 1];
bool visited[MAX_N + 1];

int dfs(int v) {
  for (int i{1}; i <= N; ++i) {
    if (!visited[i])
      goto CONTINUED;
  }
  return 1;
  CONTINUED:
  int count{};
  for (int i{1}; i <= N; ++i) {
    if (!graph[v][i] || visited[i]) continue;
    visited[i] = true;
    count += dfs(i);
    visited[i] = false;
  }
  return count;
}

int main() {
  cin >> N >> M;
  int a, b;
  for (int i{}; i < M; ++i) {
    cin >> a >> b;
    graph[a][b] = true;
    graph[b][a] = true;
  }

  visited[1] = true;
  cout << dfs(1);
  return 0;
}


Measured memory_bytes: 632
class UnionFind():
    def __init__(self,n):
        self.parent = [-1 for _ in range(n)]

    def size(self,x):
        return -self.parent[self.find(x)]

    def find(self,x):
        if(self.parent[x]<0):
            return x
        else:
            self.parent[x]=self.find(self.parent[x])
            return self.parent[x]

    def unite(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if(x == y):
            return False
        if(self.size(x)<self.size(y)):
            self.parent[y]+=self.parent[x]
            self.parent[x]=y
        else:
            self.parent[x]+=self.parent[y]
            self.parent[y]=x
        return True

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

#%%
N,M = [int(x) for x in input().split()]
people = [[i+M+1]+[int(x) for x in input().split()]for i in range(N)]
#%%
un = UnionFind(N+M+1)
for p in people:
    num=p[0]
    L=p[2:]
    for l in L:
        un.unite(num,l)
for i in range(M+2,M+N+1):
    if(not un.same(M+1,i)):
        print('NO')
        break
else:
    print('YES')


Measured memory_bytes: 21324
#include <algorithm>
#include <cctype>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std::priority_queue;

using std::min;
using std::max;
using std::sort;
using std::abs;

int main(void) {
    string s, t;
    cin >> s >> t;

    sort(s.begin(), s.end(), std::less<char>());
    sort(t.begin(), t.end(), std::greater<char>());

    bool ans = s < t;

    cout << (ans ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("tune=native")
using namespace std;
typedef long long ll;
typedef long double ld;

const int MAX_N = 105;

int n;
ll l[MAX_N];

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

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

	int result = 0;
	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
			if (l[i] != l[j])
				for (int k = j + 1; k < n; k++)
					if (l[i] != l[k] && l[j] != l[k] && l[i] + l[j] > l[k] && l[i] + l[k] > l[j] && l[j] + l[k] > l[i])
						result++;
	cout << result << '\n';

	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
 
const int MX = 100005;
 
int main(){
  int x;
  cin >> x;
  if(x > 29){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

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

using namespace std;


long long f(long long A, long long B, long long C) {
    return A * B * (C % 2);
}

int main() {
    long long A, B, C;
    cin >> A >> B >> C;

    long long x = f(A, B, C);
    long long y = f(A, C, B);
    long long z = f(B, C, A);
    cout << min({x, y, z}) << endl;

}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long
#define MAX 10000000
#define SENTINEL 2e10


int main(){
    string s; cin >> s;
	char c1, c2;
	rep(i, 3){
		if(s[i] == s[i+1]){
			cout << "Bad" << endl;
			return 0;
		}
	}
	cout << "Good" << endl;
}

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

#define F first
#define S second
#define llong long long
#define ullong unsigned long long
#define mp make_pair
#define pb push_back
#define sz(v) (int)v.size()

using namespace std;

const int MXN = (int)1e6 + 10;
const int INF = (int)1e9 + 7;
const llong LINF = (llong)1e18 + 10;
const double EPS = (double)1e-9;
const double PI = (double)acos(-1.0);

int n;
int dep[MXN];
vector <int> g[MXN];
vector <int> b[MXN];

void dfs(int v){
  dep[v] = 0;
  for(auto to : g[v]){
    dfs(to);
    b[v].pb(dep[to]);
  }
  sort(b[v].begin(), b[v].end(), greater <int>());
  for(int i = 0; i < sz(b[v]); ++i){
    dep[v] = max(dep[v], b[v][i] + i + 1);
  }
}

int main(){
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
  scanf("%d", &n);
  for(int i = 2; i <= n; ++i){
    int x;
    scanf("%d", &x);
    g[x].pb(i);
  }
  dfs(1);
  printf("%d\n", dep[1]);
  return 0;
}


Measured memory_bytes: 60032
S=str(input())

L=int(S[0:2])
R=int(S[2:4])

if 1<=L<=12 and 1<=R<=12:
    print("AMBIGUOUS")
elif 1<=L<=12:
    print("MMYY")
elif 1<=R<=12:
    print("YYMM")
else:print("NA")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;

typedef long long       ll;
typedef long double     ld;

typedef vector<int>     vi;
typedef vector<bool>    vb;
typedef vector<ll>      vll;
typedef vector<vi>      vvi;
typedef vector<vll>     vvll;
typedef vector<string>  vs;

typedef pair<int, int>  pii;
typedef pair<ll, int>   pli;
typedef pair<ll, ll>    pll;
typedef vector< pii >   vpi;
typedef vector< pll >   vpll;

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;

#define pb           push_back
#define mod          1000000007
#define INF          1e17
#define mini         INT_MIN
#define maxo         INT_MAX
#define eb           emplace_back
#define ff           first
#define ss           second
#define re           return 
#define endl         "\n" 

#define all(c)       c.begin(),c.end()
#define be           begin()
#define en           end()
#define sz(x)        (ll)x.size()
#define mem(a,val)   memset(a,val,sizeof(a))
#define mk(x,y)      make_pair(x,y)
#define mid(s,e)     ((s)+((e)-(s))/2) 

#define fo(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 read(a,n)    for(int i=0;i<n;i++)cin>>a[i];
#define show(a,n)    for(int i=0;i<n;i++)cout<<a[i]<<' ';cout<<endl;
#define p2(n)        (1LL << (n))
#define deb(x) cout <<#x << " = " << x << " | " << "LINE: "<<__LINE__<< endl;
template<typename... T> void rd(T&... args) { ((cin >> args), ...); }
template<typename... T> void pp(T... args) { ((cout << args << " "), ...); cout<<"\n"; }

void add(ll &x, ll y){ x += y; if(x>=mod) x %= mod; if(x<0) x = x%mod + mod; }

//============== *** START OF CODE ***

ll h,n;
ll a[1003];
ll b[1003];

ll dp[10003][1003];
ll go(ll h, ll i){
    if(h<0)re 0;
    if(i==-1){
        if(h==0)re 0;
        else re INT_MAX;
    }
    ll &ans = dp[h][i]; 
    if(ans!=-1)re ans;
    ll cst1 = INT_MAX;
    cst1 = b[i];
    ll del1 = go(h-a[i],i);
    ll cst2 = go(h,i-1);
    ans = cst1 + del1;
    if(cst2!=INT_MAX)ans = min(ans,cst2);
    re ans;
}

void solve()
{
    rd(h,n);
    mem(dp,-1);
    fo(i,0,n-1){
        rd(a[i],b[i]);
    } 
    pp(go(h,n-1));      
}


void prep(){}

//=============== *** END OF CODE ***

int main(){
    speedio; cout<<fixed<<setprecision(12);

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

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

    cout<<"\n";
    return 0;
}

Measured memory_bytes: 82636
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using namespace std;

int main()
{
    ll n,a,b;
    cin >> n >> a >> b;
    if(n == 1){
        if(a==b){
            cout << 1 << endl;
            return 0;
        }else{
            cout << 0 << endl;
            return 0;
        }
    }else if(a>b){
        cout << 0 <<endl;
        return 0;
    }else{
        cout << (n-2) * (b-a) + 1 << endl;
        return 0;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll INF = 1000000000000000;
ll n, dat[400010],  m;
vector<P> vec[200010];


ll pow(ll x, ll y)
{
	if (y == 0) return 1;
	if (y % 2)
	{
		return pow(x, y - 1) * x % mod;
	}
	else
	{
		ll yyy = pow(x, y / 2);
		return yyy * yyy % mod;
	}
}

ll div(ll x)
{
	return pow(x, mod - 2);
}

void init(ll n_)
{
	n = 1;
	while (n < n_)
	{
		n *= 2;
	}

	for (int i = 0; i < 2 * n - 1; i++)
	{
		dat[i] = INF;
	}
}

void update(ll k, ll a)
{
	k += n - 1;
	dat[k] = a;
	while (k > 0)
	{
		k = (k - 1) / 2;
		dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
	}
}

ll query(ll a, ll b, ll k, ll l, ll r)
{
	if (r <= a || b <= l)
	{
		return INF;
	}

	if (a <= l && r <= b)
	{
		return dat[k];
	}
	else
	{
		ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
		ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return min(vl, vr);
	}
}

int main(void)
{
	
	cin >> n >> m;
	ll N = n;
	for (int i = 0; i < m; i++)
	{
		int l, r, c;
		cin >> l >> r >> c;
		vec[l - 1].push_back(P(r - 1, c));
	}
	init(n);
	update(0, 0);
	
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < vec[i].size(); j++)
		{
			update(vec[i][j].first, min(query(vec[i][j].first, vec[i][j].first + 1, 0, 0, n), vec[i][j].second + query(i, n, 0, 0, n)));
		}
	}

	if (query(N - 1, n, 0, 0, n) == INF)
	{
		cout << -1 << endl;
	}
	else
	{
		cout << query(N - 1, n, 0, 0, n) << endl;
	}

	int xxx;
	cin >> xxx;
}


Measured memory_bytes: 10112
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
using ll = long long;
const int INF = 2147483647;

int main(){
	ll n,m;
	cin >> n >> m;
	ll num1 = min(n,m/2);
	n-=num1;
	m-=num1*2;
	num1+=m/4;
	cout << num1 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;

int main(int argc, char const* argv[])
{
  int n;
  ll k;
  cin >> n >> k;
  vector<P> vec;
  for(int i = 0; i < n; i++){
    int a, b;
    cin >> a >> b;
    vec.pb(mk(a, b));
  }
  sort(vec.begin(), vec.end());
  ll sum = 0;
  int i = 0;
  while(sum < k){
    sum += vec[i].second;
    i++;
  }
  cout << vec[i-1].first << endl;
	return 0;
}


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

int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> dp(n + 1);
  rep(i, m) {
    int j;
    cin >> j;
    dp[j] = -1;
  }
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (dp[i] < 0) continue;
    if (dp[i - 1] > 0) dp[i] = dp[i - 1];
    if (i >= 2 && dp[i - 2] > 0) (dp[i] += dp[i - 2]) %= 1000000007;
  }
  cout << dp[n] << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
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;
}

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define F first
#define S second

typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1000000;
const int minf = -1000000;
const ll lnf = 1e12;
const ll mlnf = -1e12;

int N, Q;
using Graph = vector<vector<int>>;
vector<int> counter;
void dfs(Graph& G, int pv, int v, int x);

int main()
{
    cin >> N >> Q;
    Graph G(N);
    rep(i, N - 1)
    {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    counter.assign(N, 0);
    rep(i, Q)
    {
        int a, b;
        cin >> a >> b;
        a--;
        counter[a] += b;
    }
    dfs(G, -1, 0, counter[0]);

    rep(i, N) cout << counter[i] << " ";
    cout << endl;
}

void dfs(Graph& G, int pv, int v, int x)
{
    for (auto nv : G[v]) {
        if (nv == pv)
            continue;
        counter[nv] += counter[v];
        dfs(G, v, nv, counter[nv]);
    }
}


Measured memory_bytes: 26624
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define ll long long
#define eps 1e-7
#define all(x) ((x).begin()),((x).end())
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
ll mod = 1000000007;
ll n, k;
vector <ll> v;
ll dp[120][65000];
ll ndiv;

int main()
{
	cin >> n >> k;
	for (int i = 1; i*i<=n; i++)
	{
		v.push_back(i);
		v.push_back(n/i);
	}
	v.push_back(0);
	sort(all(v));
	ndiv = v.size();
	for (int i = 1; i<ndiv; i++)
		dp[1][i] = v[i]%mod;
	for (int l = 2; l<=k; l++)
	{
		for (int i = 1; i<ndiv; i++)
		{
			dp[l][i] = dp[l][i-1]+(dp[l-1][ndiv-i])*(v[i]-v[i-1]);
			dp[l][i] %= mod;
		}
	}
	cout << dp[k][ndiv-1];
}

Measured memory_bytes: 53624
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll k; cin>>k;
    if(k%2==0||k%5==0)cout<<-1<<endl;
    else{
        int x = 0;
        int ans = 0;
        do{
            x = 10*x+7;
            x %= k;
            ans++;
        }while(x!=0);
        
        cout<<ans<<endl;
    }
    return 0;
}

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

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	char ch[1];
	cin >> ch[0];
	int i = ch[0] + 1;
	cout << (char) i << endl;
	return 0;
}

Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int N;
vector<pair<int, int>> points;

int factorial(int n) {
  if (n == 1) return 1;
  else return n * factorial(n - 1);
}

double get_distance(int i, int j) {
  return sqrt(pow(points[i].first - points[j].first, 2) + pow(points[i].second - points[j].second, 2));
}

double solve() {
  int f = factorial(N - 1);

  double result = 0.0;

  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      result += get_distance(i, j) * f;
    }
  }

  return result * 2 / (f * N);
}

int main() {
  cin >> N;

  points = vector<pair<int, int>>(N);

  for (int i = 0; i < N; ++i) {
    cin >> points[i].first >> points[i].second;
  }

  printf("%.10f\n", solve());

  return 0;
}

Measured memory_bytes: 256
s = input()
t = input()

def func(a,b):
    cnt = 0
    for c1,c2 in zip(a, b):
        if c1 != c2:
            cnt += 1
    return cnt

t_max = 10000
for i in range(len(s) - len(t) + 1):
    tmp = func(s[i:i+len(t)], t)
    if tmp < t_max:
        t_max = tmp
print(t_max)


Measured memory_bytes: 9048
sx,sy,tx,ty = map(int,input().split())
R=[]

R+=["R"]*(tx-sx)
R+=["U"]*(ty-sy)
R+=["L"]*(tx-sx)
R+=["D"]*(ty-sy+1)
R+=["R"]*(tx-sx+1)
R+=["U"]*(ty-sy+1)
R+=["L"]
R+=["U"]
R+=["L"]*(tx-sx+1)
R+=["D"]*(ty-sy+1)
R+=["R"]


print("".join(R))





Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define print(A,x,n) rep(I,0,n){cout<<(I ? " ":"")<<A[I]x;}cout<<endl;
#define pprint(A,y,m,n) rep(J,0,m){print(A[J],y,n);}
const long mod=1e9+7;
const int size=1e5+1;
const int inf=1e9;
int main(){
	int K,A,B;cin>>K>>A>>B;
	rep(i,A,B+1)if(i % K == 0){ cout<<"OK"<<endl; return 0; }
	cout<<"NG"<<endl;
}

Measured memory_bytes: 3636
// vvvvvvvvvvvv TEMPLATE vvvvvvvvvvvv
#include <bits/stdc++.h>
using namespace std; using ll = long long; using P = pair<ll, ll>;
const ll linf = 1e18; const double eps = 1e-12, pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define each(i,a) for (auto&& i : a)
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define eb emplace_back
#define all(a) begin(a),end(a)
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
#define min(x,y) (x < y ? x : y)
#define max(x,y) (x < y ? y : x)
template<typename Head> void out(Head h) { cout << h << endl; } template<typename Head, typename... Tail>void out(Head h, Tail... t) { cout << h << " "; out(t...); }
template<typename T> istream& operator>>(istream& is, vector<T>& v) { each(x,v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) { rep(i,v.size()) { if (i) os << " "; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<string>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
struct yes_no : std::numpunct<char> { string_type do_truename() const { return "Yes"; } string_type do_falsename() const { return "No"; } };
void solve(); int main() {
  ios::sync_with_stdio(false); cin.tie(0); locale loc(locale(), new yes_no); cout.imbue(loc); cout << fixed << setprecision(10) << boolalpha;
  solve();
}
// ^^^^^^^^^^^^ TEMPLATE ^^^^^^^^^^^^

void solve() {
  ll n; cin >> n;
  string s; cin >> s;
  vector<ll> Sd(n+1, 0), Sc(n+1, 0);
  rep(i, n) Sd[i+1] = Sd[i] + (s[i] == 'D');
  rep(i, n) Sc[i+1] = Sc[i] + (s[i] == 'C');
  auto Sum = [&](const vector<ll>& S, ll l, ll r) {
    chmax(l, 0);
    chmin(r, S.size()-1);
    // cout << r << " " << l << endl;
    return S[r] - S[l];
  };
  ll Q; cin >> Q;
  rep(q, Q) {
    ll K; cin >> K;
    ll ans = 0;
    ll sum = 0, sumD = 0, sumC = 0;
    rep(i, 1, n) {
      // Mを移動する
      if (s[i-1] == 'D') { // 左のDが増える
        sum += Sum(Sc, i+1, i-1+K);
      }
      if (s[i] == 'C') { // 右のCが減る
        sum -= Sum(Sd, i+1-K, i-1);
      }
      // 左端を縮める
      // if (i-K >= 0 && s[i-K] == 'D') {
      //   sum -= Sum(Sc, );
      // }
      // // 右端を伸ばす
      // if (i+K-1 < n && s[i+K-1] == 'C') {
      //   sum += Sum(Sd);
      // }
      if (s[i] == 'M') {
        ans += sum;
      }
      // cout << i << " " << sum << endl;
    }
    cout << ans << endl;
  }
}


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

int main(){
    int a,b;
    char op;
    
    while (op != 1){
            cin >> a >> op >> b;
            if (op == '?') break;
            if (op == '+'){
                cout << a+b << '\n';
            } else if (op == '-'){
                cout << a-b << '\n';
            } else if (op == '*'){
                cout << a*b << '\n';
            } else if (op == '/'){
                cout << (int)a/(int)b << '\n';
            }

    }
    
    return 0;
}


Measured memory_bytes: 3116
/*

                                  In the name of Allah, Most Gracious, Most Merciful


*/
#include<bits/stdc++.h>
#include<numeric>
using namespace std;

//*** constant value ***
const long double PI = 3.141592653589793238;
const double EPS = 1e-6 ;
//*** constant value ***

//****** define ********
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define dd double
#define vll vector<ll>
#define vs vector<string>
#define fn(i,n) for(ll i = 0; i<n; i++)
#define f(i,a,b) for(i=a;i<b;i++)
#define f1(i,a,b) for(i=b-1;i>=a;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pls pair<ll,string>
#define vpl vector<pll>
#define pb push_back
#define mk make_pair
#define x first
#define y second
#define tt cout<<"Came here"<<endl;
//****** define ********


void solve()
{
    ll x[5];
    ll ans;
   fn(i,5)
   {
       cin>>x[i];
       if(x[i]==0)
         ans = i + 1;
   }

   cout<<ans<<endl;

}

int main()
{
    IOS;
    ll tc = 1;
    while(tc--)
    {
        solve();
    }


return 0;
}



Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define pb push_back
#define xx first
#define yy second
#define FOR(i,a,b) for (ll i=(a); i<(b); i++)
#define FORD(i,a,b) for (ll i=ll(b)-1; i>=(a); i--)

int main() {
	ios::sync_with_stdio(false);

	string s,t;
	cin >> s >> t;

//	string doppel = s + s;
//	vvl lol(sz(s), vl(sz(s),oo));

	map<char,set<ll>> ss;
	FOR(i,0,sz(s)) {
		ss[s[i]].insert(i);
	}

	ll pos = -1;
	ll spos = -1;
	FOR(tpos,0,sz(t)) {
		char gesucht = t[tpos];
		const set<ll>& possible = ss[gesucht];
		if (sz(possible) < 1) {
			cout << -1 << endl;
			return 0;
		}
		auto blob = possible.upper_bound(spos);
		if(blob == possible.end()) {
			pos = pos + (*(possible.begin()) + sz(s) - spos);
		} else {
			pos = pos + (*blob - spos);
		}
		spos = pos % sz(s);
	}

	cout << pos + 1 << endl;
}


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

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=1;i<=(n);++i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define DUMP(x) cout<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;

class BTournament {
public:
    int N;
    vector<vector<int>> G;

    void input(std::istream& in){
        ios_base::sync_with_stdio(false);
        in>>N;
        G = vector<vector<int>>(N, vector<int>());
        RREP(i, N-1){
            int a;
            in>>a;
            a--;
            G[i].pb(a), G[a].pb(i);
        }
    }

    int dfs(int s, int p){
        vector<int> vec;
        for(auto u : G[s]){
            if(u==p) continue;
            vec.pb(dfs(u, s));
        }
        sort(RALL(vec));
        int res = 0, mx = 0;
        RREP(i, vec.size()){
            if(i+vec[i-1]>mx){
                res += i + vec[i-1] - mx;
                mx = i + vec[i-1];
            }
        }
        return res;
    }

	void solve(std::istream& in, std::ostream& out) {
        input(in);
        out<<dfs(0, -1)<<'\n';
	}
};


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


Measured memory_bytes: 13056
#include "bits/stdc++.h"
#define PRECISION(x) cout << fixed << setprecision(x)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define ALLR(X) (X).rbegin(), (X).rend()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second

using namespace std;
 
template<class T> void max_self(T & a, const T & b) { if(a < b) a = b; }
template<class T> void min_self(T & a, const T & b) { if(a > b) a = b; }
typedef long long LL;
const int INF = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = (1e-9);

int N, k;



int main(){
  FAST_IO
  
  cin >> N >> k;
  for(int rep = 1, in; rep <= N; ++rep){
    cin >> in;
  }

  cout << (N + k - 3) / (k - 1) << '\n';
  
  return 0;
}


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


int main()
{
    map<int,int> m;

    int N;
    cin>>N;
    vector<int> v(N);
    for(int c=0;c<N;c++) {
        cin>>v[c];
    }
    sort(v.begin(),v.end());

    for(int c=0;c<N;c++) {
        if(c==0 || v[c-1]!=v[c]) {
            for(int c2=v[c];c2<=v.back();c2+=v[c]) {
                m[c2]++;
            }
        } else {
            m[v[c]]++;
        }
    }
    int res = N;
    for(int c=0;c<N;c++) {
        if(m[v[c]] > 1) {
            res--;
        }
    }
    cout<<res;
}


Measured memory_bytes: 50680