akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"fmt"
	"io"
	"math/big"
	"os"
)

func main() {
	sc := NewScanner(os.Stdin)
	n := sc.Int()
	a := make([]int64, n)

	for i := range a {
		a[i] = sc.Int64()
		if a[i] == 0 {
			fmt.Println(0)
			return
		}
	}

	res := big.NewInt(1)
	max := big.NewInt(1000000000000000000)

	for _, v := range a {
		res = res.Mul(res, big.NewInt(v))
		if res.Cmp(max) == 1 {
			fmt.Println(-1)
			return
		}
	}

	fmt.Println(res)
}

// generated by https://github.com/murosan/gollect

type Scanner struct {
	r     io.Reader
	buf   []byte
	delim byte
	size, eof,
	start, end int
}

func NewScanner(r io.Reader) *Scanner { return NewScannerSize(r, 4096) }
func NewScannerSize(r io.Reader, size int) *Scanner {
	return &Scanner{
		r:     r,
		buf:   make([]byte, size),
		delim: ' ',
		size:  size, start: size, end: size,
	}
}

func (s *Scanner) Int() int     { return ParseInt(s.bytes()) }
func (s *Scanner) Int64() int64 { return ParseInt64(s.bytes()) }

func (s *Scanner) bytes() []byte { b, _ := s.next(); return b }
func (s *Scanner) next() (b []byte, size int) {
	for n := 0; ; {
		for i := s.end; i < s.size; i++ {
			if s.buf[i] == s.delim || s.buf[i] == '\n' || i == s.eof {
				b, size = s.buf[s.start:i], i-s.start
				s.start, s.end = i+1, i+1
				return
			}
		}
		s.end = s.size
		if n++; n == 2 {
			panic("lack of buffer size")
		}
		s.read()
	}
}
func (s *Scanner) read() {
	copy(s.buf, s.buf[s.start:s.end])
	s.end -= s.start
	s.start = 0
	n, _ := s.r.Read(s.buf[s.end:])
	s.eof = s.end + n
}

func ParseInt(b []byte) (n int) {
	var i int
	if b[0] == '-' {
		i++
	}
	for ; i < len(b); i++ {
		n *= 10
		n += int(b[i] - '0')
	}
	if b[0] == '-' {
		return -n
	}
	return
}

func ParseInt64(b []byte) (n int64) {
	var i int
	if b[0] == '-' {
		i++
	}
	for ; i < len(b); i++ {
		n *= 10
		n += int64(b[i] - '0')
	}
	if b[0] == '-' {
		return -n
	}
	return
}


Measured memory_bytes: 3448
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
#include <math.h>
using namespace std;

int main()
{
  string s;
  int res = 99999;

  cin >> s;

  for (int i = 0; i < s.size() - 2; i++)
  {
    int diff = abs(753 - stoi(s.substr(i, 3)));
    if (diff < res)
    {
      res = diff;
    }
  }

  cout << res << "\n";

  return 0;
}

Measured memory_bytes: 3624
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
	int N, count[4] = { 0, };
	char str[4];
	scanf("%d", &N);
	while (N--) {
		for (int i = 0; i < 4; i++)	str[i] = 0;
		scanf("%s", str);
		if (str[0] == 'A' && str[1]=='C')	count[0]++;
		else if (str[0] == 'W' && str[1] == 'A')	count[1]++;
		else if (str[0] == 'T' && str[1] == 'L' && str[2] == 'E')	count[2]++;
		else if (str[0] == 'R' && str[1] == 'E')	count[3]++;
	}
	printf("AC x %d\n", count[0]);
	printf("WA x %d\n", count[1]);
	printf("TLE x %d\n", count[2]);
	printf("RE x %d\n", count[3]);
}

Measured memory_bytes: 1704
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  
    cout<<setprecision(20);
  
    long long int N;
    cin >> N;
    vector<double> x(N);
    vector<double> y(N);
    
    for(int i=0;i<N;i++)
   { cin >> x[i]; cin >> y[i]; }
   
        vector<int> v(N);
    
    for(int i=0;i<N;i++)
    v[i] = i;
    
        double su = 0;
    long long int c = 0;
    do {
        c++;
        for(int i=0;i<N - 1;i++)
        {
            double dx = x[v[i + 1]] - x[v[i]];
            double dy = y[v[i + 1]] - y[v[i]];
            su += sqrt(dx * dx + dy * dy);
        }
    } while (next_permutation(v.begin() , v.end()));
    cout << su / c << endl;
    return 0;
}
#include <bits/stdc++.h>

Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
a.sort()
c=a[n-1]
if n==2:
  print(a[1],a[0])
  exit()
if c%2==0:
  p=c//2
  o=10**9
  for i in range(n):
    if abs(p-a[i])<=o:
      o=abs(p-a[i])
      ans=a[i]
else:
  p=c//2
  q=c//2+1
  o=10**9
  for i in range(n):
    if abs(p-a[i])<abs(q-a[i]):
      if abs(p-a[i])<o:
        o=abs(p-a[i])
        ans=a[i]
    else:
      if abs(q-a[i])<o:
        o=abs(q-a[i])
        ans=a[i]
print(c,ans)

Measured memory_bytes: 19964
N,M=gets.split.map(&:to_i)
scs=$<.read.split.map(&:to_i).each_slice(2)


a = N==1 ? 0 : 10**(N-1)
a.upto(10**N-1) do |i|
    is = i.to_s
    if scs.all? { |s,c| is[s-1] == c.to_s }
        puts is
        exit 0
    end
end

puts -1

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

int main(){
  string s, t;
  cin >> s >> t;
  int ans = 0;
  for(int i = 0; i < s.size(); i++){
    if(s.at(i) != t.at(i)){
      ans++;
    }
  }
  std::cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3852
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

int n,m,ans;
vi g[10],vis(10);

void dfs(int u,int c){
    if (c == n) {
        ans++;
        return ; 
    }
    for (auto &it: g[u]){
        if (!vis[it]){
            vis[it] = 1;
            dfs(it,c+1);
            vis[it] = 0;
        }
    }
}

signed main()
{
    cin >> n >> m;
    for (int i=0;i<m;i++){
        int a,b; cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    vis[1] = true;
    dfs(1,1);
    cout << ans << endl;
    return 0;
}


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

namespace ABC072C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split(' ').Select(b => int.Parse(b)).ToArray();
            
            Dictionary<int, int> dic = new Dictionary<int, int>();
            for (int i = 0; i < n; i++)
            {
                for (int j = -1; j < 2; j++)
                {
                    int val = a[i] + j;
                    if (!dic.ContainsKey(val))
                    {
                        dic.Add(val, 1);
                    }
                    else
                    {
                        dic[val]++;
                    }
                }
            }

            int ans = 0;
            foreach (KeyValuePair<int, int> kv in dic)
            {
                if (kv.Value > ans)
                {
                    ans = kv.Value;
                }
            }
            
            Console.WriteLine(ans);
        }
    }
}

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

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

int main(){
    ll N;
    cin >> N;

    vector<ll> A(N);
    FOR(i, 0, N){
        cin >> A[i];
    }
    
    ll Q;
    cin >> Q;

    while(Q--){
        ll v;
        cin >> v;

        if(binary_search(ALL(A), v)){
            p(1);
        }else{
            p(0);
        }
    }

    return 0;
}


Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner = new Scanner(System.in); 
		int a = Integer.parseInt(scanner.next());
		int b = Integer.parseInt(scanner.next());
		int c = Integer.parseInt(scanner.next());
		int d = Integer.parseInt(scanner.next());
		
		if(Math.abs(a-c)<=d){
			System.out.println("Yes");
		}else if(Math.abs(a-b)>d){
			System.out.println("No");
		}else if(Math.abs(b-c)>d){
			System.out.println("No");
		}else{
			System.out.println("Yes");
		}
		
	}

}


Measured memory_bytes: 20692
module CoordComp
  (* 座標の型 *)
  (Coord : sig
    type t
    val compare : t -> t -> int
  end) :
sig
  val compress :
    (* 座標のリスト *)
    Coord.t list ->
    (* 座標の数，圧縮する関数と解凍する関数を返す *)
    int * (Coord.t -> int) * (int -> Coord.t)
end = struct
  module IntMap = Map.Make (struct
    type t = int
    let compare = compare
  end)
  module CoordMap = Map.Make (Coord)

  let compress cs =
    let (n, comp, decomp) =
      List.fold_left (fun (n, comp, decomp) c ->
        if CoordMap.mem c comp then (n, comp, decomp)
        else (n + 1, CoordMap.add c n comp, IntMap.add n c decomp))
      (0, CoordMap.empty, IntMap.empty) cs in
    (n, (fun c -> CoordMap.find c comp), (fun n -> IntMap.find n decomp))
end

module WeightedDirectedGraph
  (Vertex : sig
    type t
    val compare : t -> t -> int
  end)
  (Weight : sig
    type t
    val zero : t
    val ( + ) : t -> t -> t
    val compare : t -> t -> int
  end) :
sig
  (* 配列版の実装 *)
  val raw_bellman_ford :
    (* 頂点数n *)
    int ->
    (* 辺のリスト *)
    (* 頂点は0からn-1までの整数でなくてはならない *)
    (int * int * Weight.t) list ->
    (* 始点 *)
    int ->
    (int -> [ `Weight of Weight.t | `Inf | `NegInf ])
 
  (* 座標圧縮により様々な型を使えるようにしたバージョン *)
  val bellman_ford :
    (* 辺のリスト *)
    (Vertex.t * Vertex.t * Weight.t) list ->
    (* 始点 *)
    Vertex.t ->
    (Vertex.t -> [ `Weight of Weight.t | `Inf | `NegInf ])
end =
struct
  module CC = CoordComp (Vertex)
 
  let raw_bellman_ford n es s =
    (* 距離を覚えるやつ *)
    (* Noneで無限を表す *)
    let d = Array.make n None in
    (* 経路に負閉路が含まれる頂点を覚えるやつ *)
    let neg = Array.make n false in
    d.(s) <- Some Weight.zero;
    for i = 0 to 2 * n - 1 do
      List.iter (fun (u, v, c) ->
        (* c は u から v への辺の重さ *)
        (* d.(v) <- min d.(v) (d.(u) + c) *)
        let open Weight in
        match d.(v), d.(u) with
        | _, None -> () (* d.(u) は無限大 *)
        (* d.(v) <= d.(u) + c *)
        | Some dv, Some du when compare dv (du + c) <= 0 -> ()
        | _, Some du ->
            d.(v) <- Some (du + c);
              (* n 回目以降に変更が起こった場合，v までの経路に負閉路が含まれている *)
              if n - 1 <= i then
                neg.(v) <- true) es
    done;
    fun v ->
      if neg.(v) then `NegInf
      else match d.(v) with None -> `Inf | Some d -> `Weight d
 
  let bellman_ford es s =
    let (n, comp, _) =
      CC.compress @@
        List.concat @@
          List.map (fun (u, v, _) -> [u; v]) es in
    let d =
      raw_bellman_ford n
        (List.map (fun (u, v, c) -> (comp u, comp v, c)) es) (comp s) in
    fun v -> try d (comp v) with Not_found -> `Inf
end
 
module Int = struct
  type t = int
  let zero = 0
  let ( + ) = ( + )
  let compare x y = compare y x
end
 
module G = WeightedDirectedGraph (Int) (Int)
 
let () = Scanf.scanf "%d %d\n" (fun n m ->
  let abcs = Array.init m (fun _ -> Scanf.scanf "%d %d %d\n" (fun a b c -> a - 1, b - 1, c)) in
  match G.bellman_ford (Array.to_list abcs) 0 (n - 1) with
  | `NegInf -> print_endline "inf"
  | `Weight c -> Printf.printf "%d\n" c)

Measured memory_bytes: 4864
package main

import "fmt"

func main() {
	var s string

	fmt.Scan(&s)

	if solve(s) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func solve(s string) bool {
	for i := 0; i < len(s); i += 2 {
		if s[i] == 'L' {
			return false
		}
	}

	for i := 1; i < len(s); i += 2 {
		if s[i] == 'R' {
			return false
		}
	}

	return true
}


Measured memory_bytes: 1780
ri=(raw_input()).split(" ")
n=int(ri[0])
x=int(ri[1])
a=(raw_input()).split(" ")
for i in range(n):
    a[i]=int(a[i])

#print(a)

eat=0

for i in range(n-1):
    #a[i]+a[i+1]
    musteat=a[i]+a[i+1]-x
    if musteat>0:
        if a[i+1]>=musteat:
            a[i+1]-=musteat
        else:
            a[i]-=musteat-a[i+1]
            a[i+1]=0
        eat+=musteat

#print(a)
print(eat)

Measured memory_bytes: 11468
H,W = map(int,input().split())

lis = []

for i in range(H):

    s = input()
    lis.append(s)

ans = "Yes"

for i in range(H):

    for j in range(W):

        if lis[i][j] == "#":

            flag = True

            if i != 0 and lis[i-1][j] == "#":
                flag = False

            if i != H-1 and lis[i+1][j] == "#":
                flag = False

            if j != 0 and lis[i][j-1] == "#":
                flag = False

            if j != W-1 and lis[i][j+1] == "#":
                flag = False


            if flag:
                ans = "No"
                break

print (ans)


Measured memory_bytes: 3064
#a,b = map(int,input().split())
#A = list(map(int,input().split()))
# S = str(input())
# if('L' in S[0::2] or 'R' in S[1::2]):
#     print('No')
# else:
#     print('Yes')
N =int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(N):
    for j in range(i+1, N):
        ans += d[i]*d[j]
print(ans)

Measured memory_bytes: 2940
#define _CRT_SECURE_NO_WARNINGS
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define range(i,a,b) for(int i=a; i<(int)(b); i++)
#define rep(i,b) range(i,0,b)

typedef int Capacity;
struct Edge {
    int src, dst;
    Capacity cap;
    Edge(int src_, int dst_, int cap_) :
        src(src_), dst(dst_), cap(cap_) { }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<int> Array;
typedef vector<Array> Matrix;

int const inf = 1e9;

typedef int Capacity;
struct FordFulkerson {
    typedef vector<vector<Capacity>> Matrix;
    int n, t;
    Capacity res;
    vector<bool> vis;
    Matrix cap, flow;
    vector<vector<int>> g;
    FordFulkerson(const Graph &graph = Graph())
        : n(graph.size()), res(0), cap(n, Array(n)), flow(n, Array(n)), g(n, vector<int>()){
        rep(i,n)rep(j,graph[i].size()){
            int u = graph[i][j].src, v = graph[i][j].dst; Capacity c = graph[i][j].cap;
            cap[u][v] += c; cap[v][u] += c; flow[v][u] += c;
        }
        rep(i,n)rep(j,n) if(cap[i][j]) g[i].push_back(j), g[j].push_back(i);
    }
    Capacity solve(const int s, const int t){
        this->t = t;
        Capacity f = -1;
        while(f) vis.assign(n,false), res += (f = augment(s,inf));
        return res;
    }
    Capacity augment(const int v, Capacity lim){
        vis[v] = true;
        if(v == t) return lim;
        for(const int &i : g[v]){
            if(vis[i] || flow[v][i] == cap[v][i]) continue;
            Capacity f = augment(i,min(lim,cap[v][i]-flow[v][i]));
            flow[v][i] += f; flow[i][v] -= f;
            if(f) return f;
        }
        return 0;
    }
};

int main(){
    int N,M;
    cin >> N >> M;
    Graph g(N);
    rep(i,M){
        int a,b,c;
        cin >> a >> b >> c;
        g[a].emplace_back(a,b,c);
    }
    cout << FordFulkerson(g).solve(0,N-1) << endl;
}

Measured memory_bytes: 1360
/*
 * ID: adityaa
 * LANG: C++
 */
#include <bits/stdc++.h>
using namespace std;

#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mem(x, y) memset(x, y, sizeof x);
#define fi first
#define se second
#define pb push_back
#define pii pair<int , int>
#define asdfg y1
#define int long long
#define double long double
#define endl '\n'
#define PI 3.14159265359

/*-----------------------------------------------------------------------*/

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

/*-----------------------------------------------------------------------*/

// check base cases n = 0 , n = 1
// max / min questions - check for binary search
const int maxn = (int) 1e4 + 4;
const double EPS = 1e-9;
const int INF = (int)1e18 + 18;
const int mod = (int) 1e9 + 7;
string in;
vector<int> K;
int n , D , dp[maxn][100][2];

int go(int index , int modD , int tight){
    if(dp[index][modD][tight] != -1){
        return dp[index][modD][tight];
    }
    if(index == 0){
        int cnt = 0;
        int up = (tight ? K[index] : 9);
        for(int i = 0; i <= up; i++){
            if(i % D == modD) cnt++;
        }
        return dp[index][modD][tight] = cnt;
    }
    int up = (tight ? K[index] : 9);
    int ret = 0;
    for(int i = 0; i <= up; i++){
        int new_tight = tight;
        if(tight == 1 && i < up) new_tight = 0;
        ret += go(index - 1 , (modD - i + i * D) % D , new_tight);
        ret %= mod;
    }
    return dp[index][modD][tight] = ret;
}

signed main() {
    
    fio;
    cin >> in >> D;
    reverse(in.begin(), in.end());
    n = in.length();
    for(int i = 0; i < n; i++){
        int dig = in[i] - '0';
        K.push_back(dig);
    }
    
    for(int i = 0; i < n; i++){
        for(int d = 0; d < D; d++){
            for(int j = 0; j < 2; j++){
                dp[i][d][j] = -1;
            }
        }
    }
    
    int ans = go(n - 1 , 0 , 1);
    cout << (ans - 1 + mod) % mod << endl;
    
    
    
    return 0;
    
}


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

int main(){
    int m,f,r;
    while(true){
        cin >> m >> f >> r;
        if(m==-1&&f==-1&&r==-1)break;
        if(m==-1||f==-1)puts("F");
        else if(m+f>=80)puts("A");
        else if(m+f>=65)puts("B");
        else if(m+f>=50)puts("C");
        else if(m+f>=30&&r>=50)puts("C");
        else if(m+f>=30)puts("D");
        else puts("F");
    }
}


Measured memory_bytes: 3024
#include <iostream>
#include <algorithm>
using namespace std;
 
void maxHeapify(int A[], int n, int i)
{
    int l=2*i, r=2*i+1;
    int largest=i;
    if(l<=n&&A[largest]<A[l]) largest=l;
    if(r<=n&&A[largest]<A[r]) largest=r;
    if(i!=largest) {
        swap(A[i], A[largest]);
        maxHeapify(A, n, largest);
    }
}
 
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int h[500001];
    int n;
    cin>>n;
    for(int i=1; i<=n; i++) cin>>h[i];
    for(int i=n/2; i>=1; i--) maxHeapify(h, n, i);
    for(int i=1; i<=n; i++) cout<<' '<<h[i];
    cout<<'\n';
    return 0;
}

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

struct Point { double x, y; };

void koch(int n, Point a, Point b) {
  if (n == 0) return;

  Point s, t, u;
  double th = M_PI * 60.0 / 180.0;

  s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
  s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
  t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
  t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
  u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
  u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

  koch(n - 1, a, s);
  printf("%.8f %.8f\n", s.x, s.y);
  koch(n - 1, s, u);
  printf("%.8f %.8f\n", u.x, u.y);
  koch(n - 1, u, t);
  printf("%.8f %.8f\n", t.x, t.y);
  koch(n - 1, t, b);
}

int main() {
  Point a, b;
  int n;

  scanf("%d", &n);

  a.x = 0;
  a.y = 0;
  b.x = 100;
  b.y = 0;

  printf("%.8f %.8f\n", a.x, a.y);
  koch(n, a, b);
  printf("%.8f %.8f\n", b.x, b.y);

  return 0;
}


Measured memory_bytes: 2744
fun main(args: Array<String>) {
    var S = readString()
    println(
        when (S) {
            "SUN" -> 7
            "MON" -> 6
            "TUE" -> 5
            "WED" -> 4
            "THU" -> 3
            "FRI" -> 2
            "SAT" -> 1
            else  -> 0
        }
    )

}

fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

fun Int.pow(n: Int) = Math.pow(this.toDouble(), n.toDouble())

Measured memory_bytes: 31768
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for(int i=0; i<(a); i++)
typedef long long ll;
template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////

const ll inf = 1LL<<60;

int main()
{
  string t; cin >> t;
  for (auto c:t) {
    if (c == '?') c = 'D';
    cout << c;
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 3748
#include<iostream>
#include<cstdio>
#include<map>
#include<math.h>
#include<queue>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=1e6+7;
ll a[maxn],sum,mi=1e10,n;
int main (){
    cin>>n;
    for(int i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    sort(a,a+n);
    reverse(a,a+n);
    for(int i=0;i<n/2;i++){
        sum+=a[i];
    }
    for(int i=1;i<=(n-1)/2;i++){
        sum+=a[i];
    }
    printf ("%lld\n",sum);



}





Measured memory_bytes: 4784
#include <iostream>

using namespace std;

int main() {
    string s;
    cin>>s;
        if(s[0]==s[1] && s[1] == s[2]) {cout<<"Yes"; return 0;}
        else if ( s[1] == s[2] && s[2]==s[3]){cout<<"Yes"; return 0;}
        cout<<"No";
}


Measured memory_bytes: 256
// Heap i
#include <stdio.h>
#include <stdlib.h>

typedef struct node {
  int key;
  struct node* parent;
  struct node* left;
  struct node* right;
} node_p;

void heapSort();

int main() {
  int i;
  int n;
  node_p *node;
  node_p *z;

  // input
  scanf("%d", &n);

  // memory allocate
  node = (node_p*)malloc((n+1) * sizeof(node_p));

  // input the key of node
  for(i = 1; i <= n; i++) {
    scanf("%d", &node[i].key);
    if(i == 1) {
      node[i].parent = NULL;
    }
    else {
      if(i % 2 == 0) node[i/2].left = &node[i];
      else node[i/2].right = &node[i];
      node[i].parent = &node[i/2];
    }
    node[i].left = NULL;
    node[i].right = NULL;
  }

  // output
  for(i = 1; i <= n; i++) {
    printf("node %d: ", i);
    printf("key = %d, ", node[i].key);
    if(node[i].parent != NULL) printf("parent key = %d, ", node[i].parent->key);
    if(node[i].left != NULL) printf("left key = %d, ", node[i].left->key);
    if(node[i].right != NULL) printf("right key = %d, ", node[i].right->key);
    printf("\n");
  }
  

  return 0;
}




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

class Program
{
    static void Main(string[] args)
    {

        var n = int.Parse(Console.ReadLine());
        String[] s = new String[n];
        for (int i = 0; i < n; i++)
        {
            s[i] = Console.ReadLine();
        }

        Array.Sort(s);
        var disS = s.Distinct();
        var counts = new Dictionary<string, int>();
        var count = 0;
        foreach (var item in disS)
        {
            var tmp = 0;
            for (int i = count; i < s.Length; i++)
            {

                if (s[i].Equals(item))
                {
                    tmp++;
                }
                else
                {
                    count = i;
                    break;
                }
            }

            counts.Add(item, tmp);
        }

        var max = counts.Values.Max();
        var maxCounts = counts.Where(i => i.Value == max);

        foreach (var item in maxCounts)
        {
            Console.WriteLine(item.Key);
        }

    }
}

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

const ll mod = 1000000007;


int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	string s, t; cin >> s >> t;
	cout << t + s << endl;
	
} 

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

using namespace std;

#define REP(i, n)   for(int i = 0; i < (n); i++)
#define REPS(i, n)  for(int i = 1; i <= (n); i++)
#define RREP(i, n)  for(int i = (n)-1; i >= 0; i--)
#define RREPS(i, n) for(int i = (n); i > 0; i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

using ll  = long long;
using pi  = pair<int, int>;
using pl  = pair<ll, ll>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vs  = vector<string>;
using vb  = vector<bool>;
using vvi = vector<vi>;
using vvl = vector<vl>;

const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int INF = 1e9 + 7;
const ll  INFL = 1e18;
const double PI = 3.141592653589793;
const double EPS = 1e-9;

template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false; }

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

    ll N; cin >> N;
    vl A(N); REP(i, N) cin >> A[i];
    sort(RALL(A));
    ll a = 0, b = 0; 
    REP(i, N-1)
    {
        if(A[i] == A[i+1] && a == 0) a = A[i], i++;
        else if(A[i] == A[i+1] && a != 0) 
        {
            b = A[i];
            break;
        }
    }
    cout << a * b << endl;
}


Measured memory_bytes: 3964
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<map>
#include<iomanip>
#include<tuple>
#include<bitset>


using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define printfloat(x) cout << fixed << setprecision(7) << (x) << endl;
#define printbit(x) cout << bitset<15>(x) << endl;
using ll = long long int;



long double pi = 3.14159265359;

int n;
long long int a[200000];
int ans;
long long int sum;
int main(){
    cin >> n ;
    rep(i,n){
        cin >> a[i];
    }
    ans = a[0];
    rep(i,n){
        if(a[i] >= ans){
            ans = a[i];
        }
        else{
            sum += ans - a[i];
        }
    }
    cout << sum << endl;

return 0;
}

Measured memory_bytes: 5152
X,Y = map(int,input().split())
mod = 10**9+7
N = (X+Y)//3
M = (N+X-Y)//2

if (X+Y)%3!=0 or M<0 or N<M:
  print(0)
else:
  ans = 1
  for m in range(1,M+1):
    ans*=(N-M+m)*pow(m,mod-2,mod)
    ans%=mod
  print(ans)

Measured memory_bytes: 9204
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(int i = 0; i < x; i++)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll n; cin >> n;
    vector<Pll> lr(n);
    // ll min_r, max_l;
    rep(i,n){
        ll l,r;
        cin >> l >> r;
        lr[i] = Pll(l,r);
    }
    auto comp = [](auto const a, auto const b){
        return a.first < b.first || (a.first == b.first && a.second > b.second);
    };
    // sort(lr.begin(), lr.end(),comp);
    sort(lr.begin(), lr.end());

    vector<Pll> down(n), up(n);

    down[0] = lr[0];
    rep(i,n){
        if(!i)continue;
        ll l, r;
        l = max(lr[i].first, down[i-1].first);
        r = min(lr[i].second, down[i-1].second);
        down[i] = Pll(l,r);
    }

    up[n-1] = lr[n-1];
    for(int i = n-2; 0 <= i; --i){
        ll l,r;
        l = max(lr[i].first, up[i+1].first);
        r = min(lr[i].second, up[i+1].second);
        up[i] = Pll(l,r);
    }

    auto cal = [](ll a, ll b){
        if(a <= b)return b-a+1;
        else return ll(0);
    };
    ll ans = 0;
    rep(i,n-1){
        ll temp = 0;
        temp += cal(down[i].first, down[i].second);
        temp += cal(up[i+1].first, up[i+1].second);
        ans = max(ans, temp);
    }
    // 一つだけ別
    rep(i,n){
        if(i == 0 || i == n-1)continue;
        ll temp = 0;
        ll l,r;
        l = max(down[i-1].first, up[i+1].first);
        r = min(down[i-1].second, up[i+1].second);
        temp += cal(l,r);
        temp += cal(lr[i].first, lr[i].second);
        ans = max(ans, temp);
    }

    
   
    cout << ans << endl;
}

Measured memory_bytes: 4992
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<utility>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

typedef long long ll;
const int mod=1e9+7;

int cal(int a, int b, int c, int k){
	if(!k)
		return a+b+c;
	int na = cal(a*2,b,c,k-1);
	int nb = cal(a,b*2,c,k-1);
	int nc = cal(a,b,c*2,k-1);
	return max({na,nb,nc});
}

int main(){
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	cout << cal(a,b,c,k) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
	std::string a, b;
	getline(std::cin, a);
	getline(std::cin, b);
	int res = 0;
	for (int i=0; i<a.length(); i++) {
		if (a[i] != b[i]) res++;
	}
	std::cout << res << std::endl;
	return 0;
}

Measured memory_bytes: 3820
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

  char s[4];
  cin >> s;
  sort(s, s+4);
  if(s[0]==s[1] && s[1]!=s[2] && s[2]==s[3]){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

	return 0;
}

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

using namespace std;
typedef long long int lli;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef pair <lli,lli> pii;
#define all(vec) vec.begin(),vec.end()
#define ff first
#define ss second
#define inf 4e18
#define MOD 1000000007
#define pb push_back
#define for1(low,high,k) for(int i=low;i<high;i+=k)
#define for2(low,high,k) for(int j=low;j<high;j+=k)
#define rev(high,low,k) for(int i=high;i>=low;i-=k) 

int main(){
	fast;
	vector <string> vec(10);
	for (int i=0;i<10;i++){
		if (i==2 || i==4 || i==5 || i==7 || i==9) vec[i]="hon";
		else if (i==3) vec[i]="bon";
		else vec[i]="pon";
	}
	lli n;
	cin>>n;
	cout<<vec[n%10]<<endl;
}

Measured memory_bytes: 3632
import java.util.*;
import java.io.*;

public class Main {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer stok;

    String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    char nextChar() throws IOException {
        return (char) (br.read());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        double[] p = new double[1000];
        long[] time = new long[1000];
        p[0] = 1.0 / (1 << m);
        time[0] = 100 * (n - m) + 1900 * m;
        double sump = p[0];
        double ans = time[0] * p[0];
        for (int i = 1; i < 1000; i++)
        {
            time[i] = time[i - 1] + 100 * (n - m) + 1900 * m;
            p[i] = (1.0 - sump) / (1 << m);
            sump += p[i];
            ans += time[i] * p[i];
        }
        long anss = (long) Math.round(ans);
        if (anss % 10 == 1) anss--;
        if (anss % 10 == 9) anss++;


        out.println(anss);

    }

    void run() throws IOException {
        // br = new BufferedReader(new FileReader("dragons.in"));
        //out = new PrintWriter("dragons.out");
        // br = new BufferedReader(new FileReader("input.txt"));
        // out = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        br.close();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        // Locale.setDefault(Locale.US);
        new Main().run();
    }
}

Measured memory_bytes: 21204
import java.util.*;
public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int data[] = new int[3];

    for (int i = 0 ; i < 3 ; i++ ) {
      data[i] = sc.nextInt();
    }

    Arrays.sort(data);

    int n = data[2] * 10 + data[1];

    System.out.println(n + data[0]);
  }
}


Measured memory_bytes: 23252
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF INT_MAX
#define LLINF LLONG_MAX
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007
#define MODB  998244353 

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

//つねに10億7などの剰余をとる構造体
//参考: https://www.youtube.com/watch?v=L8grWxBlIZ4&t=9858
//参考: https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#4-%E7%B4%AF%E4%B9%97-an
int mod  = MODA;
struct modint {
	ll x;
	modint (ll x):x(x%mod){}
	modint& operator+=(const modint a){
		(x += a.x ) %= mod;
		return *this;
	}
	modint& operator-=(const modint a){
		(x -= a.x ) %= mod;
		if (x < 0) x += mod;
		return *this;
	}
	modint& operator*=(const modint a){
		(x *= a.x ) %= mod;
		return *this;
	}
	modint& operator/=(modint a){ //除算のみO(log mod)なので注意。割る数が小さいならnCrのinvを使うこと
		ll exp = mod - 2;
		while(exp > 0){ 
			if(exp & 1) *this *= a.x;
			a *= a.x;
			exp >>= 1;
		}
		return *this;
	}
	modint operator+(const modint a) const{
		modint res(*this);
		return res+=a;
	}
	modint operator-(const modint a) const{
		modint res(*this);
		return res-=a;
	}
	modint operator*(const modint a) const{
		modint res(*this);
		return res*=a;
	}
	modint operator/(const modint a) const{
		modint res(*this);
		return res/=a;
	}
};
modint modpow(modint x, ll n){
	modint res=1;
	while(n > 0){
		if(n & 1) res = res * x.x;
		x = x * x;
		n >>= 1;
	}
	return res;
}


int main() {
	//modint ans = 0;
	ll tmp;
	int n; cin >> n;
	modint ans = modpow(10, n);
	ans -= modpow(9, n);
	ans -= modpow(9, n);
	ans += modpow(8, n);
	cout << ans.x << endl;
}

Measured memory_bytes: 3636
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define _GLIBCXX_DEBUG
int INF = 1e9+7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
unsigned day;
if(dow < dow1) dow += 7;
day = dow - dow1;
day += 7 * n - 6;
return day;
}
unsigned DayToWeekNumber(unsigned day)
{
  return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
  return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main(){
  int A,B; cin>>A>>B;
  rep(i,10000){
    if(i*2/25==A&&i/10==B){
      cout<<i<<endl;
        return 0;
    }
  }
  cout<<-1<<endl;
}

Measured memory_bytes: 3620
using System;

namespace workspace{
  public class Program{
    static void Main(){
      //入力値受け取り
      String[] data = Console.ReadLine().Split(' ');
      var X = long.Parse(data[0]); //座標
      var K = long.Parse(data[1]); //移動回数
      var D = long.Parse(data[2]); //移動距離

      X = Math.Abs(X);

      //最小値比較
      var straight = Math.Min(K, X /D);
      K -= straight;
      X -= straight * D;

      if(K % 2 == 0){
        Console.WriteLine(X);
      }else{
        Console.WriteLine(D-X);
      }
    }
  }
}

Measured memory_bytes: 27436
r, c = map(int, input().split())

ss = []

for i in range(r):
    row = list(map(int, input().split()))
    row.append(sum(row))
    ss.append(row)

sum_row = []

for i in range(c+1):
    temp = 0
    for j in ss:
        temp += j[i]
    
    sum_row.append(temp)

ss.append(sum_row)

for s in ss:
    print(*s)


Measured memory_bytes: 6232
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;  
#define pb push_back
#define F first
#define S second
#define ppp pair<ll,pair<ll,ll>>
#define pp pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define pi 3.14159265358
#define MOD 998244353

ll oc[200005];

int main()
{

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout); 
    // freopen("error.txt", "w", stderr); 
    // #endif
    
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);

     ll n,i,j,k,q,x,y;


     cin>>n;

     ll sm=0;
     for(i=0;i<n;i++)
     {
        cin>>x;
        oc[x]++;
        sm+=x;
     }

     cin>>q;
     while(q--)
     {
        cin>>x>>y;

        ll ocr=oc[x];
        sm+=y*ocr-x*ocr;
        cout<<sm<<endl;
        oc[x]=0;
        oc[y]+=ocr;
     }
      

}



Measured memory_bytes: 4392
import * as fs from 'fs';

function Picker(input) {
  var lines = input.split('\n');
  var fields = lines.reduce(function(all, line) { return all.concat(line.split(' ')); }, []);
  var p = 0;

  return {
    int: function() {
      return parseInt(fields[p++], 10);
    },
    float: function() {
      return parseFloat(fields[p++]);
    },
    str: function() {
      return fields[p++];
    }
  };
}

const input = fs.readFileSync("/dev/stdin", "utf8");
const pick = Picker(input);

//////////////////////////////////////////

var a = pick.int();
var b = pick.int();
var t = pick.int();

console.log(Math.floor(t / a) * b);

Measured memory_bytes: 9420
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int N, x; cin >> N >> x;
	if (x < 2 || (2 * N - 2) < x) {
		cout << "No" << endl;
		return 0;
	}
	int ans[N * 2 - 1];
	int S = 1;
	int tmp;
	rep(i, N * 2 - 1) {
		// cout << N  - 1 + (i + 1) / 2 * S << endl
		if (x == 2) tmp = i + 1;
		else tmp = (x - i + (2 * N - 1)) % (2 * N - 1) + 1;
		ans[N - 1 + (i + 1) / 2 * S] = tmp;
		S = -S;
	}
	cout << "Yes" << endl;
	rep(i, N * 2 - 1) {
		cout << ans[i] << endl;
	}


    return 0;
}


Measured memory_bytes: 2304
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<complex>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define INF (1<<29)
#define LINF (1LL<<60)
#define EPS (1e-10)
#define PI 3.1415926535897932384626433832795028
typedef long long Int;
typedef pair<Int, Int> P;
typedef long double Real;
typedef complex<Real> CP;

int main(){
    int a, b;
    cin >> a >> b;
    cout << a*b << endl;
    
    return 0;
}


Measured memory_bytes: 3220
N,L = map(int,input().split())
A = list(map(int,input().split()))
A.insert(0,0)
flag = 0
for i in range(1,N):
    if A[i]+A[i+1]>=L:
        flag = i
        break
if flag == 0:
    print("Impossible")
else:
    print("Possible")
    if flag==1:
        for i in range(N-1,0,-1):
            print(i)
    else:
        for i in range(1,flag):
            print(i)
        for i in range(N-1,flag-1,-1):
            print(i)

Measured memory_bytes: 63984
/*
 *        ~Botay~
 *    code by kazalika
 */

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef long double ldb;
typedef double db;
typedef vector<int> vint;
typedef vector<ll> vll;
#define forn(a, i, n) for (int i = (a); i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) int(x.size())
const int N = 3e6 + 6;



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

  ll a; ldb b;
  cin >> a >> b;
  cout << ll(a * b);

}

Measured memory_bytes: 3748
N = int(input())
T = [[] for i in range(N)]
for i in range(N - 1):
  [a, b, c] = [int(x) for x in input().split()]
  T[a-1].append((b-1, c))
  T[b-1].append((a-1, c))
[Q, K] = [int(x) for x in input().split()]
L = [[0, 0] for i in range(N)]
L[K-1] = [0, 1]
q = [K-1]
while(q):
  s = q.pop()
  for t in T[s]:
    if not L[t[0]][1]:
      L[t[0]][0] = L[s][0] + t[1]
      L[t[0]][1] = 1
      q.append(t[0])
for q in range(Q):
  [x, y] = [int(x) for x in input().split()]
  print(L[x-1][0] + L[y-1][0])

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

int main()
{
	int N, M;
	cin >> N >> M;
	int count[30] = { 0 };

	for( int i = 0; i < N; ++i )
	{
		int j;
		cin >> j;
		for( j; 0 < j; --j )
		{
			int k;
			cin >> k;
			count[k-1]++;
		}
	}

	int sum = 0;
	for( int i = 0; i < M; ++i )
	{
		if( count[i] == N )
			sum++;
	}

	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		System.out.println(new Main().doWork(args));
	}

	public String doWork(String[] args) {
		Scanner reader = new Scanner(System.in);

		int n = reader.nextInt();
		int k = reader.nextInt();
		String ch = reader.next();

		reader.close();

		return ch.substring(0, k-1) + ch.substring(k-1, k+1-1).toLowerCase() + ch.substring(k+1-1);
	}
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
const ll INF =1001001001;

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}

//素数判定
ll isprime(ll n){
  bool prime=true;
  for(int i=2;i<n;i++){
    if(n%i==0){
      prime=false; break;
    }
  }
if(prime){cout<<n<<" is prime"<<endl;
         }else{cout<<n<<" is not prime"<<endl;}

}
//階乗　20くらいが限界
ll factorial(ll n){
  ll a=1;ll b=n;
  for(int i=0;i<n;i++){
    a*=b;
    b--;
  }
  return a;
}

//組み合わせ　nCr
ll comb(ll a,ll b){
  ll c;
  c=factorial(a)/(factorial(a-b)*factorial(b));
  return c; 
}




/*10億7。　　　100000007
2*2行列 H*W
vector<vector<int>> vec(H,vector<int>(W));
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
cin>>vec[i][j];
  }
}

文字列→数列
string S;int A=atoi(S.c_str());
数列→文字列
int A;string S=to_string(A);
数字判定　isdigit(a)
pair宣言　pair<int,int> p(5,7);
ソート　sort(vec.begin(),vec.end());
*/

int main(){
cout<<fixed<<setprecision(10);


       ll N,A,B;
  cin>>N>>A>>B;
  if(A+B==0){
    cout<<0<<endl;
    return 0;
  }
  ll Q=N/(A+B);
  ll W=N-Q*(A+B);
  ll  ans=A*Q;
  if(W>=A){
    ans+=A;
  }else{
    ans+=W;}
  
  cout<<ans<<endl;
}




Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int add,sub,mal;
    int A,B,max = -2000;

    scanf("%d %d",&A,&B);
    add = A + B;
         if(add > max)
         max = add;
    sub = A - B;
        if(sub > max)
         max = sub;
    mal = A * B;
        if(mal > max)
        max = mal;

printf("%d",max);

    return 0;
}

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

int main(){
    int N;
    cin >> N;
    int s1,s2,s3,s4;
    s1 = N /1000;
    s2 = (N - s1*1000 )/100;
    s3 = (N - s1*1000 - s2*100)/10;
    s4 = N - s1*1000 - s2*100 - s3*10;
    if (s1 == s2 && s2 == s3){
        cout << "Yes" << endl;
    
    }
    else if (s2 == s3 && s3 == s4){
        cout << "Yes" << endl;
    }
    else if (s1 == s2 && s2== s3 && s3 == s4){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

//gcd,lcm,べき,二進展開
//組み合わせ、mod計算
//最短路問題、bit、union find

///////////////////////////

template< typename T >
void wf(T(&g)[1000][1000], T N) {
	repn(k, N) {
		repn(i, N) {
			repn(j, N) {
				g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
			}
		}
	}
}



int main() {

	ll H, W;
	cin >> H >> W;
	char S[30][30];
	repn(i, H)repn(j, W) cin >> S[i][j];

	ll g[1000][1000];//(i,j)には(i-1)*W+j

	repn(i, H*W)repn(j, H*W) { g[i][j] = INF; }

	repn(i, H)repn(j, W) { if (S[i][j] == '.') { g[(i - 1)*W + j][(i - 1)*W + j] = 0; } }

	repn(i, H - 1)repn(j, W) {
		if (S[i][j] == '.'&&S[i + 1][j] == '.') {
			g[(i - 1)*W + j][i*W + j] = 1; g[i*W + j][(i - 1)*W + j] = 1;
		}
	}

	repn(i, H)repn(j, W - 1) {
		if (S[i][j] == '.'&&S[i][j + 1] == '.') {
			g[(i - 1)*W + j][(i - 1)*W + j + 1] = 1; g[(i - 1)*W + j + 1][(i - 1)*W + j] = 1;
		}
	}

	wf(g, H*W);

	ll ans = 0;

	repn(i, H*W)repn(j, H*W) {
		if (g[i][j] != INF) { ans = max(ans, g[i][j]); }
	}

	cout << ans;


	system("PAUSE");


}


Measured memory_bytes: 5504
#include <cstdio>
using namespace std;
int main(){
    long long n, k, s;
    scanf("%lld%lld%lld", &n, &k, &s);
    for(int i = 0; i < k; i ++){
        printf("%lld ", s);
    }
    if(s == 1000000000){
        s -= 2;
    }
    for(int i = 0; i < n - k; i ++){
        printf("%lld ", s + 1);
    }
    printf("\n");
    return 0;
}


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

int main() {
	int e, y; cin >> e >> y;
	if (e == 0) {
		if (1911 >= y) cout << "M" << y - 1867 << endl;
		else if (1925 >= y) cout << "T" << y - 1911 << endl;
		else if (1988 >= y) cout << "S" << y - 1925 << endl;
		else cout << "H" << y - 1988 << endl;
	}
	else if (e == 1) cout << 1867 + y << endl;
	else if (e == 2) cout << 1911 + y << endl;
	else if (e == 3) cout << 1925 + y << endl;
	else cout << 1988 + y << endl;
	return 0;
}


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

int main() {
    string S;
    cin >> S;
    int count = 0;
    for(int i = 1; i < S.size(); i++) {
        if(S[i] != S[i-1]) {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 512