akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
import java.util.Arrays;

class Main{
    public static void main(String[] a){
        Scanner s = new Scanner(System.in);
        int[] inputs = new int[10];

        for(int i = 0; i < 10; i++){
            inputs[i] = s.nextInt();
        }

        Arrays.sort(inputs);

        System.out.println(inputs[9]);
        System.out.println(inputs[8]);
        System.out.println(inputs[7]);
    }
}

Measured memory_bytes: 17168
s = input()

s = [int(i) for i in s]
ue2 = s[0] * 10 + s[1]
sita2 = s[2] * 10 + s[3]

yymm = False
mmyy = False
amb = False

#ooMM
if  1 <= sita2 <= 12:
    yymm = True
    #MMMM
    if 1 <= ue2 <= 12:
        amb = True
        yymm = False
#ooYY
else:
    if 1<= ue2 <= 12:
        #MMYY
        mmyy = True
if yymm:
    print("YYMM")
elif mmyy:
    print("MMYY")
elif amb:
    print("AMBIGUOUS")
else:
    print("NA")

Measured memory_bytes: 3064
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

int main(){
	int n,t,e,x[1001],k;
	
	cin >> n >> t >> e ;
	for(int i=1;i<=n;i++){
		cin >> x[i];
	}
	for(int i=1;i<=n;i++){
		k=x[i];
		while(1){
			if(t-e>k){
				k+=x[i];
			}
			else if(t+e<k){
				break;
			}
			else{
				cout << i <<"\n";
				return 0;
			}
		}
	}
	cout << "-1\n";
return 0;
}

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

using namespace std;

// 0〜mの数字のLSBからマスクがiの1の数が奇数かどうか
bool bits(int64_t m, int64_t i) {
  if (i == 1) {
    switch (m % 4) {
      case 0:
      case 3:
        return false;
      case 1:
      case 2:
        return true;
    }
  }
  int64_t const mod = m % (i << 1);
  if (mod < i) {
    return false;
  }
  return m % 2 == 0;
}

int64_t solve(int64_t a, int64_t b) {
  int64_t ret = 0;
  for (int64_t i = 1; i <= b; i <<= 1) {
    ret += (bits(b, i) ? i : 0) ^ (bits(a - 1, i) ? i : 0);
  }
  return ret;
}

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int64_t a, b;
  std::cin >> a >> b;
  std::cout << solve(a, b) << std::endl;
  return 0;
}

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

int main()
{   int h,w;
    scanf("%d%d",&h,&w);
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            char s[6];
            scanf("%s",s);
            if(strcmp(s,"snuke")==0){
                printf("%c%d",'A'+j,i+1);
                return 0;
            }
        }
    }
    printf("Hello World");

    return 0;
}


Measured memory_bytes: 128
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

s=list(ss())
lens=len(s)
flag=True

s.reverse()

word = ("maerd","remaerd","esare","resare")

cnt=0

while cnt <lens:
    cnt_chk=cnt
    if "".join(s[cnt:cnt+5])==word[0]:
        cnt_chk+=5
    elif "".join(s[cnt:cnt+7])==word[1]:
        cnt_chk+=7
    elif "".join(s[cnt:cnt+5])==word[2]:
        cnt_chk+=5
    elif "".join(s[cnt:cnt+6])==word[3]:
        cnt_chk+=6
    if cnt==cnt_chk:
        print("NO")
        exit()
    else:
        cnt=cnt_chk
print("YES")

Measured memory_bytes: 74732
N=int(input())
*A,=map(int,input().split())

A=sorted(A,reverse=True)
def mul(A):
    if 0 in A:
      return 0
    m=1
    for na in A:
        m*=na
        if m>10**18:
          return -1
    return m
    
print(mul(A))

Measured memory_bytes: 21784
use proconio::input;

use rand::Rng;

struct State {
    c: Vec<i32>,
    s: Vec<Vec<i32>>,
    cur_seq: Vec<usize>,
    sat: i32,
}

impl State {
    fn init(&mut self) {
        let mut last = vec![0; 26];
        self.sat = 0;

        for i in 0..self.cur_seq.len() {
            self.sat += self.s[i][self.cur_seq[i]];
            last[self.cur_seq[i]] = (i + 1) as i32;

            for j in 0..26 {
                self.sat -= self.c[j] * ((i + 1 - last[j] as usize) as i32);
            }
        }
    }

    fn heur(&mut self) {
        let mut last = vec![0; 26];
        self.sat = 0;

        for i in 0..self.cur_seq.len() {
            let mut sdiff = 0;
            let mut nchoice: i32 = -1;

            for j in 0..26 {
                self.cur_seq[i] = j;
                let mut last = last.to_owned();
                last[j] = i + 1;
                let mut diff = self.s[i][j];
                for k in 0..26 {
                    diff -= self.c[k] * ((i + 1 - last[k] as usize) as i32);
                }
                if nchoice == -1 || sdiff < diff {
                    sdiff = diff;
                    nchoice = j as i32;
                }
            }

            self.cur_seq[i] = nchoice as usize;
            self.sat += sdiff;
            last[self.cur_seq[i]] = (i + 1) as usize;
        }
    }

    fn change(&mut self, d: usize, q: usize) {
        self.sat -= self.s[d][self.cur_seq[d]];
        self.sat += self.s[d][q];

        let mut last = vec![0; 26];
        for i in 0..self.cur_seq.len() {
            last[self.cur_seq[i]] = (i + 1) as i32;
            let j = self.cur_seq[d];
            self.sat += self.c[j] * ((i + 1 - last[j] as usize) as i32);
            self.sat += self.c[q] * ((i + 1 - last[q] as usize) as i32);
        }

        last = vec![0; 26];
        let p = self.cur_seq[d];
        self.cur_seq[d] = q;
        for i in 0..self.cur_seq.len() {
            last[self.cur_seq[i]] = (i + 1) as i32;

            self.sat -= self.c[p] * ((i + 1 - last[p] as usize) as i32);
            self.sat -= self.c[q] * ((i + 1 - last[q] as usize) as i32);
        }
    }
}

fn main() {
    input! {
        d: usize,
        c: [i32;26],
        s: [[i32;26]; d],
    }

    let mut state = State {
        c: c.to_owned(),
        s,
        cur_seq: vec![0; d],
        sat: 0,
    };

    let mut sorted_c: Vec<(usize, &i32)> = c.iter().enumerate().collect();
    sorted_c.sort_by_key(|k| -k.1);

    let mut rng = rand::thread_rng();
    let mut cur_sat = state.sat;

    state.heur();

    // for _ in 0..500000 {
    //     let d = rng.gen_range(0, d);
    //     let q = rng.gen_range(0, 26);
    //     if state.cur_seq[d] == q {
    //         continue;
    //     }
    //     state.change(d, q);
    //     if state.sat > cur_sat {
    //         dbg!(state.sat, cur_sat);
    //         cur_sat = state.sat;
    //     }
    // }

    dbg!(cur_sat, state.sat);

    for i in state.cur_seq {
        println!("{}", i + 1);
    }
}


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

int main()
{
    int x,y,a,b,c;
    cin>>x>>y>>a>>b>>c;
    
    int p[a],q[b],r[c];
    
    long long int ans=0;
    
    for(int i=0;i<a;i++)
    {
        cin>>p[i];
    }
    
    for(int i=0;i<b;i++)
    {
        cin>>q[i];
    }
    
    for(int i=0;i<c;i++)
    {
        cin>>r[i];
    }
    
    sort(p,p+a);
    reverse(p,p+a);
    
    sort(q,q+b);
    reverse(q,q+b);
    
    sort(r,r+c);
    reverse(r,r+c);
    
    int kp=x-1,kq=y-1,kr=0;
    
    for(int i=0;i<c;i++)
    {
        int t1=r[i]-p[kp],t2=r[i]-q[kq],flag=0;
        if(t1>=t2)
        {
            if(t1>0 && kp>=0)
            {
                p[kp]=r[i];
                kp--;
                flag=1;
            }
            else if(t2>0 && kq>=0)
            {
                q[kq]=r[i];
                kq--;
                flag=1;
            }
        }
        else if(t2>t1)
        {
            if(t2>0 && kq>=0)
            {
                q[kq]=r[i];
                kq--;
                flag=1;
            }
            else if(t1>0 && kp>=0)
            {
                p[kp]=r[i];
                kp--;
                flag=1;
            }
        }
        
        if(flag==0)
        {
            break;
        }
    }
    
    for(int i=0;i<x;i++)
    {
        ans=ans+p[i];
    }
    for(int i=0;i<y;i++)
    {
        ans=ans+q[i];
    }
    
    cout<<ans;
    
    return 0;
}

Measured memory_bytes: 1408
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

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

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(m)]

uf = UnionFind(n+1)
for i in range(m):
  if uf.same(ab[i][0], ab[i][1]) == False:
    uf.union(ab[i][0], ab[i][1])

print(uf.group_count()-2)




Measured memory_bytes: 28660
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
   int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
   int k;
   cin>>k;
   cout<<a[k-1]<<endl;
}

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

int main()
{
	int N;
	cin >> N;
	vector<int> P( N );
	vector<int> Q( N );
	vector<int> A( N );
	for( int i = 0; i < N; i++ ) {
		cin >> P[i];
	}
	for( int i = 0; i < N; i++ ) {
		cin >> Q[i];
		A[i] = Q[i];
	}

	sort( A.begin(), A.end() );
	int n = 0, a, b;
	do {
		int flag1 = 0;
		int flag2 = 0;
		for( int i = 0; i < N; i++ ) {
			if( A[i] != P[i] ) flag1 = 1;
			if( A[i] != Q[i] ) flag2 = 1;
		}
		if( flag1 == 0 ) a = n;
		if( flag2 == 0 ) b = n;
		n++;
	 } while( next_permutation( A.begin(), A.end() ) );
	int ans = abs( a - b );

	cout << ans << endl;
}


Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if 500*a + 100*b + 50*c == X :
        ans += 1
print(ans)

Measured memory_bytes: 3060
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	class Pair {
		int y, x;
		Pair(int y, int x) {
			this.y = y;
			this.x = x;
		}
	}
	void run() {
		Scanner scan = new Scanner(System.in);
		int h = scan.nextInt();
		int w = scan.nextInt();
		int n = scan.nextInt();
		char[][] field = new char[h][];
		int sy = 0, sx = 0;
		for (int i = 0; i < h; i++) {
			field[i] = scan.next().toCharArray();
			for (int j = 0; j < w; j++) {
				if (field[i][j] == 'S') {
					sy = i;
					sx = j;
				}
			}
		}
		
		int[][] ans = new int[h][w];
		int life = 1;
		
		Queue<Pair> que = new LinkedList<Pair>();
		que.add(new Pair(sy, sx));
		while (!que.isEmpty()) {
			Pair p = que.poll();
			if (field[p.y][p.x] - '0' == n && life - 1 == n) {
				System.out.println(ans[p.y][p.x]);
				break;
			}
			int[] dy = { 0, 1,  0, -1 };
			int[] dx = { 1, 0, -1,  0 };
			for (int i = 0; i < 4; i++) {
				int ny = p.y + dy[i], nx = p.x + dx[i];
				if (ny < 0 || nx < 0 || ny >= h || nx >= w)
					continue;
				if (ans[ny][nx] != 0)
					continue;
				if (field[ny][nx] == 'X')
					continue;
				int t = ans[p.y][p.x] + 1;
				if (field[ny][nx] - '0' == life) {
					life++;
					ans = new int[h][w];
					que.clear();
					ans[ny][nx] = t;
					que.add(new Pair(ny, nx));
					break;
				} else {
					ans[ny][nx] = t;
					que.add(new Pair(ny, nx));
				}
			}
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

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

#define MAX 1e+18
vector<long long>v;

int main()
{
    v.push_back(0);
   for(long long i=1;i<=10000;i++)
   {
       long long num=1;
       for(int j=1;j<=5;j++)
       {
           num*=i;
       }
       if(num<=MAX&&num>0)
       {
          v.push_back(num);
       }
   }
   int length=v.size();
   long long X;
   cin>>X;
   for(int i=0;i<length;i++)
   {
       for(int j=0;j<length;j++)
       {
           if((v[i]+v[j]<=MAX)&&(v[i]+v[j]>0))
           {
               if(v[i]+v[j]==X)
               {
                 cout<<i<<" "<<-j<<endl;
                 return 0;
               }
           }
       }
   }
   for(int i=length-1;i>=0;i--)
   {
       for(int j=i-1;j>=0;j--)
       {
           if(v[i]-v[j]==X)
           {
               cout<<i<<" "<<j<<endl;
               return 0;
           }
       }
   }
}


Measured memory_bytes: 3760
# coding cell (SUBMIT ONLY THIS CELL)

N = int(input())

counter = {}

for i in range(N):
    temp = input()
    if temp not in counter:
        counter.update({temp : 1})
    else:
        counter.update({temp : counter[temp] + 1})

m = max(counter.values())
        
ans = []    

for a,b in counter.items():
    if b == m:
        ans.append(a)
    
ans.sort()

for i in ans:
    print(i)
    



Measured memory_bytes: 32096
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi atan(1.0)*4
#define pb(x) push_back(x)
#define in(x) insert(x)
#define fl(x,y) for(ll i=x;i<y;i++)
#define vi vector<long long>
#define vs  vector<string>
#define vp(vi,x) cin>>x; vi.pb(x);
string en="\n";
string t="hello";
string Y="YES\n";
string N="NO\n";
#define E end()
#define B begin()
#define sz size()
#define EM empty()
#define fi first
#define se second
#define clr clear()
#define sqr(a) (a*a)
#define mk make_pair
#define mem(a,b) memset(a,b,sizeof(a))
#define all(cont) cont.begin(),cont.end()
/*bool isprm(LL a){for(LL i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
bool palin(string a){for(int i=0;i<a.sz;i++){if(a.at(i)!=a.at(a.sz-i-1))return 0;} return 1;}
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}
int toInt(string s){int sm;stringstream ss(s);ss>>sm;return sm;}
LL bpow(LL a,LL b){if(b==0)return 1;LL r=bpow(a,b/2);if(b%2)return r*r*a;else return r*r;}
LL binpow(LL a,LL b){LL r=1;while(b>0){if(b&1)r=r*a;a=a*a;b>>=1;}return r;}
LL binpow(LL a,LL b,LL m){a%=m;LL r=1;while(b>0){if(b&1) r=r*a%m;a=a*a%m; b>>=1;}return r;}
template<typename T>inline T gcd(T a,T b){if(a<0)return gcd(-a,b);if(b<0)return gcd(a,-b);return (b==0)?a:gcd(b,a%b);}
template<typename T>inline T lcm(T a,T b) {if(a<0)return lcm(-a,b);if(b<0)return lcm(a,-b);return a*(b/gcd(a,b));}
*/
//bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}
int main()
{
    ll a,b,c,d,e,x,t,n,k,p,q,r,y,yy,sum,ct=0,flag=0;
    string s,s1,s2,s3;
    char ch;
    deque<char>d1,d2,d3;
    vector<ll>v,vv,vz;
    map<ll,ll>mp;
    double x1,y1,x2,y2,x3,y3,x4,y4;
    cin>>n; 
    cout<<n+n*n+n*n*n<<endl;
}






Measured memory_bytes: 3604
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
res = float('inf')
for i in a:
    cnt = 0
    while True:
        if i%2:
            res = min(res, cnt)
            break
        i //= 2
        cnt += 1
print(res)

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

const int maxn = 100009;
int a[maxn], b[maxn], n, ans, sum;

int main() {
	scanf("%d", &n);
	for (int i=1; i<=n; i++) scanf("%d", &a[i]);
	for (int i=1; i<=n; i++) scanf("%d", &b[i]);
	for (int i=1; i<=n; i++) {
		sum = 0;
		for (int j=1; j<=i; j++)
			sum += a[j];
		for (int j=i; j<=n; j++)
			sum += b[j];
		ans = max(ans, sum);
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 100010;
int N;
int x[MAX], y[MAX];
VI graph[MAX];

int dfs(int now, int prev) {
    int res = 0;
    FORE(e, graph[now]) {
        if (e != prev) {
            res ^= dfs(e, now) + 1;
        }
    }
    return res;
}

int main(void) {
    scanf("%d", &N);
    int oneCnt = 0;
    REP(i, N - 1) {
        scanf("%d%d", x + i, y + i);
        oneCnt += ((x[i] == 1) || (y[i] == 1));
        x[i]--;
        y[i]--;
        graph[x[i]].EB(y[i]);
        graph[y[i]].EB(x[i]);
    }
    if (oneCnt == 1) {
        cout << "Alice" << endl;
        return 0;
    }
    else {
        VI ch;
        cout << (dfs(0, -1) ? "Alice" : "Bob") << endl;
    }
}


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

int N;

int main(){
  cin >> N;
  if(N % 10 == 2 || N % 10 == 4 || N % 10 == 5 || N % 10 == 7 || N % 10 == 9) cout << "hon";
  else if(N % 10 == 0 || N % 10 == 1 || N % 10 == 6 || N % 10 == 8) cout << "pon";
  else if(N % 10 == 3) cout << "bon";
}

Measured memory_bytes: 3632
a, b = gets.chomp.to_i
s = gets.chomp
status = 'Yes'

s.length.times do |i|
  #a回
  if i < a && s[i] =~ /^[0-9]+$/
    #puts "#{s[i]} ok"

  #a+1がハイフン
  elsif i == a && s[a] == '-'
    #puts "#{s[i]} ok"

  #b回
  elsif i > a && s[i] =~ /^[0-9]+$/
    #puts "#{s[i]} ok"
  else
    status = 'No'
    break
  end
end

puts status

Measured memory_bytes: 1788
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;

bool check(string s) {
  for (int i = 0; i < s.length(); i++) {
    if (s[i] != s[s.length() - i - 1]) {
      return false;
    }
  }
  return true;
}

int main() {
  ll L;
  cin >> L;
  int k;
  long double vox = 0.0, x = L / 3.0;
  bool flag = false;
  vox = powl(x, 3);
  cout << fixed << setprecision(8) << vox << endl;
  return 0;
}

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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  cout << min(a, b) + min(c, d) << endl;
  return 0;
}


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

template<int MOD> struct Fp {
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
    if (val < 0) val += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator - () const noexcept {
    return val ? MOD - val : 0;
  }
  constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp& operator += (const Fp& r) noexcept {
    val += r.val;
    if (val >= MOD) val -= MOD;
    return *this;
  }
  constexpr Fp& operator -= (const Fp& r) noexcept {
    val -= r.val;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr Fp& operator *= (const Fp& r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp& operator /= (const Fp& r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b; swap(a, b);
      u -= t * v; swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr bool operator == (const Fp& r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator != (const Fp& r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
    return os << x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
    if (n == 0) return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1) t = t * a;
    return t;
  }
};

template<class T> struct BiCoef {
  vector<T> fact_, inv_, finv_;
  constexpr BiCoef() {}
  constexpr BiCoef(int n) noexcept : fact_(n, 1), inv_(n, 1), finv_(n, 1) {
    init(n);
  }
  constexpr void init(int n) noexcept {
    fact_.assign(n, 1), inv_.assign(n, 1), finv_.assign(n, 1);
    int MOD = fact_[0].getmod();
    for (int i = 2; i < n; i++) {
      fact_[i] = fact_[i - 1] * i;
      inv_[i] = -inv_[MOD % i] * (MOD / i);
      finv_[i] = finv_[i - 1] * inv_[i];
    }
  }
  constexpr T com(int n, int k) const noexcept {
    if (n < k || n < 0 || k < 0) return 0;
    return fact_[n] * finv_[k] * finv_[n-k];
  }
  constexpr T fact(int n) const noexcept {
    if (n < 0) return 0;
    return fact_[n];
  }
  constexpr T inv(int n) const noexcept {
    if (n < 0) return 0;
    return inv_[n];
  }
  constexpr T finv(int n) const noexcept {
    if (n < 0) return 0;
    return finv_[n];
  }
};

const int MOD = 1000000007;
using mint = Fp<MOD>;
BiCoef<mint> bc;

int main() {
  bc.init(510000);
  ios::sync_with_stdio(false);
  int N, K;
  cin >> N >> K;
  vector<long long> A(N);
  for (int i = 0; i < N; ++i) cin >> A.at(i);
  sort(A.begin(), A.end());

  mint ans = 0;
  for (int i = 0; i + 1 < N; i++) {
    mint fac = bc.com(N, K) - bc.com(i + 1, K) - bc.com(N - i - 1, K);
    ans += fac * (A.at(i + 1) - A.at(i));
  }

  cout << ans << "\n";
}

Measured memory_bytes: 13056
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<numeric>
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; }
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};


const int MAX = 510000;
const int MOD = 1000000007;

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


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


int main()
{

    ll N;
    cin >> N;
    vector<ll> A;
    // COMinit();
    ll same[MAX] = {};
    ll done[MAX] = {};

    for(ll i=0; i<N; ++i)
    {
        ll tmp;
        cin >> tmp;
        A.push_back(tmp);
        ++same[tmp];
    }

    ll all = 0;
    for(ll i=0; i<N; ++i)
    {
        if(done[A[i]]==1) continue;
        else
        {
            done[A[i]] = 1;
            // all += COM(same[A[i]],2);
            all += com(same[A[i]]);
        }
    }

    for(ll i=0; i<N; ++i)
    {
        // cout << all - COM(same[A[i]],2) + COM(same[A[i]]-1,2) << endl;
        cout << all - com(same[A[i]]) + com(same[A[i]]-1) << endl;
    }

    return 0;
}


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

int main()
{
  int64_t N,M;

  cin >> N  >> M;

  //vector<int> A(N);
  //vector<vector<int>> A(N, vector<int>(30));

  
  /* for (int i = 0; i < N; i++)
  {
    cin >> A.at(i);
  }*/

  if((N+M)%2==1){
    cout << "IMPOSSIBLE" << endl;
  }
  else{
    cout << (N+M)/2 << endl;
  }




}

Measured memory_bytes: 256
using System.Linq;
using System;

public class P
{
    public int id { get; set; }
    public int city { get; set; }
    public int no { get; set; }
    public int y { get; set; }
}

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        var ps = new P[m];
        for (int i = 0; i < m; i++)
        {
             line = Console.ReadLine().Trim().Split(' ');
            var p = int.Parse(line[0]);
            var y = int.Parse(line[1]);
            ps[i] = new P { id = i, city = p, y = y };
        }
        var ps2 = ps.OrderBy(x => x.city).ThenBy(x => x.y).ToArray();
        var pre = ps2[0].city;
        ps2[0].no = 1;
        var pp = 1;
        for (int i = 1; i < m; i++)
        {
            if (pre == ps2[i].city) { ps2[i].no = ++pp; }
            else { ps2[i].no = 1; pp = 1; pre = ps2[i].city;   }
        }
        var ps3 = ps2.OrderBy(x => x.id).ToArray();
        foreach (var x in ps3)
        {
            Console.Write("{0:000000}", x.city);
            Console.WriteLine("{0:000000}",x.no);
        }
    }
}


Measured memory_bytes: 31412
N = int(input())
t = [[0] * 10 for _ in range(10)]
for i in range(1, N + 1):
    s = str(i)
    t[int(s[0])][int(s[-1])] += 1
result = 0
for i in range(1, 10):
    for j in range(1, 10):
        result += t[i][j] * t[j][i]
print(result)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<c;++i)
int main(){
   int w,h,n;
   cin >> w >> h >> n;
   vector<int> x(n),y(n);
   vector<int> a(n);
   rep(i,n)
   cin >> x[i] >> y[i]>> a[i];
   int min_x = 0;
   int min_y = 0;
   int max_x = w;
   int max_y = h;
   rep(i,n){
      switch(a[i]){
         case 1:
         if(x[i]>min_x) min_x = x[i];
         break;
         case 2:
         if(x[i]<max_x) max_x = x[i];
         break;
         case 3:
         if(y[i]>min_y) min_y = y[i];
         break;
         case 4:
         if(y[i]<max_y) max_y = y[i];
      }
   }
   if(max_x<min_x||max_y<min_y){
      cout << 0 << endl;
      return 0;
   }
   int ans = (max_x-min_x)*(max_y-min_y);
   cout << ans << endl;
  }

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a1,a2,a3,a4,b1,b2,b3,b4,x,y;
	scanf("%d %d %d %d",&a1,&a2,&a3,&a4);
	scanf("%d %d %d %d",&b1,&b2,&b3,&b4);
	x=a1+a2+a3+a4;
	y=b1+b2+b3+b4;
	if(x<y){
		printf("%d\n",y);
	}
	else if(x>y){
		printf("%d\n",x);
	}
	else{
		printf("%d\n",x);
	}
	return 0;
}

Measured memory_bytes: 1796
#include<bits/stdc++.h>
#define int             long long
using namespace std;

const int N = 1e6 + 4, MOD = 1e9 + 7;
int n, fac[N];

int nm(int ans) { return ans % MOD; }

int DivMod(int val, int mod) {
    if (mod == 0) return 1LL;
    int tmp = DivMod(val, mod/2);
    if (mod % 2 == 1) return ((tmp * tmp) % MOD * val) % MOD;
    return (tmp * tmp) % MOD;
}

int C(int k, int n) {
    return ((fac[n] * DivMod(fac[n-k], MOD-2)) % MOD * DivMod(fac[k], MOD-2)) % MOD;
}

void sol() {
    fac[0] = 1;
    for (int i = 1; i < N; ++i) fac[i] = (fac[i-1] * i) % MOD;

    int res = 0, Prev = 0;
    for (int k = 1; k < n; ++k) {
        if (n-1-k > k-1) continue;

        int Add = C(n-1-k, k-1);
        Add = (Add * fac[k]) % MOD;
        Add = (Add * fac[n-1-k]) % MOD;

        res = (res + (Add - Prev) * k % MOD + MOD) % MOD;
        Prev = Add;
    }
    cout << res;
}

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

    sol();

    return 0;
}


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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h,w;
	cin>>h>>w;
	string b[50];
	for(int i=0;i<h;i++) cin>>b[i];
	const int dx[4]={1,0,-1,0};
	const int dy[4]={0,1,0,-1};
	rep(i,h){
		rep(j,w){
			if(b[i][j]=='.') continue;
			int num=0;
			rep(d,4){
				const int ni=i+dy[d];
				const int nj=j+dx[d];
				if(ni<0 or h<=ni) continue;
				if(nj<0 or w<=nj) continue;
				if(b[ni][nj]=='#') num++;
			}
			if(num==0){
				cout<<"No"<<endl;
				return 0;
			}
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long n,ans=0;
  cin >> n;
  long long a[n],b[n];
  map<long long, int> mp;
  for(int i=0;i<n;i++){
    cin >> a[i];
    b[i]=a[i];
    mp[a[i]]=i;
  }
  sort(b,b+n);
  for(int i=0;i<n;i++){
    if(mp[b[i]]%2!=i%2){
      ans++;
    }
  }
  cout << (ans+1)/2 << endl;
  return 0;
}


Measured memory_bytes: 8064
import Data.List

main = do
  n<-readLn
  a<-map read.words<$>getLine
  b<-map read.words<$>getLine
  print $ solve (solve n a b) b a

solve :: Int -> [Int]->[Int]->Int
solve n a b = go ts where
  ts = sortBy (\(_,a)(_,b)->compare b a) $ zipWith f a b where
    f a b = (b-a,a)
  go [(p1,c1),(p2,c2),(p3,c3)] = n + maximum ans where
    ans = [ p1*t1 + p2*t2 + p3*t3
          | t1 <- [0..if p1>0 then n`div`c1 else 0]
          , t2 <- [0..if p2>0 && c2<c1 then (n-t1*c1)`div`c2 else 0]
          , let t3 = if p3>0 then (n-t1*c1-t2*c2)`div`c3 else 0]

Measured memory_bytes: 2300
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		String[] sList = sc.next().split("");
        int ans = 0;
        for(String s : sList) {
          if (s.equals("2")) {
            ans++;
          }
        }
    
		// 出力
		System.out.println(ans);
	}
}

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

int k;

int main(){
    ios_base::sync_with_stdio(0);
    //freopen("input.txt","r",stdin);

    cin>>k;
    vector<string> lun;
    vector<string> strs = {"1","2","3","4","5","6","7","8","9"};
    vector<string> next;
    while(lun.size()<=k-1){
        next.clear();
        for(string s : strs){
            lun.push_back(s);
            int sz = s.size();
            for(char c='0';c<='9';c++){
                if(abs(s[sz-1]-c)<=1){
                    next.push_back(s+c);
                }
            }
        }
        strs = next;
    }
    cout<<lun[k-1];
}


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

int main() {
  double num = 0.006;
  int n, t, a;
  cin >> n >> t >> a;
  int ans = 0;
  double diff = 100000000.00;
  rep(i,n){
    int h;
    cin >> h;
    double num2 = (double)t - h * num;
    double diff_1 = abs(num2 - (double)a);
    if(diff_1 < diff){
      diff = diff_1;
      ans = i + 1;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	static int gcd (int x, int y){
		int num=1;
		int max= Math.abs(x-y);
		if(max==0){
			return x;
		}
        for (int i=max; i > 0;i--) {
        	if (((x%i)==0) && ((y%i)==0)){
        		num=i;
        		break;
        	}
        }
		return num;
	}

	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);

        int [] x = new int[2];

        for(int i = 0; i < 2; i++){
        	x[i] = stdIn.nextInt();
        }
        stdIn.close();
        int ans;
        ans = gcd(x[1], x[0]);
        System.out.println(ans);
	}
}



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

int main() {
    int N;
    cin>>N;
    int H[N];
    int hei = 0;
    int ans = 0;
    for(int i=0; i<N; i++){
        int h;
        cin>>h;
        if(h >= hei){
            ans++;
            hei = h;
        }
    }

    cout << ans << endl;
}

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

namespace ABC043A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int a = 0;

            for (int i = 0; i <= n; i++ )
            {
                a = a + i;
            }

            Console.WriteLine(a);
            Console.ReadKey();

        }
    }
}


Measured memory_bytes: 11092
while True:
    H, W = map(int, raw_input().split())
    if H == W == 0:
        break
    for i in range(H):
        if W == 1 and i % 2 == 0:
            print "#"
        elif W == 1 and i % 2 == 1:
            print "."
        elif i % 2 == 0:
            print "#." * (W / 2) + "#" * (W%2)
        else:
            print ".#" * (W / 2) + "." * (W%2)
    print



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

int main(){
  int n,x,L[100],D=0,ans=1;
  cin>>n>>x;
  for(int i=0;i<n;i++){
    cin>>L[i];
  }
  for(int i=0;i<n;i++){
    D+=L[i];
    if(D>x){
      cout<<ans<<endl;
      return 0;
    }
    ans++;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] b = new int[n];
        Map<Integer, Integer> map1 = new HashMap<>();
        Map<Integer, Integer> map2 = new HashMap<>();

        for (int i = 0; i < n; i++) {
            int val = sc.nextInt();
            if (i % 2 == 0) {
                int count = map1.getOrDefault(val, 0);
                map1.put(val, ++count);
            } else {
                int count = map2.getOrDefault(val, 0);
                map2.put(val, ++count);
            }
        }

        List<Map.Entry<Integer, Integer>> list1 = new ArrayList<>(map1.entrySet());
        list1.sort((e1, e2) -> (e2.getValue() - e1.getValue()));
        List<Map.Entry<Integer, Integer>> list2 = new ArrayList<>(map2.entrySet());
        list2.sort((e1, e2) -> (e2.getValue() - e1.getValue()));

        int size = n / 2;
        if (!list1.get(0).getKey().equals(list2.get(0).getKey())) {
            int res = size - list1.get(0).getValue();
            res+= size - list2.get(0).getValue();
            System.out.println(res);
        } else {
            if (size == 1) {
                System.out.println(1);
            } else {

                int p1 = 2 * size - list1.get(0).getValue();
                if (list2.size() > 1) p1 -= list2.get(1).getValue();
                int p2 = 2 * size - list2.get(0).getValue();
                if (list1.size() > 1) p2 -= list1.get(1).getValue();
                System.out.println(Math.min(p1, p2));
            }
        }

    }
}

Measured memory_bytes: 63012
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;



int main(void){
    int n,k;
    cin >> n >> k;
    vector<int> v(n);
    REP(i,n)
        cin >> v[i];
    
    sort(ALL(v));

    int ans=0;
    REP(i,k)
        ans+=v[i];

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

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

using namespace std;

int main() {
  int a;
  cin >> a;
  int b[3];
  b[0] = a / 100;
  b[1] = a % 100 / 10;
  b[2] = a % 100 % 10;

  for (int i = 0; i < 3; i++) {
    if (b[i] == 7) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 3624
/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)


using namespace __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
const int mod=1000000007;
  i64 poww(i64 a, i64 b)
  {
    a%=mod;
    i64 res=1;
    while(b)
      {
if(b&1)res=res*a%mod;

      a=a*a%mod;
      b/=2;

      }
      return res;
  }
  i64 inv(i64 a)
  {
    return poww(a,mod-2);
  }


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

    // ifstream fin(".in");
    // ofstream fout(".in");

i64 l,r,d;
cin>>l>>r>>d;
cout<<(r/d)-max(0LL,(l-1)/d);


    return 0;
  }


Measured memory_bytes: 3608
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <string>
#include <cmath>
#include <set>
#include <cmath>
using namespace std;

vector<int> dp;
vector<vector<int>> g;

int go(int v)
{
	if (dp[v] != 0)
	{
		return dp[v];
	}

	dp[v] = 1;
	for (int i = 0; i < (int)g[v].size(); i++)
	{
		int nxt = g[v][i];

		dp[v] = max(dp[v], go(nxt) + 1);
	}

	return dp[v];
}

void solve()
{
	int n, m;
	cin >> n >> m;

	g.resize(n);

	dp.assign(n, 0);

	for (int i = 0; i < m; i++)
	{
		int x, y;
		cin >> x >> y;
		x--, y--;
		g[x].push_back(y);
	}

	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		ans = max(ans, go(i));
	}

	cout << ans - 1;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	//freopen("file.in", "r", stdin);//freopen("file.out", "w", stdout);

	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}

Measured memory_bytes: 8192
#include<iostream>
using namespace std;
int main()
{
  int sx,sy,tx,ty,i;
  cin >> sx >> sy >> tx >> ty;
  for(i=sx;i<tx;i++)
    cout << "R";
  for(i=sy;i<ty;i++)
    cout << "U";
  for(i=tx;i>sx;i--)
    cout << "L";
  for(i=ty;i>=sy;i--)
    cout << "D";
  for(i=sx;i<=tx;i++)
    cout << "R";
  for(i=sy;i<=ty;i++)
    cout << "U";
  cout << "LU";
  for(i=tx;i>=sx;i--)
    cout << "L";
  for(i=ty;i>=sy;i--)
    cout << "D";
  cout << "R" << endl;
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
// Custom Header {{{
#define ALL(x) x.begin(), x.end()
#define rep(i, s, n)      for(int i(s); i < int(n); ++i)
#define endl '\n'
#ifndef YDK
#define eprintf(...)
#endif
using namespace std;
using i64 = long long;
using pii = pair<i64, i64>;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr const int INF  = 0x3f3f3f3f;
constexpr const i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr const int MOD  = int(1e9) + 7;
// }}}

// Library {{{
struct UnionFind {
    vector<int> u;
    UnionFind(int n): u(n+5, -1) {}
    int  size(int i)        { return (-u[root(i)]); }
    int  root(int x)        { return (u[x] < 0)? x : u[x] = root(u[x]); }
    bool same(int x, int y) { return root(x) == root(y); }
    bool unite(int x, int y){ return (x=root(x)) == (y=root(y))? false : (u[x]+=u[y], u[y]=x, true); }
};
// }}}

struct FastIO {
    FastIO() { cin.tie(nullptr); ios::sync_with_stdio(false); }
} fastIO_ydk ;

int N;
int x[100010];
int y[100010];
vector<int> row[100010];
vector<int> col[100010];

unordered_set<int> w[100010];
unordered_set<int> h[100010];

signed main()
{
    cin >> N;
    rep(i, 0, N) {
        cin >> x[i] >> y[i];
        row[y[i]].push_back(i);
        col[x[i]].push_back(i);
    }

    UnionFind uf(N);

    for (int i = 0; i < 100010; ++i) {
        const auto &r = row[i];
        const auto &c = col[i];
        for (int j = 1; j < r.size(); ++j) {
            uf.unite(r[j], r[j-1]);
        }
        for (int j = 1; j < c.size(); ++j) {
            uf.unite(c[j], c[j-1]);
        }
    }

    unordered_set<int> groups;
    for (int i = 0; i < N; ++i) {
        const int g = uf.root(i);
        groups.insert(g);
        w[g].insert(x[i]);
        h[g].insert(y[i]);
    }

    i64 num = 0;
    for (int g : groups) {
        num += w[g].size() * h[g].size();
    }

    cout <<  num - N << endl;

    return 0;
}


Measured memory_bytes: 24576
S = input()
l = len(S)
T = list(S)


tmp = 0

while tmp < len(T)-1:
    if T[tmp] != T[tmp+1]: 
        T.pop(tmp)
        T.pop(tmp)
        if tmp == 0:
            tmp = 0
        else:
            tmp -= 1
    else:
        tmp += 1


k = len(T)

ans = l - k

print(ans)



Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n;
    cin >> n;

    int taste[n];
    for (int i = 0; i < n; i++) {
        cin >> taste[i];
    }
    
    int res = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            res += taste[i] * taste[j];
        }
    }

    cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n, m;
  cin >> n >> m;
  vl red(n, 0), cnt(n, 1);
  red[0] = 1;
  rep(i, m) {
    ll x, y;
    cin >> x >> y;
    x--, y--;
    cnt[x]--;
    cnt[y]++;
    if(red[x] == 1) red[y] = 1;
    if(cnt[x] == 0) red[x] = 0;
  }
  ll ans = 0;
  rep(i, n) if(red[i] == 1) ans++;
  cout << ans << endl;
}

Measured memory_bytes: 4844
X,K,D = map(int, input().split())
if X == 0:
  if K % 2 == 0:
    print(0)
  else:
    print(D)
  exit(0)

if X < 0:
  xminus = True
  X = (-1) * X
else:
  xminus = False
  
if abs(X) > K*D:
  ans = X - K*D
else:
  wk = X // D
  K -= wk
  now = X % D
  #print(wk,now)
  if K % 2 == 0:
    ans = now
  else:
    ans = abs(now-D)
    
print(ans)

Measured memory_bytes: 9200
inf = 10 ** 9 + 1
n, W = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(n)]
dp = {0: 0}
for w, v in wv:
    ndp = dp.copy()
    for dv, dw in dp.items():
        nw = w + dw
        if nw > W: continue
        nv = v + dv
        ndp.setdefault(nv, inf)
        if nw < ndp[nv]:
            ndp[nv] = nw
    dp = ndp
print(max(dp.keys()))

Measured memory_bytes: 13628
#include <stdio.h>
 #include <stdlib.h>
  
 int main(void)
 {
     int a,b,c,d;
  
     scanf("%d%d%d%d",&a,&b,&c,&d);
   
     if(abs(a-c) <= d)
         printf("Yes\n");
  
     else if (abs(a-b) <= d && abs(c-b) <= d)
         printf("Yes\n");
  
     else
   printf("No\n");
  
  return 0;
}
  

Measured memory_bytes: 128
def examA():
    X = I()
    if X<30:
        ans = "No"
    else:
        ans = "Yes"
    print(ans)
    return

def examB():
    N, D = LI()
    cnt = 0
    for _ in range(N):
        x, y = LI()
        if x**2+y**2<=D**2:
            cnt += 1
    ans = cnt
    print(ans)
    return

def examC():
    N = 10**7
    K = I()
    cur = 0
    now = 1
    ans = -1
    for i in range(N):
        cur += 7 * now
        cur %= K
        if cur==0:
            ans = i+1
            break
        now *= 10
        now %= K
    print(ans)
    return

def examD():
    N = I()
    C = SI()
    cnt = 0
    l = 0; r = N-1
    while(l<r):
        while(l<N):
            if C[l]=="W":
                break
            l += 1
        while(0<=r):
            if C[r]=="R":
                break
            r -= 1
        if l<r:
            cnt += 1
            l += 1
            r -= 1
    ans = cnt
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

def test():
    i = I()
    li = LI()
    lsi = LSI()
    si = LS()
    print(i)
    print(li)
    print(lsi)
    print(si)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep,alphabet_convert
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examD()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 78872