akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int num;
    int count = 1;

    while (true) {
        cin >> num;
        if (num == 0) 
            break;

        double area = 0.0;
        int x1, y1, bx, by, ax, ay;
        cin >> x1 >> y1;
        bx = x1;
        by = y1;

        for (int i = 1; i < num; i++) {
            cin >> ax >> ay;
            area += bx * ay - ax * by;
            bx = ax;
            by = ay;
        }
        area += bx * y1 - x1 * by;

        cout << setprecision(1) << fixed;
        cout << count++ << " " << 0.5 * abs(area) << endl;
    }

    return 0;
}

Measured memory_bytes: 1240
n = int(input())
data = [int(i) for i in input().split(' ')]

def bubble_sort(raw_list):
    n_list = len(raw_list)
    n_swap = 0
    sorted_i = 1
    flag = True
    while flag:
        flag = False
        for j in reversed(range(sorted_i, n_list)):
            if raw_list[j] < raw_list[j-1]:
                raw_list[j-1], raw_list[j] = raw_list[j], raw_list[j-1]
                n_swap += 1
                flag = True
        sorted_i += 1
    print(' '.join([str(i) for i in raw_list]))
    print(n_swap)
        
bubble_sort(data)

Measured memory_bytes: 7744
N,K=map(int,input().split())
have=set()
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for a in A:
    have.add(a)
ans=0
for n in range(N):
  n+=1
  if n not in have:
    ans+=1
print(ans)

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

typedef long long ll;
const ll mod=1e9+7;
const ll N=1e5+1;
const ll INF=1e10;

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	int n;
	cin>>n;
	vector<int> a(n);
	int Xor=0;
	for(int &i:a) cin>>i,Xor^=i;
	for(int i=0;i<n;i++) cout<<(a[i]^Xor)<<' ';
}


Measured memory_bytes: 3992
# D - XXOR

import sys
readline = sys.stdin.readline

N, K = map(int, readline().split())
A = list(int(x) for x in readline().split())

# bits[i] := i桁目に現れる"1"の和
bits = [0] * 50
for i in range(N):
    for j in range(50):
        if A[i]>>j&1:
            bits[j] += 1

# dp[i][smaller] := 上から(49, 48, 47...)i桁目まで決めた時に、
# Kと同じように選んで行ったとき(smaller = 0)
# K以下となるように選んだとき(smaller = 1)
# のそれぞれの最大値とする
dp = [[0] * 2 for _ in range(50)]

for i in range(49)[::-1]:
    # 上から順にチェックする(49, 48, 47...2, 1, 0)
    check_bit = 1<<i
    # Kのi桁目が"1"のとき
    if K&check_bit:
        # XをK以下にする場合。
        # i桁目は"0"になるので、bits[i](*2^i)が得点になる。
        dp[i][1] = dp[i+1][0] + (bits[i] * check_bit)
        # 一度smaller=1になったらsmaller=1にしか遷移しない。
        if dp[i+1][1] != 0:
            dp[i][1] = max(dp[i][1], dp[i+1][1] + (max(N - bits[i], bits[i]) * check_bit))
        # Kのi桁目"1"の通りにするので、i桁目が反転される。
        # つまり、元々"0"だった個数分が得点になる。
        dp[i][0] = dp[i+1][0] + ((N - bits[i]) * check_bit)
    # Kのi桁目が"0"のとき
    else:
        # 一度smaller=1になったらsmaller=1にしか遷移しない。
        # 0か1かは最大値が大きくなる方を選べば良い。
        if dp[i+1][1] != 0:
            dp[i][1] = dp[i+1][1] + (max(N - bits[i], bits[i]) * check_bit)
        # Kのi桁目"0"の通りにするので、bits[i]が得点になる
        dp[i][0] = dp[i+1][0] + (bits[i] * check_bit)

print(max(dp[0][0], dp[0][1]))

Measured memory_bytes: 14588
#include<bits/stdc++.h>
using namespace std;
int ans;
int t(int n,int k);
int main()
{
	int x,m;
    cin>>x>>m;
    t(x,m);
    cout<<ans<<endl;
    return 0;
}
int t(int n,int k)
{
    int r;
    r=n%k;
    n=n/k;
    if(n!=0) t(n,k);
    ans++;
}

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

int get_digit(int n)
{
  int cnt = 0;
  while (1)
  {
    n /= 10;
    cnt++;
    if (n == 0)
    {
      return cnt;
    }
  }
}

int main()
{
  long N;
  cin >> N;
  int m = 100;
  // O(√N)のアルゴリズム
  for (int i = 1; i <= (int)sqrt(N); i++)
  {
    if (N % i == 0)
    {
      m = min(m, max(get_digit(i), get_digit(N / i)));
    }
  }
  cout << m << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>

using namespace std;

typedef pair<int,int> P;

int HashH(int now, set<int>& vis) {
    int val=now;
    for(auto x : vis) {
        val+=(1<<(x+7));
    }
    return val;
}

int dfs(int now, set<int>& vis, unordered_map<int,int>& dp, vector<vector<vector<int> > >& e, int church, int cnt) {
    int hashval=HashH(now,vis);

    if(dp.count(hashval)!=0) {
        return dp[hashval];
    } else if(cnt==0 && now==church) {
        return dp[hashval]=1;
    }

    int dh[4]={-1,0,1,0};
    int dw[4]={0,-1,0,1};

    int ret=0;
    for(int d=0; d<4; ++d) {
        for(int i=0; i<(int)e[d][now].size(); ++i) {
            if(vis.count(e[d][now][i])==0) {
                if(e[d][now][i]==church && cnt>1) continue;
                vis.insert(e[d][now][i]);
                ret+=dfs(e[d][now][i],vis,dp,e,church,cnt-1);
                vis.erase(e[d][now][i]);
                break;
            }
        }
    }
    return dp[hashval]=ret;
}

void solve(int m, int n) {
    vector<vector<int> > mp(n);
    int cnt=0;
    vector<P> hou;
    P ch;
    set<int> vis;

    for(int i=0; i<n; ++i) {
        for(int j=0; j<m; ++j) {
            int temp;
            cin >> temp;
            if(temp==1) {
                mp[i].push_back(cnt);
                hou.push_back(P(i,j));
                ++cnt;
            } else if(temp==2) {
                ch=P(i,j);
                mp[i].push_back(-2);
            } else {
                mp[i].push_back(-1);
            }
        }
    }

    hou.push_back(ch);
    mp[ch.first][ch.second]=cnt;

    // edge
    vector<vector<vector<int> > > e(4);
    for(int i=0; i<4; ++i) e[i].resize(cnt+1);

    for(int i=0; i<(int)hou.size(); ++i) {
        P now=hou[i];
        int dh[4]={-1,0,1,0};
        int dw[4]={0,-1,0,1};
        for(int d=0; d<4; ++d) {
            P nxt=now;
            while(true) {
                nxt.first+=dh[d];
                nxt.second+=dw[d];
                if(nxt.first<0 || nxt.first>=n || nxt.second<0 || nxt.second>=m) break;
                if(mp[nxt.first][nxt.second]>=0) e[d][i].push_back(mp[nxt.first][nxt.second]);
            }
        }
    }

    unordered_map<int,int> dp;
    int ans=dfs(cnt,vis,dp,e,cnt,cnt+1);
    cout << ans << endl;
    return;
}

int main() {
    int m,n;
    while(true) {
        cin >> m >> n;
        if(m==0 && n==0) break;
        solve(m,n);
    }
    return 0;
}


Measured memory_bytes: 61052
a=int(input())
b=int(input())
c=int(input())
x=int(input())
count=int(0)
for i in range(0,a+1):
    for j in range(0,b+1):
        for k in range(0,c+1):
            if 500*i+100*j+50*k==x:
                count+=1
print(count)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <set>
#define rep(i,n) for (int i=0; i < (n); ++i)
#define all(a) a.begin(), a.end()
using ll = long long;
using namespace std;
 


int main() {
  int n; cin >> n;
  int p = 0;
  vector<int> x(n);
  rep(i,n) cin >> x[i];

  int ans = 1001001001;
  for (int p = 1; p <= 100; p++) {
    int now = 0;
    rep(i,n) now += (x[i] - p)*(x[i] - p);
    ans = min(ans, now);
  }
  cout << ans << endl;

}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,i,kazu;
    cin>>a>>b>>c;
    for (i=a; i<=b;i++){
        if (c%i==0){
            kazu++;
        }
        
    }
    cout<<kazu<<endl;
    return 0;
}



Measured memory_bytes: 3116
object Main extends App {
  val N = readInt
  val line = readLine
  val a = line.split(" ").map(_.toInt)
  val sorted = a.sorted(Ordering[Int].reverse)
  val alice = sorted.zipWithIndex.filter(_._2 % 2 == 0).map(_._1).sum
  val bob = sorted.zipWithIndex.filter(_._2 % 2 == 1).map(_._1).sum
  println(alice-bob)
}


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

#define pb push_back
#define fi first
#define se second
typedef long long ll;

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

	ll n;
	cin >> n;

	cout << 1000LL * (n / 500) + 5LL * ((n % 500) / 5) << '\n';
}


Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
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 fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    X=I()
    ans = X//11*2
    X%=11
    if 0<X<=6:
        ans += 1
    elif 6<X:
        ans += 2
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 6540
#define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <math.h>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <map>
#include <set>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> Pd;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const ll INF = 1LL << 50;
const double EPS = 1E-10;

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

int main(){
	int k, c;
	int total;
	while(cin >> k && k){
		total = 0;
		rep(i, k * (k - 1) / 2){
			cin >> c;
			total += c;
		}
		cout << total / (k - 1) << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stdio.h>
#include <math.h>


using namespace std;

typedef long long ll;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<ll> vll;

typedef pair<int, int> P;
#define mp(x, y) make_pair(x, y)

typedef queue<int> qi;
typedef queue<string> qs;


#define rep(i, n) for(int i=0; i<(n); ++i)
#define repp(i, a, b) for(int i = (a); i <= (b); i++)
#define repm(i, n) for(int i=n; i >= 0; i--)

#define all(v) v.begin(), v.end()
//sort( all(v) )　などと使える

int main(void) {
    string s, t; cin >> s >> t;
    int n = s.size();

    int ans = 0;

    rep(i, n) if (s[i] != t[i]) ans++;

    cout << ans << endl;
 }

Measured memory_bytes: 3920
# abc137B - One Clue
K, X = list(map(int,input().split()))
left = max(-1000000,X-K+1)
right = min(1000000,X+K-1)
if left == right:
    print(left)
else:
    for i in range(left,right+1,1):
        print(i,end=" ")

Measured memory_bytes: 3060
#include<stdio.h>

int main(void)
{
	char N[4];
	scanf("%s",N);
	
	if((N[0]==N[1])&&(N[1]==N[2])){
		printf("Yes\n");
	}else if((N[2]==N[3])&&(N[1]==N[2])){
		printf("Yes\n");
	}else if((N[0]==N[1])&&(N[1]==N[2])&&(N[3]==N[2])){
		printf("Yes\n");
	}
	
	
	
	else {
		printf("No\n");
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define inf 0x3f3f3f3f
#define mod 1000000007
#define maxm 
#define maxn 

int main()
{
	int x;
	
	scanf("%d", &x);
	printf("%d\n", 24 - x + 24);
}


Measured memory_bytes: 892
# coding: utf-8
s = input().rstrip()
q = int(input().rstrip())
for i in range(q):
    line = input().rstrip().split()
    if line[0] == "print":
        print(s[int(line[1]):int(line[2])+1])
    elif line[0] == "reverse":
        s = s[:int(line[1])] + s[int(line[1]):int(line[2])+1][::-1] + s[int(line[2])+1:]
    elif line[0] == "replace":
        s = s[:int(line[1])] + line[3] + s[int(line[2])+1:]


Measured memory_bytes: 5620
#include<bits/stdc++.h>
using namespace std;
int main(){
  int ans=0;
  vector<int>a(5);
  for(int i=0;i<5;i++){
    cin >> a.at(i);
  }
  
  for(int i=0;i<5;i++){
    if(a.at(i)==0)ans=i+1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3536
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ul;
typedef signed long long ll;
ul over = 1000000007;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  int n, m, q;
  cin >> n >> m >> q;
  vector< vector< int > > ans(n, vector< int >(n, 0));
  for (int i=0; i<m; ++i) {
    int l, r;
    cin >> l >> r;
    l--; r--;
    for (int j=r; j<n; ++j) ans[l][j]++;
  }
  for (int ep=0; ep<q; ++ep) {
    int p, q;
    cin >> p >> q;
    p--; q--;
    int ans_ep = 0;
    for (int i=p; i<=q; ++i) ans_ep += ans[i][q];
    cout << ans_ep << endl;
  }
  return 0;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define lli long long int
#define llu unsigned long long int
#define fr(va, beg, end) for (lli va = beg; va < end; va++)
#define pb push_back
#define rt return 0
#define endln "\n"
#define all(x) x.begin(), x.end()
#define sz(x) (lli)(x.size())
const lli MOD = 1e9 + 7;
// cout << fixed << setprecision(0) << pi <<endl;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
//              tree_order_statistics_node_update>
//     new_data_set;
// for multiset
// typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
//              tree_order_statistics_node_update>
//     new_data_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)

void solve() {
    lli n, a;
    cin >> n;
    lli p = n / 500;
    lli ans = p * 1000;
    lli q = n % 500;
    ans += (q / 5) * 5;
    cout << ans << endl;
}

int main(void) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    // lli t; cin >> t; while(t--)
    solve();
    rt;
}

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

using ll = long long;
// #define int long long

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
/***** MAIN *****/
signed main() {
  double h, a;
  cin >> h >> a;
  cout << ceil(h / a);
  
  
  cout << "\n";
  return 0;
}
/***** MAIN *****/


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#define PI 3.14159265359
typedef long long ll;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
using namespace std;


ll llmin(ll x, ll y){
	if (x < y) return x;
	return y;
}

ll llmax(ll x, ll y){
	if (x > y) return x;
	return y;
}

vector<int> graph[100001];
ll fact[100001];
bool visited[100001];
ll n, k;

ll modpow(ll a, ll x){
	ll res = 1;
	while (x > 0){
		if (x & 1) res = res * a % MOD;
		a = a * a % MOD;
		x >>= 1;
	}
	return res;
}

ll modinv(ll a){
	return modpow(a, MOD-2);
}

ll nPr(ll x, ll y){
	return fact[x]*modinv(fact[x-y])%MOD;
}

ll dfs(int now){
	visited[now] = true;
	int siz = graph[now].size();
	if (now != 1 && siz == 1) return 1;
	ll ans = 1;
	if (now == 1){
		if (siz > k-1) return 0;
		ans *= nPr(k-1, siz);
		ans %= MOD;
	}else{
		if (siz > k-1) return 0;
		ans *= nPr(k-2, siz-1);
		ans %= MOD;
	}
	for (auto x : graph[now]){
		if (!visited[x]){
			ans *= dfs(x);
			ans %= MOD;
		}
	}
	return ans;
}

int main(){
	cin >> n >> k;
	for (int i = 1; i < n; i++){
		int a, b;
		cin >> a >> b;
		graph[a].push_back(b);
		graph[b].push_back(a);
	}
	fact[0] = 1;
	for (int i = 1; i <= 100000; i++){
		fact[i] = fact[i-1]*i;
		fact[i] %= MOD;
	}
	if (n == 1){
		cout << k << endl;
		return 0;
	}
	cout << k*dfs(1)%MOD << endl;
	
	return 0;
}


Measured memory_bytes: 13408
#include <stdio.h>
int main(void)
{
int i,j;
int H,W;
while(1){
scanf("%d %d",&H,&W);
if(H == 0 && W == 0 )
break;

for (i = 0;i < H;i++){
   for (j = 0;j < W; j++){
      printf("#");
     }
      printf("\n");
 }
printf("\n");
}
return 0;
} 

Measured memory_bytes: 572
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; typedef long double ld;
const int INF32 = 1e9+10;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int A, B, K; cin >> A >> B >> K;
  for (int i = 0; i < K; i++) {
    if (i % 2 == 0) {
      if (A % 2 == 1) {
        A--;
      }
      B += A/2;
      A /= 2;
    } else {
      if (B % 2 == 1) {
        B--;
      }
      A += B/2;
      B /= 2;
    }
  }
  cout << A << " " << B << endl;
}


Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>
#include <chrono>
#include <cstring>

using namespace std;

typedef long long ll;

#ifdef ONPC
  mt19937 rnd(228);
#else
  mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

int main()
{
#ifdef ONPC
  freopen("a.in", "r", stdin);
#endif
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector <int> cnt(26, 1);
  for (auto c : s)
  {
    cnt[c - 'a']++;
  }
  int ret = 1;
  int mod = 1e9 + 7;
  for (int i = 0; i < 26; i++)
  {
    ret = (ret * (ll) cnt[i]) % mod;
  }
  cout << (ret + mod - 1) % mod << endl;
}


Measured memory_bytes: 512
#include <stdio.h>
int main(void) {
  long n,x,y,a,d,c;
  n=0;
  x=0;
  y=0;
  d=0;
  a=0;
  c=0;
  scanf("%ld",&n);
  scanf("%ld",&d);
  for(a=0;a<n;a++)
  {
    scanf("%ld",&x);
    scanf("%ld",&y);
    if(x*x+y*y<=d*d)
    {
      c++;
    }
  }
  printf("%ld\n",c);
}


Measured memory_bytes: 1704
#include<bits/stdc++.h>
using namespace std;
long long  gcd( long long  a ,long long   b)
{
   if(b==0) return a;
   a%=b;
   return gcd(b,a);
}
long long findGCD(vector<long long >v)
{
    long long result = v.front();
    for (long long  i = 1; i < v.size(); i++)
        result = gcd(v[i], result);

    return result;
}
int main()
{
	long long n,X,x;
	cin>>n>>X;
	vector<long long >v;
	for(int i=0;i<n;i++)
    {
        cin>>x;
        v.push_back(abs(X-x));
    }
    sort(v.begin(),v.end());
    if(findGCD(v)>1)
        cout<<findGCD(v)<<endl;
    else
        cout<<"1"<<endl;

return 0;


}


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

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

  string s;
  cin >> s;
  int size=s.size();
  rep(i, size)if(s[i]=='?')s[i]='D';

  cout << s << endl;

  return 0;
}

Measured memory_bytes: 3728
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;

int n,d,x;
int a[200];

int main()
{
    cin>>n>>d>>x;
    for (int i=0; i<n; ++i)
    {
        cin>>a[i];
        x+=1+((d-1)/a[i]);
    }
    cout<<x<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string.h>
using namespace std;

#define INF 2222147483647

struct data{
	long long from;
	long long to;
	long long val;
};

struct point{
	vector<long long> to;
	vector<long long> val;
};

void init(point p[],data a[],long long w[],long long n){
	for(long long i=1;i<=n;i++){
		w[i] = -INF;
		p[i].to.clear();
		p[i].val.clear();
		a[i].from = a[i].to = a[i].val = 0;
	}
}

void search(point p[],long long x,point tmp[],bool order,bool vis[]){
	vis[x] = true;
	for(long long i=0;i<p[x].to.size();i++){
		if(order){
			tmp[x].to.push_back(p[x].to[i]);
			tmp[x].val.push_back(p[x].val[i]);
		}
		else{
			tmp[p[x].to[i]].to.push_back(x);
			tmp[p[x].to[i]].val.push_back(p[x].val[i]);
		}
		if(vis[p[x].to[i]] == false)
			search(p,p[x].to[i],tmp,order,vis);
	}
}

void make_edge(point p[],data a[],long long x,long long &index,bool vis[]){
	vis[x] = true;
	for(long long i=0;i<p[x].to.size();i++){
		index++;
		a[index].from = x;
		a[index].to = p[x].to[i];
		a[index].val = p[x].val[i];
		if(vis[p[x].to[i]] == false)
			make_edge(p,a,p[x].to[i],index,vis);
	}
	
}

main(){
	long long n,m,k,index,ifrom,ito,ival;
	long long w[2510];
	bool b,vis[2510];
	data a[5010];
	point p[2510],tmp[2510];
	
	cin>>n>>m>>k;
	for(long long i=1;i<=m;i++){
		cin>>ifrom>>ito>>ival;
		p[ito].to.push_back(ifrom);
		p[ito].val.push_back(ival);
	}
	
	index = 0;
	memset(vis,0,sizeof(vis));
	search(p,n,tmp,0,vis);
	init(p,a,w,n);
	memset(vis,0,sizeof(vis));
	search(tmp,1,p,1,vis);
	memset(vis,0,sizeof(vis));
	make_edge(p,a,1,index,vis);
	
	/*
	cout<<index<<endl;
	for(long long i=1;i<=index;i++){
		cout<<a[i].from<<" "<<a[i].to<<" "<<a[i].val<<endl;
	}
	*/
	
	w[1] = 0;
		
	for(long long i=1;i<=n+1;i++){
		b = false;
		for(long long j=1;j<=index;j++){
			if(w[a[j].to] < w[a[j].from] + a[j].val - k){
				b = true;
				w[a[j].to] = w[a[j].from] + a[j].val - k;
			}
		}
		if(b == false)
			break;
	}
	if(b)			cout<<-1;
	else if(w[n]<0)	cout<<0;
	else			cout<<w[n];
	
}
/*
2 2 10
1 2 100
2 1 100
*/

Measured memory_bytes: 1152
#include<bits/stdc++.h>
void maxs(int&a,int b){if(a<b)a=b;}
void mins(int&a,int b){if(a>b)a=b;}
int n,a[100007];
int main(){
	scanf("%d",&n);
	int mx=0,mn=n+1,c1=0,c2=0;
	for(int i=1;i<=n;++i){
		scanf("%d",a+i);
		maxs(mx,a[i]);
		mins(mn,a[i]);
	}
	if(mx==n-1&&mx==mn)return puts("Yes"),0;
	for(int i=1;i<=n;++i){
		if(a[i]<mx){
			if(a[i]!=mx-1)return puts("No"),0;
			++c1;
		}else ++c2;
	}
	puts(c2>1&&c1+1<=mx&&mx<=c1+c2/2?"Yes":"No");
	return 0;
}

Measured memory_bytes: 640
// https://atcoder.jp/contests/abc143/tasks/abc143_d

#include <bits/stdc++.h>
#pragma GCC optimize "Ofast"
#define watch(x) cout << (#x) << " is " << (x) << endl;
#define endl '\n'

using namespace std;

bool valid(int a, int b, int c) {
    return ((a < b+c) and (b < c+a) and (c < b+a));
}

int main() {
    #define int long long
    int N;
    cin >> N;

    int L[N];
    int s[N];

    for(int i = 0; i < N; i++) {
        cin >> L[i];
        s[i] = L[i];
    }

    sort(s, s+N);

    int ans = 0;
    for(int i = 0; i < N; i++) {
        for(int j = i+1; j < N; j++) {
        
            int l = j+1;
            int r = N-1;
            int ma = -1;

            while(l <= r) {
                int m = (l+r)/2;
                // watch(m)

                if(valid(s[i], s[j], s[m])) {
                    l = m+1;
                    ma = m;
                    // cout << "Hi" << endl;
                } else {
                    r = m-1;
                }
            }

            if(ma == -1) continue;
            else ans += ma-j;

            // cout << endl;
        }
    }


    cout << ans << endl;


    
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int t = in.nextInt();
        for (int i = 0; i < t; i++) {
            final long n = in.nextLong();
            final int a = in.nextInt();
            final int b = in.nextInt();
            final int c = in.nextInt();
            final int d = in.nextInt();
            in.nextLine();
            System.out.println(dfs(n, a, b, c, d));
        }
    }

    private static long dfs(long n, int a, int b, int c, int d) {
        final Set<Long> seen = new HashSet<>();
        final PriorityQueue<long[]> q = new PriorityQueue<>(Comparator.comparingLong(l -> l[1]));
        q.offer(new long[] { n, 0 });
        while (!q.isEmpty()) {
            final long[] curr = q.remove();
//            System.out.println(Arrays.toString(curr));
            if (curr[0] == 0) {
                return curr[1];
            }
            if (!seen.add(curr[0])) {
                continue;
            }
            q.offer(new long[] { curr[0] / 5, curr[1] + c + (d * (curr[0] % 5)) });
            q.offer(new long[] { (curr[0] / 5) + 1, curr[1] + c + (d * (5 - (curr[0] % 5))) });
            q.offer(new long[] { curr[0] / 3, curr[1] + b + (d * (curr[0] % 3)) });
            q.offer(new long[] { (curr[0] / 3) + 1, curr[1] + b + (d * (3 - (curr[0] % 3))) });
            q.offer(new long[] { curr[0] / 2, curr[1] + a + (d * (curr[0] % 2)) });
            q.offer(new long[] { (curr[0] / 2) + 1, curr[1] + a + (d * (2 - (curr[0] % 2))) });
            if (curr[0] <= Math.floorDiv(Long.MAX_VALUE, d) && curr[1] + curr[0] * d > 0) {
                q.offer(new long[] { 0, curr[1] + curr[0] * d });
            }
        }
        return -1;
    }
}


Measured memory_bytes: 53524
#include <iostream>
#include <algorithm>
using namespace std;
  
int n, m, c[25];
int solve[25][50050];
  
int dp(int k, int l) // k番目以前の硬貨からl円の支払いができる最小枚数
{
    if (l == 0) solve[k][l] = 0;
    
    else if (solve[k][l] >= 0) ;
    
    else if (l % c[k] == 0) solve[k][l] = l / c[k];
    
    else {
        if (l < c[k]) solve[k][l] = dp(k - 1, l);
        else solve[k][l] = min(dp(k - 1, l), 1 + dp(k, (l - c[k])));
    }
     
    return solve[k][l];
}
  
int main(void){
     
    cin >> n >> m;
    for (int i = 0; i < m; i++) cin >> c[i];
    sort(c, c + m);
     
    for (int i = 0; i <= 50000; i++) {
        for (int j = 0; j < m; j++) solve[j][i] = -1;
    }
     
    cout << dp(m - 1, n) << endl;
     
//    for (int j = 0; j < m; j++) cout << c[j] << " ";
//    cout << endl;
     
//    for (int i = 0; i <= n; i++) {
//        for (int j = 0; j < m; j++) cout << dp(j, i) << " ";
//        cout << endl;
//    }
  
}


Measured memory_bytes: 7088
#include <bits/stdc++.h>
using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define int long long
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<< ": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const int N = 200005;


const int mod = 1000000007;

int32_t main()
{


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

    	
    int n;
    cin >> n;
    vector<int> v(n);

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

    vector<int> suff(n);
    suff[n-1] = v[n-1];

    for(int i = n-2; i >= 0; i--)
    {
    	suff[i] = suff[i+1] + v[i];
    	suff[i] %= mod;
    }

   	int ans = 0;

   	for(int i = 0; i < n-1; i++)
   	{
   		ans += (v[i]%mod * suff[i+1]%mod)%mod;
   		ans %= mod;
   	}

   	ans %= mod;

   	cout << ans;




    return 0;
}


Measured memory_bytes: 6364
#include <bits/stdc++.h>
#include<chrono>
using namespace std;
using ll = long long;

int main() {
  int N;
  ll T;
  ll ans = 0;
  cin >> N >> T;
  vector<ll> t(N);
  for (int i = 0; i < N; i++) {
    cin >> t[i];
  }
  ans = 0;
  for (int i = 0; i < N-1; i++) {
    ans += min(T, t[i+1]-t[i]);
  }
  ans += T;
  cout << ans << endl;
}

      

Measured memory_bytes: 1792
import java.util.*;
public class Main {

    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int[] num = new int[3];
	String output = "NO";
	for(int i=0;i<=2;i++){
        num[i] = Integer.parseInt(sc.next());
    }
	if(num[0]==7&&num[1]==5&&num[2]==5||num[0]==5&&num[1]==7&&num[2]==5||num[0]==5&&num[1]==5&&num[2]==7){
	    output = "YES";
    }
	System.out.println(output);
    }
}


Measured memory_bytes: 21844
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    }
}

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

int main(){
  int N,D;
  cin >> N >> D;
  vector<int> X(N),Y(N);
  for(int i=0;i<N;i++) cin >> X[i] >> Y[i];
  
  two_sat T(N);
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      if(abs(X[i]-X[j])<D) T.add_clause(i,true,j,true);
      if(abs(X[i]-Y[j])<D) T.add_clause(i,true,j,false);
      if(abs(Y[i]-X[j])<D) T.add_clause(i,false,j,true);
      if(abs(Y[i]-Y[j])<D) T.add_clause(i,false,j,false);
    }
  }
  
  if(T.satisfiable()){
    cout << "Yes" << endl;
    vector<bool> V = T.answer();
    for(int i=0;i<N;i++){
      if(V[i]) cout << Y[i] << endl;
      else cout << X[i] << endl;
    }
  }
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3720
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()
#define pb push_back

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;
}
constexpr int mod = 1e9+7;
constexpr int inf = 3e18;


signed main(){
	int N;cin>>N;
	set<int>st;
	rep(i,N){
		int a;cin>>a;st.insert(a);
	}
	cout<<(len(st)==N?"YES":"NO")<<endl;
}


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

int main(void)
{
    int N;
    string S;
    cin >> N;
    cin >> S;

    int ans = 1;

    rep(i,N){
        if(i==0)
            continue;

        if(S[i] != S[i-1]){
            ans++;
        }
    }

    cout << ans;
    return (0);
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define sz(a) ((int)(a).size())
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define pii pair<int,int>
#define pdd pair<ld,ld> 
#define rep(i,a,b) for(int i=a; i<b; i++)
#define dec(i,a,b) for(int i=a; i>=b; i--)
#define ler freopen("inspection.in","r",stdin);freopen("inspection.out","w",stdout)
#define fastio ios::sync_with_stdio(0), cin.tie(0)
#define debug cout<<"!!?!!\n"
using namespace std;
#define PI 2*asin(1) 
#define EPS 1e-9
#define MOD 1000000007
#define MAXN 101002
#define INF 2e9

int cont[1000];

void decomp(int n){
	for(int i=2; i<=n && n>1; i++){
		while(n%i==0){
			cont[i]++;
			n/=i;
		}
	}
}

ll ans(){
	ll r=1;
	
	rep(i,0,1000){
		r*= (cont[i]+1);
		r%= MOD;
	}
	return r;
}

int main(){
	int n;
	cin >> n;
	
	rep(i,2,n+1) decomp(i);
	cout << ans() << endl;
}















Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
using ll = long long;
using ull = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()		// begin to end
#define rep(i, begin, end) for (ll i = begin; i < end; i++)					// repeat
#define repr(i, begin, end) for (ll i = begin - 1; end <= i; i--)		// repeat reverse

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << endl << msec << " msec " << endl;
}

#endif


bool Month(ll l, ll r)
{
	if (l == 48)
	{
		if (49 <= r && r <= 57)
			return true;
	}

	if (l == 49)
	{
		if (r == 48 || r == 49 || r == 50)
			return true;
	}

	return false;
}

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

	ll int0 = (int)s[0];	// 0=48 ~ 9=57
	ll int1 = (int)s[1];
	ll int2 = (int)s[2];
	ll int3 = (int)s[3];

	if (Month(int0, int1) && Month(int2, int3))
	{
		cout << "AMBIGUOUS";
		return 0;
	}

	if (Month(int0, int1))
	{
		cout << "MMYY";
		return 0;
	}

	if (Month(int2, int3))
	{
		cout << "YYMM";
		return 0;
	}

	cout << "NA";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main(){
    string s;
    cin >> s;
    long n = s.size();
    long sy = 0;
    long da = 0;
    long long ans = 0;
    int now = 0;
    if(s[0]=='<'){
        sy++;
        now++;
        ans++;
    }
    else{
        da++;
        now=0;
        ans++;
    } 
    for(int i = 1;i<n;i++){
        if(s[i]=='<'){
            if(da>0){
                ans-=(now*da);
                now=1;
                ans++;
                da=0;
                sy=1;
            }
            else{
                now++;
                ans+=now;
                sy++;
            }
        }
        else{
            if(da>0){
                if(now==0){
                    da++;
                    ans+=da;
                }
                else{
                    now--;
                    ans+=now;
                    da++;
                }
            }
            else{
                now--;
                ans+=now;
                da=1;
                sy=0;
            }
        }
        //cout << now << " " ;
    }
    if(s[n-1]=='>' && now >0) ans-=(now*da);
    cout << ans << endl;
}

Measured memory_bytes: 900
#include <iostream>
#include <vector>
#include <queue>
#define inf 1000000000

using namespace std;

int N;
int H[16], W[16];
int C[4][4];
bool rect[4][4][4][4];

const int V = 1 << 16;
vector<unsigned short> G[V];
int dist[V];

void bfs()
{
	queue<int> Q;
	
	for(int i = 0; i < V; i++) dist[i] = inf;
	dist[0] = 0;
	Q.push(0);
	
	int u;
	while(Q.size()){
		u = Q.front(); Q.pop();
		
		int next;
		for(int k = 0; k < 3; k++){
			for(int p = 0; p < 4; p++){
				for(int q = 0; q < 4; q++){
					for(int r = 0; r < 4; r++){
						for(int s = 0; s < 4; s++){
							if(!rect[p][q][r][s]) continue;
							next = u;
							for(int dx = p; dx <= q; dx++){
								for(int dy = r; dy <= s; dy++){
									if(C[dx][dy] == k) next |= (1 << (dy*4+dx));
									else next &= ~(1 << (dy*4+dx));
								}
							}
							if(dist[next] < inf) continue;
							dist[next] = dist[u] + 1;
							Q.push(next);
						}
					}
				}
			}
		}
	}
}

int main(void)
{
	cin >> N;
	
	int h, w;
	for(int i = 0; i < N; i++) cin >> H[i] >> W[i];
	
	for(int i = 0; i < 4; i++){
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 4; k++){
				for(int l = 0; l < 4; l++){
					rect[i][j][k][l] = false;
				}
			}
		}
	}
	
	for(int j = 0; j < N; j++){
		for(int x = 1 - W[j]; x < 4; x++){
			for(int y = 1 - H[j]; y < 4; y++){
				rect[max(x, 0)][min(x+W[j],4)-1][max(y, 0)][min(y+H[j],4)-1] = true;
			}
		}
	}
	
	char c;
	for(int y = 0; y < 4; y++){
		for(int x = 0; x < 4; x++){
			cin >> c;
			if(c == 'R') C[x][y] = 0;
			if(c == 'G') C[x][y] = 1;
			if(c == 'B') C[x][y] = 2;
		}
	}
	
	bfs();
	cout << dist[V-1] << endl;
	return 0;
}

Measured memory_bytes: 5040
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int frog(int pos);
int n,k;
int h[100005];
int memo[100005];
int main(){
  memset(memo,-1,sizeof(memo));
  cin>>n>>k;
  for(int i=0;i<n;i++){
    cin>>h[i];
  }
  cout<<frog(0)<<"\n";
  return 0;
}
int frog(int pos){
  if(pos==n-1)return 0;
  if(memo[pos]!=-1)return memo[pos];
  int mini=1000000000;
  for(int i=1;i<=k && pos+i<n;i++){
    mini=min(mini,frog(pos+i)+abs(h[pos]-h[pos+i]));
  }
  return memo[pos]=mini;
}


Measured memory_bytes: 5760
#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;
    cin >> n;
    ll d[n];
    for(int i = 0; i < n; i++){
        cin >> d[i];
    }
    ll sum = 0;
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            sum += d[i]*d[j];
        }
    }
    cout << sum << endl;
}



Measured memory_bytes: 256
#A,B,C=map(float,input().split())
#a,b,c=map(int,input().split())
N=int(input())
Lm=2
Ln=1
Lo=2
if N==0:
	print(2)
elif N==1:
	print(1)
else:
	for i in range(N-1):
		Lo=Lm+Ln
		Lm=Ln
		Ln=Lo
	print(Lo)


Measured memory_bytes: 2940
#include <iostream>
#include <queue>
#include <set>
#include <map>
using namespace std;

int par[100010];
int rnk[100010];

void init(int n) {
    for (int i = 0; i < n; i++) {
        par[i] = i;
        rnk[i] = 0;
    }
}

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

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

bool same(int x, int y) {
    return find(x) == find(y);
}

int main(void){
    int n, m, p[100010], x, y;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        cin >> p[i];
        p[i]--;
    }
    
    init(n);
    for (int i = 0; i < m; i++) {
        cin >> x >> y;
        x--;  y--;
        unite(x, y);
    }
    
    for (int i = 0; i < n; i++) find(i);
    
    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (find(p[i]) == find(i)) ans++;
    }
    
    cout << ans << endl;
    
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define ios; ios::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define mk make_pair
#define fi first
#define se second
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define ls(x) (x<<1)
#define rs(x) (ls(x)|1)
#define eps 1e-11
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef double db;
mt19937 rnd(random_device{}());
const int mod = 1e9 + 7;
const int N = 1e3 + 5;
const int M = 1e3 + 5;
inline ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; }
inline ll lcm(ll a,ll b){ return a*b/gcd(a,b); }
inline ll ksm(ll x,ll y){ ll res=1; while(y){if(y&1) res=res*x%mod;
x=x*x%mod; y>>=1;} return res; }
int n,m,k;

int main(){
    scanf("%d",&n);
    printf("%s\n",n>=30?"Yes":"No");
    return 0;
}
/*
1
14 12
*/
//
//                            _ooOoo_
//                           o8888888o
//                           88" . "88
//                           (| -_- |)
//                           O\  =  /O
//                        ____/`---'\____
//                      .'  \|     |//  `.
//                     /  \|||  :  |||//  \
//                    /  _||||| -:- |||||-  \
//                    |   | \  -  /// |   |
//                    | \_|  ''\---/''  |   |
//                    \  .-\__  `-`  ___/-. /
//                  ___`. .'  /--.--\  `. . __
//               ."" '<  `.___\_<|>_/___.'  >'"".
//              | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//              \  \ `-.   \_ __\ /__ _/   .-` /  /
//         ======`-.____`-.___\_____/___.-`____.-'======
//                            `=---='
//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//                     佛祖保佑      永无BUG


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

using namespace std;

using ll = long long;
using ld = long double;

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

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

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

  ll n, q;
  cin >> n >> q;

  string s;
  cin >> s;

  vector<P> area(q);
  rep(i, q) {
    cin >> area[i].first >> area[i].second;
  }

  vll memo(n);
  REP(i, n) {
    memo[i] = memo[i - 1];
    if (s[i - 1] == 'A' && s[i] == 'C') {
      memo[i] += 1;
    }
  }

  rep(i, q) {
    cout << memo[area[i].second - 1] - memo[area[i].first - 1] << endl;
  }

  return 0;
}


Measured memory_bytes: 3408
#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = 1e9 + 7;

void bfs(int s, vector<vector<int>> graph, vector<int> &dis){
    queue<int> que;
    vector<bool> closed(graph.size(), false);
    closed[s] = true;
    for(auto x : graph[s]){
        que.push(x);
        closed[x] = true;
    }
    int num = 1;
    while(!que.empty()){
        int z = que.size();
        REP(i, z){
            int x = que.front();
            que.pop();
            for(auto y : graph[x]){
                if(!closed[y]){
                    que.push(y);
                    closed[y] = true;
                }
            }
    
            dis[x] = num;
        }
        num++;
    }
}

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

    int n;
    cin >> n;
    vector<int> a(n-1), b(n-1);
    REP(i, n-1){
        cin >> a[i] >> b[i];
        a[i]--, b[i]--;
    }

    vector<vector<int>> graph(n);
    vector<int> dis1(n, 0), dis2(n, 0);
    REP(i, n-1) graph[a[i]].pb(b[i]), graph[b[i]].pb(a[i]);

    bfs(0, graph, dis1);
    bfs(n-1, graph, dis2);
    
    int fennec = 0;
    REP(i, n){
        fennec += (dis1[i] <= dis2[i] ? 1 : 0);
    }

    cout << (fennec > n-fennec ? "Fennec" : "Snuke") << endl;

}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 100000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define OUT(a) cout<<(a)<<endl
#define VECIN(type, c, n) vector<type> c(n);for(auto& i:c) cin>>i;

int main(){
	int n;
    cin>>n;
    vector<int> a(n);
    REP(i,n){
        cin>>a[i];
    }
    int ans=0;
    for(int i=0;i<n-2;i++){
        if((a[i]<a[i+1]&&a[i+1]<a[i+2])||(a[i]>a[i+1]&&a[i+1]>a[i+2])) ans++;
    }
    OUT(ans);
	return 0;
}

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

#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define tll tuple<ll, ll, ll>
#define all(c) c.begin(),c.end()

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
 
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;

//fill(score, score+202020, 0);
#define NN 202020

int main(){
  ll n, m;
  cin >> n >> m;
  ll a;
  ll A[n];
  ll B[n];
  for (int i=0;i<n;i++){
    cin >> a;
    A[i] = a;
    if (i == 0) B[i] = a%m;
    else B[i] = (B[i-1] + a)%m;
  }
  //for (int i=0;i<n;i++) cout << B[i] <<endl;
  map<ll, ll> mp;
  for (int i=0;i<n;i++){
    if (mp.count(B[i]) == 0) mp[B[i]] = 1;
    else mp[B[i]] += 1;
  }

  ll ans = 0;
  for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
    if (itr->first == 0){
      ans += itr->second;
      //cout << ", ans= " << ans << endl;
    }
    ans += itr->second * (itr->second - 1) /2;
    //cout << "key = " << itr->first << ", val = " << itr->second << ", ans= " << ans << endl;
  }

  cout << ans << endl;
}


Measured memory_bytes: 5760