Vanya and his friends are walking along the fence of height h and they do not want the guard to notice them. In order to achieve this the height of each of the friends should not exceed h. If the height of some person is greater than h he can bend down and then he surely won't be noticed by the guard. The height of the i-th person is equal to ai.Consider the width of the person walking as usual to be equal to 1, while the width of the bent person is equal to 2. Friends want to talk to each other while walking, so they would like to walk in a single row. What is the minimum width of the road, such that friends can walk in a row and remain unattended by the guard?

The first line of the input contains two integers n and h (1 ≤ n ≤ 1000, 1 ≤ h ≤ 1000) — the number of friends and the height of the fence, respectively. The second line contains n integers ai (1 ≤ ai ≤ 2h), the i-th of them is equal to the height of the i-th person.

Print a single integer — the minimum possible valid width of the road.

NoteIn the first sample, only person number 3 must bend down, so the required width is equal to 1 + 1 + 2 = 4.In the second sample, all friends are short enough and no one has to bend, so the width 1 + 1 + 1 + 1 + 1 + 1 = 6 is enough.In the third sample, all the persons have to bend, except the last one. The required minimum width of the road is equal to 2 + 2 + 2 + 2 + 2 + 1 = 11.

var x = readline().split(" ");
var rost = readline().split(" ");
var res = 0;
	for (var i=0; i<x[0]; i++){
		rost[i]>+x[1]? res=+res+2:res++
	}
print(res);

var sol = function(arr1, arr2){
    number = arr2.length;
    for(var i=0; i<arr1[0]; i++){
        if(arr2[i] > arr1[1]){
            number ++;
        }
    }
    print(number);
}

var numbers1 = readline().split(" ").map(function(x) { return parseInt(x); });
var numbers2 = readline().split(" ").map(function(x) { return parseInt(x); });

sol(numbers1, numbers2);

var input = readline().split(' ').map(Number);
var numberOfFriends = input[0];
var fenceHight = input[1];

var friends = readline().split(' ').map(Number);
var roadWidth = 0;

for(var i = 0; i < friends.length; i++){
    if(friends[i] > fenceHight){
        roadWidth += 2;
    }
    else {
        roadWidth ++;
    }
}
print(roadWidth);

var h = readline().split(" ").map(function(x) { return parseInt(x); })[1];
var a = readline().split(" ").map(function(x) { return parseInt(x); });
var w = 0;
for (var i = 0; i < a.length; i++) {
 w+=(a[i] > h) ? 2 : 1;
}
print (w);

var n_H= readline().split(' ');
var a=readline().split(' ');
var width=0;
n_H[1]=parseInt(n_H[1]);
for(i=0;i<parseInt(n_H[0]);i++){
 a[i]= parseInt(a[i]);
 if(a[i]>n_H[1])
  width+=2;
  else
  width+=1;

}

print(width);

var nh = readline().split(" ");
  var a = readline().split(" ");
  var width = 0;
  for(var i = 0; i < Number(nh[0]); i++)
  {
   if(a[i] > Number(nh[1]))
   {
     width += 2;
   }
   else
   {
     width += 1;
   }
  }
  print(width);

var inp = readline().split(' ').map(el => parseInt(el, 10));
var width = 0;
var a = readline().split(' ').forEach(el => {
    el = parseInt(el, 10);
    if(el>inp[1]) width+=2;
    else width++;
});

print(width);

var line1 = readline().split(' ');
var n = parseInt(line1[0]);
var h = parseInt(line1[1]);
var numbers = readline().split(' ');
for (var i = 0; i < numbers.length; ++i)
	numbers[i] = parseInt(numbers[i]);

result = 0;

for (var i = 0; i < numbers.length; ++i)
	result += numbers[i] <= h ? 1 : 2;

print(result);

var x= readline().split(' ');
var n = x[0];
var h = x[1];
var a = readline().split(" ").map(Number);
var s = 0;
for(var i = 0; i<n; ++i){
    s++;
    if(a[i]>h){
        s++;
    }
}
write(s);

"use strict";

var input = readline().split(' ').map(value => +value);
var n = input[0];
var h = input[1];
var a = readline().split(' ').map(value => +value);

write(a.map(a => a <= h ? 1 : 2).reduce((a, b) => a + b));

X=readline().split(' ').map(Number)
n=X[0],h=X[1]
X=readline().split(' ').map(Number)
print(X.reduce((a,c) => a + (c<=h ? 1 : 2), 0))

// var _i = 0;
//
// function readline() {
//     _i ++;
//
//     switch (_i) {
//         case 1: return '3 7';
//         case 2: return '4 5 14';
//     }
// }
//
// function write(value) {
//     console.log(value);
// }

var list = readline().split(' ');

var n = parseInt(list[0]);
var h = parseInt(list[1]);

var a = readline().split(' ').map(function(currentValue) {
    return parseInt(currentValue);
});

var s = 0;

a.forEach(function(currentValue) {
    s += currentValue > h ? 2 : 1;
});

write(s);

var firstLine = readline().split(' ');
var number = firstLine[0];
var height = firstLine[1];
var heights = readline().split(' ').map(Number);
var width = 0;
for(var i = 0; i < number; i++){
    width++;
    if(heights[i] > height){
        width++;
    }
}
write(width);

var input1 = readline().split(" ");
var noOfFriends = +input1[0];
var highOfFence = +input1[1];

var hightOfFriends = readline().split(" ");

var totalWidth = 0;

for (var i = 0; i < noOfFriends; i++) {
    if (hightOfFriends[i] <= highOfFence) {
        totalWidth += 1;
    } else {
        totalWidth += 2;
    }
}
print(totalWidth);

var first = readline().split(" ")
var friendsList = readline().split(' ');
var n = first[0], h = first[1];
var counter = 0;
for(var i = 0; i < n; ++i){
  if(+friendsList[i] > +h) counter+=2;
  else counter+=1;
}
print(counter);

var inp_line1 = readline();
var inp_line2 = readline();

var inp_line1_arr = inp_line1.split(" ");
var inp_line2_arr = inp_line2.split(" ");

var min_width = 0;

for (var i=0; i<=inp_line1_arr[0] - 1 ; i++){
    if (parseInt(inp_line2_arr[i]) <= parseInt(inp_line1_arr[1])) {
        min_width = min_width + 1;
    } else {
        min_width = min_width + 2;
    }
}

write(min_width);

var X= readline().split(' ').map(Number)
var total=X[0],h=X[1]
X=readline().split(' ').map(Number)
print (X.reduce((a,c) => a + (c<=h ? 1 : 2), 0))

   var n = readline().split(" ");var load = readline().split(" ");
   var max = 0;
for(var i=0;i<load.length;i++)max = load[i]>(+n[1]) ? max+=2 : max+=1;
print(max)

var row = readline().split(" ").map(x => parseInt(x));
var friends = row[0];
var height = row[1];

var individualHeight = readline().split(" ").map(x => parseInt(x));

var sum = 0;

for (var i = 0; i < individualHeight.length; i++) {
    if (individualHeight[i] > height) {
        sum += 2;
    } else {
        sum += 1;
    }
}

 print(sum);

var n_H= readline().split(' ');
var a=readline().split(' ');
var width=0;
n_H[1]=parseInt(n_H[1]);
      for(i=0;i<parseInt(n_H[0]);i++){
      a[i]= parseInt(a[i]);
      if(a[i]>n_H[1])
        width+=2
        else
        width+=1
      }
print(width)

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline

var arr1=readline().split(' ').map((a)=>{ return parseInt(a)});
var arr=readline().split(' ').map((a)=>{ return parseInt(a)});
var count=0;
for(var i=0;i<arr1[0];i++){
    if(arr[i]>arr1[1]){
        count++;
    }
    count++;
}

print(count);

const readline = require("readline");

let inputs = [];

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.on("line", line => inputs.push(line));

rl.on("close", () => console.log(solution(inputs)));

function solution(data) {
    const xs = data.flatMap(x => x.split(" "));
    [n, h, ...friendsHeight] = xs;
    return friendsHeight.reduce((width, fh) => {
        return parseInt(fh) > h
            ? width + 2
            : width + 1
    }, 0);
};

const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });

  let numFriends, fenceHeight;

  rl.on('line', n => {
    if (!numFriends && !fenceHeight) {
      n = n.split(' ').map(Number);
      numFriends = n[0];
      fenceHeight = n[1];
    } else {
      const width = n.split(' ').map(Number).reduce((acc, curr) => {
        return curr > fenceHeight ? acc + 2 : acc + 1;
      }, 0);
      console.log(width);
      rl.close();
    }
  });

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    const line1 = readline().split(' '), line2 = readline().split(' ')

    let h = parseInt(line1[1]),widthOfRoad = 0;

    for (let heightOfPerson of line2){
    heightOfPerson = parseInt(heightOfPerson)
        widthOfRoad += (heightOfPerson > h) ? 2 : 1;
    }

    console.log(widthOfRoad)
}

var all, fh, lines, mainAux, print, readline, rl, rli, sum, write;

rl = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

print = console.log;

write = function(...args) {
  return process.stdout.write(args.join(' '));
};

lines = [];

rl.on('line', function(line) {
  return lines.push(line);
});

rl.on('close', main);

rli = 0;

readline = function() {
  return lines[rli++];
};

sum = function(items) {
  return items.reduce(function(a, b) {
    return a + b;
  });
};

all = function(items) {
  var i, item, len;
  for (i = 0, len = items.length; i < len; i++) {
    item = items[i];
    if (!item) {
      return false;
    }
  }
  return true;
};

fh = function(n, f, hs) {
  var h;
  return sum((function() {
    var i, len, results;
    results = [];
    for (i = 0, len = hs.length; i < len; i++) {
      h = hs[i];
      if (h > f) {
        results.push(2);
      } else {
        results.push(1);
      }
    }
    return results;
  })());
};

mainAux = function() {
  var f, hs, n;
  [n, f] = readline().split(' ').map(function(n) {
    return parseInt(n);
  });
  hs = readline().split(' ').map(function(n) {
    return parseInt(n);
  });
  return print(fh(n, f, hs));
};

  function main() {
    return mainAux();
  }
;

var lines, mainAux, minwidth, print, readline, rl, rli, write;

rl = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

print = console.log;

write = function(...args) {
  return process.stdout.write(args.join(' '));
};

lines = [];

rl.on('line', function(line) {
  return lines.push(line);
});

rl.on('close', main);

rli = 0;

readline = function() {
  return lines[rli++];
};

minwidth = function(n, f, hs) {
  return hs.reduce(function(acc, h) {
    if (h > f) {
      return acc + 2;
    } else {
      return acc + 1;
    }
  }, 0);
};

mainAux = function() {
  var f, hs, n;
  [n, f] = readline().split(' ');
  hs = readline().split(' ').map(function(v) {
    return parseInt(v);
  });
  return print(minwidth(n, f, hs));
};

  function main() {
    return mainAux();
  }
;

//# sourceMappingURL=wall-height.js.map

function main() {
    // write code here:
    for(let i=0;i<2;i++){
        stdin[i]=stdin[i].split(' ').map(Number);
    }
    var arr1=stdin[0];
    var arr2=stdin[1];
    const n=arr1[0];
    const h=arr1[1];
    var minWidth=0;
    for(let j=0;j<n;j++){
        if(arr2[j]>h){
            minWidth+=2;
        }else{
            minWidth+=1;
        }
    }
    console.log(minWidth);
}

const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
var stdin = [];
rl.on('line', function (line) {
    stdin.push(line);
});
rl.on('close', main);

const readline = require("readline")

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let fenceHeight = 0;
let noOfFriends = 0;
let roadWidth = 0;
rl.on("line", (input) => {
  if(!noOfFriends&&!fenceHeight){
  noOfFriends = input.split(" ")[0];
  fenceHeight = input.split(" ")[1];
  }
    else{
    let arrayofHeights = input.split(" ").map((element)=>{
      return element*1
    })
    arrayofHeights.forEach(element => {
      if(element>fenceHeight)
      roadWidth+=2
      else
      roadWidth++
    });
    console.log(roadWidth)
    rl.close();
    //   if (element > fenceHeight){

    //   roadWidth+=2
    //   console.log("First Condition ")
    // }
    //   else{
    //   roadWidth++
    //   console.log("Second Condition ")
    // }

  }

});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = readline().split(" ");

         const x2 = readline().split(" ").map(x=>+x);
     vanyaAndFence(x[0],x[1],x2);
 }

function vanyaAndFence(n, h, guys) {
       console.log(guys.reduce((prev, curr) => (curr > h ? prev + 2 : prev + 1), 0));

}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw "ArrayIndexOutOfBoundsException ‚There is no more input";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  var N = one[0];
  var H = one[1];
  var list = nextIntArray();
  var output = 0;
  for(var i = 0; i < N; i++){
    if(list[i] > H){
      output += 2;
    }else{
      output++;
    }
  }
  myout(output);
}

const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let h = 0,
    lineCounter = 0;

let hArr = [];

rl.on('line', (input) => {
    let line;
    if (lineCounter === 0) {
        line = input.split(' ');
        h = parseInt(line[1]);
        lineCounter++;
    } else {
        line = input.split(' ');
        line.forEach(element => {
            hArr.push(parseInt(element));
        });
        rl.close();
        console.log(solve(h, hArr));
    }
});

const solve = (h, hArr) => {
    let sum = 0;
    hArr.forEach(element => {
        sum = (element > h) ? sum + 2 : sum + 1;
    });
    return sum;
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  // input
  const [, h] = readline().split(' ').map(x => parseInt(x));
  const a = readline().split(' ').map(x => parseInt(x));

  // solve
  const w = a.map(x => x > h ? 2 : 1).reduce((m, n) => m + n, 0);

  // output
  print(w);
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let counter = 0;
let n, k;

rl.on('line', (d) => {
  if (counter === 0) {
    counter++;
    [n, k] = d.split(' ').map(Number);
    return;
  }

  let f = d.split(' ').map(Number);
  let ans = n;

  for (let i = 0; i < f.length; i++) {
    ans += f[i] > k;
  }

  console.log(ans);

  counter++;
});

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let counter = 0;
let n, k;

rl.on('line', (d) => {
  if (counter === 0) {
    counter++;
    [n, k] = d.split(' ').map(Number);
    return;
  }

  let f = d.split(' ').map(Number);
  let ans = 0;

  for (let i = 0; i < f.length; i++) {
    if (f[i] > k) {
      ans += 2;
    }
    else {
      ans += 1;
    }
  }

  console.log(ans);

  counter++;
});

/**
 *
Vanya and his friends are walking along the fence of height h and they do not want the guard to notice them. In order to achieve this the height of
each of the friends should not exceed h. If the height of some person is greater than h he can bend down and then he surely won't be noticed by the guard.
The height of the i-th person is equal to ai.

Consider the width of the person walking as usual to be equal to 1, while the width of the bent person is equal to 2. Friends want to talk to each other
 while walking, so they would like to walk in a single row. What is the minimum width of the road, such that friends can walk in a row and remain unattended
  by the guard?

Input
The first line of the input contains two integers n and h (1 ≤ n ≤ 1000, 1 ≤ h ≤ 1000) — the number of friends and the height of the fence, respectively.

The second line contains n integers ai (1 ≤ ai ≤ 2h), the i-th of them is equal to the height of the i-th person.

Output
Print a single integer — the minimum possible valid width of the road.

Examples
input
3 7
4 5 14
output
4
input
6 1
1 1 1 1 1 1
output
6
input
6 5
7 6 8 9 10 5
output
11
Note
In the first sample, only person number 3 must bend down, so the required width is equal to 1 + 1 + 2 = 4.

In the second sample, all friends are short enough and no one has to bend, so the width 1 + 1 + 1 + 1 + 1 + 1 = 6 is enough.

In the third sample, all the persons have to bend, except the last one. The required minimum width of the road is equal to 2 + 2 + 2 + 2 + 2 + 1 = 11.
 */

let inputString = '';

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    let numberOfPersons = Number(inputString[0].split(" ")[0])
    let heigtOfWall = Number(inputString[0].split(" ")[1]);
    let heigtOfPersons = inputString[1].split(" ")

    solution(numberOfPersons, heigtOfWall, heigtOfPersons);

});

function solution(numberOfPersons, heigtOfWall, heigtOfPersons) {

    let widthOfRoad = numberOfPersons;

    for (let index = 0; index < numberOfPersons; index++) {

        if (Number(heigtOfPersons[index]) > heigtOfWall)
            widthOfRoad++;

    }

    console.log(widthOfRoad);

}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    const arr1 = readline().split(" ");
    let numberOfPersons = +arr1[0];
    let height = +arr1[1];
    let personsHeight = readline().split(" ");

    let total = 0;

    for (let i = 0; i < numberOfPersons; i++) {
        if (personsHeight[i] <= height) {
            total++;
        }
        else {
            total += 2;
        }
    }
    console.log(total);
}

const readLine = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));

readLine.on('close', () => {
  let answer = 0;
  let [n, h] = input[0].split(' ').map(x => parseInt(x));
  const nums = input[1].split(' ').map(x => parseInt(x));

  nums.forEach(i => {
    if (i > h) answer += 2;
    else answer += 1;
  });
  console.log(answer);
});

const readline = require('readline')

const rl = readline.createInterface({
	    input: process.stdin,
	    output: process.stdout,
	terminal : false
});

var firstLine = 0
var h, n, a
rl.on("line", (w)=>{
	if(firstLine === 0){
		var r = w.split(" ")
		n = r[0]
		h = r[1]
		firstLine++
		return
	}

	a = w.split(" ")

	var width = n

	for(var i = 0; i < a.length; i++){
		if(parseInt(a[i]) > parseInt(h)){
			width++
		}
	}

	console.log(width)
})

const readline = require('readline');
const rl = readline.createInterface(process.stdin, process.stdout);

rl.setPrompt('');
rl.prompt();
let promptCounter = 0

let n, h;

rl.on('line', function (line) {
    promptCounter++;
    //first line
    if (promptCounter === 1) {
        [n, h] = line.split(' ').map(x => Number(x));
        rl.prompt();
    } else {
        let rowWidth = line.split(' ').map(x => Number(x)).map(x => {
            if (x > h) return 2;
            else return 1;
        }).reduce((p, c) => p + c);
        console.log(rowWidth);
        rl.close()
    }
});

const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question('', function (firstLine) {
    // rl.write('hello\n')
    let [n, h] = firstLine.split(' ').map(x => Number(x))
    rl.setPrompt('');
    rl.prompt();
    rl.on('line', function (lengths) {
        let arr = lengths.split(' ').map(x => Number(x));
        let rowLength = arr.map(x => {
            if (x > h) return 2;
            else return 1;
        }).reduce((p, c) => p + c)
        // rl.write(String(rowLength));
        console.log(rowLength);
        rl.close();
    })
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    // if(Array.isArray(inputString)) inputString = inputString.join('\n');
    inputString += inputStdin;
    // inputString = inputString.trim().split('\n').map(string => {
    //     return string.trim();
    // });

    // main();
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function readAsInt(){
  return parseInt(readline());
}

function readAsIntList(){
  return readline().trim().split(' ').filter(i => i).map(i => parseInt(i));
}

// Make a Snippet for the code above this and then write your logic in main();

function main() {
  let [n, h] = readAsIntList();
  let list = readAsIntList();
  console.log(list.map(a => a > h ? 2 : 1).reduce((acc,v) => acc+v,0));
}

let rl = require("readline");

let prompts = rl.createInterface({
    input: process.stdin,
    output: process.stdout,
});
let noOfFriends;
let highOfFence;

prompts.question("", function (input) {
    let input1 = input.split(" ");
    noOfFriends = +input1[0];
    highOfFence = +input1[1];
    prompts.question("", function (hightOfFriends) {
        hightOfFriends = hightOfFriends.split(" ");
        let totalWidth = 0;
        for (let i = 0; i < noOfFriends; i++) {
            if (hightOfFriends[i] <= highOfFence) {
                totalWidth += 1;
            } else {
                totalWidth += 2;
            }
        }
        console.log(totalWidth);
        process.exit();
    });
});

/**
 * @author Sunwarul
 * Software Developer
*/

process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStd => {
    inputString += inputStd;
});
process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(str => {
        return str.trim();
    });
    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
	const [n, h] = readLine().split(' ').map(Number);
	const friends = readLine().split(' ').map(Number);
	let totalNeeded = 0;
	for(let i in friends) {
		if(friends[i] > h) {
			totalNeeded = totalNeeded + 2;
		} else {
			++totalNeeded;
		}
	}
	console.log(totalNeeded);
}

process.stdin.resume();
process.stdin.setEncoding("utf-8");

let currentLine = 0;
let inputString = "";

process.stdin.on("data", (raw_data) => {
  inputString += raw_data;
});

process.stdin.on("end", (_) => {
  inputString = inputString
    .trim()
    .split("\n")
    .map((line) => {
      return line.trim();
    });
  main();
});

function readLine() {
  return inputString[currentLine++];
}

/******** Main function*************/

function main() {
  var [n, h] = readLine().split(" ").map(Number);
  var arr = readLine().split(" ").map(Number);
  var sum = 0;
  arr.map((item) => (sum += Math.ceil(item / h)));

  console.log(sum);
}

let fs = require('fs');

let txt = fs.readFileSync(0, "utf-8").split("\r\n").filter(data => {
    return data.length > 0;
});

for (let i = 0; i < txt.length; i+=2) {
    let info =txt[i].split(" ");
    doit(info[1] * 1,  txt[i+1].split(" ").filter(data => {
        return data.length > 0;
    }));
}

function doit(n, tab) {
    let sum=0;
    tab.forEach(element => {
        if(element<=n){
            ++sum;
        }else{
            sum+=2;
        }
    });
    console.log(sum);

}

// Sample code to perform I/O:

process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";

process.stdin.on("data", function (input) {
    stdin_input += input;                               // Reading input from STDIN
});

process.stdin.on("end", function () {
    main(stdin_input);
});

function main(input) {
    let output = nameLookUp(input);
    process.stdout.write(output);       // Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail

// Write your code here
function nameLookUp(str) {
    let inputs = str.trim().split('\n');
    let fenceHeight = inputs[0].split(' ')[1].trim();
    let friendsHeight = inputs[1].trim().split(' ');
    let sumWidth = 0;
    for (let row of friendsHeight) {
        if (+row > +fenceHeight) {
            sumWidth += 2;
        }
        else {
            sumWidth += 1;
        }
    }
    return sumWidth.toString();
}

const readLine = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
});

const input = [];
readLine.on('line', line => input.push(line));
const fence = () => {
    let [n,h] = input[0].split(' ').map(x => +x);
    let ar = input[1].split(' ').map(x => +x);
    let count = ar.length;
    for (const y of ar) {
        if (y > h) {
            count++;
        }
    }
    console.log(count);
};

readLine.on('close', fence);

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.replace(/\s*$/, '')
        .split('\n')
        .map(str => str.replace(/\s*$/, ''));

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    let nh = readLine().split(' ').map(value => parseInt(value));
    let n = nh[0];
    let h = nh[1];
    let arr = readLine().split(' ').map(value => parseInt(value));
    let ans = 0;
    for (var i = 0; i < n; i++) {
        if (arr[i] > h) {
            ans += 2;
        } else ans += 1;
    }
    console.log(ans);
}

var input = readline().split(" ").map(Number), n = input[0], h = input[1], a = readline().split(" ").map(Number);

var ans = 0;
for(var i = 0; i < n; ++i){
    ans++;
    if(a[i] > h){
        ans++;
    }
}

write(ans);

var input1 = readline().split(" ").map(x=>parseInt(x));
var n = input1[0];
var h = input1[1];
var heights = []
heights = readline().split(" ").map(x => parseInt(x));

function performTask(n, h, heights) {
    return heights.reduce((width, height) => {
        return width + (height > h ? 2 : 1);
    }, 0)
}

const output = performTask(n, h, heights);
print(output);

x = readline().split(' ').map(Number);n=x[0];h=x[1];
print(n + readline().split(' ').map(Number).filter(i => i > h).length);

x = readline().split(' ').map(Number);
print(readline().split(' ').map(Number).reduce((res, i) => res + (i > x[1]), x[0]));

var num1=readline().split(" ").map(x=>parseInt(x));
var n =num1[0];
var h =num1[1];

var num2=readline().split(" ").map(x=>parseInt(x));
var width = 0;
for(var i=0 ; i<n ;i++){
    if(num2[i]>h){
        width++;
    }
    width++;
}

print(width);

n = readline().split(" ")
fr = readline().split(" ")
var counter = 0
for (i=0 ; i<n[0] ; i++){
    if (Number(fr[i])>n[1]){
        counter++
    }
}
print(counter+Number(n[0]))

m=readline()
y=m.split(' ')[0]
z=parseInt(m.split(' ')[1])
x=readline().split(' ')
sum=0;
for(i=0;i<y;i++)
{

if(parseInt(x[i])>z)
   sum=sum+2;
else
   sum=sum+1;
    }
print(sum)

var line1 = readline().split(" ");
var n = parseInt(line1[0]);
var h = parseInt(line1[1]);

var roadWidth = 0;

var heights = readline().split(" ");

for (var i = 0; i < n; i++) {

    if (parseInt(heights[i]) > h) {
        roadWidth += 2;
    } else {
        roadWidth++;
    }

}

print(roadWidth);

var num = readline().split(' ').map(Number);
	var str = readline().split(' ').map(function(elem) {
		return parseInt(elem);
	});
	var n = num[0];
	var h = num[1];
	var sum = n;
	for(var i = 0; i < str.length; i++)
	{
		if(str[i] > h){
			sum += 1;
		}
	}
	print(sum);

var input = readline().split(" ")
var people = readline().split(" ").map(Number);
var roadWidth = 0

for (var i = 0; i < input[0]; i++) {
    if (people[i] > input[1]) {
        roadWidth += 2
    } else {
        roadWidth += 1
    }
}

print(roadWidth)

var line1 = readline().split(" ").map(x => parseInt(x)); // num will be an array [1,2,3]
var n = line1[0]; // to store values in different variables.
var h = line1[1];

var line2 = readline().split(" ").map(x => parseInt(x)); // num will be an array [1,2,3]

var result = 0;
for(var i =0; i < n; i++) {
    result += line2[i] <= h ? 1 : 2;
}
print(result)

function Input() {
  var heightOfFence;
  readline().split(' ').forEach(function (element) {
    heightOfFence = parseInt(element);
  });

  const listFriends = readline().split(' ').map(function (element) {
    return parseInt(element);
  });

  return {
    heightOfFence: heightOfFence,
    listFriends: listFriends
  };
}

function PossibleWidth(data) {
  var possibleWidth = 0;
  data.listFriends.forEach(function (element) {
    ++possibleWidth;
    if (element > data.heightOfFence) {
      ++possibleWidth;
    }
  });
  return possibleWidth;
}

var data = Input();
print(PossibleWidth(data));

var line1 = readline().split(' ').map(function (x) { return parseInt(x); })
var line2 = readline().split(' ').map(function (x) { return parseInt(x); })
var h = line1[1]
var result = 0
line2.forEach(x => {
   x < h ? result++: result += Math.ceil(x/h)
})
print(result)

var input = readline().split(" ").map(x=>parseInt(x));
var num_friends = input[0];
var height_of_fence = input[1];
var friends_height = readline().split(" ").map(x=>parseInt(x));
var width = 0;
for(var i = 0; i<num_friends;i++){
    if(friends_height[i]>height_of_fence)width+=2;
    else width++;
}
print(width);

// parameter "input" gets all data
function Main() {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	input = readline().split(" ").map(function(x) { return parseInt(x); });
	a = readline().split(" ").map(function(x) { return parseInt(x); });
	const n = input[0];
	const h = input[1];
	const ans = a.reduce((cum,x)=>cum+(x>h?2:1),0);
	print(ans);

}

Main()

var res = sol(readline(), readline());
print(res);

function sol(line, friends) {
    var input = line.split(" ");
    var height = friends.split(" ");

    var n = input[0];
    var heightOfFence = Number(input[1]);

    var width = 0;

    for (var i = 0; i < n; i++) {
        if (Number(height[i]) > heightOfFence) {
            width += 2;
        }else{
            width++;
        }
    }

    return width;
}

var num = readline().split(" ").map(x => parseInt(x)); // num will be an array [1,2,3]
var friends = num[0]; // to store values in different variables.
var height = num[1];
var heights = readline().split(" ").map(x => parseInt(x));
var score = 0;
for (var i =0;i< friends;i++) {
    if (heights[i] > height) {
        score+=2;
    } else {
        score+=1;
    }
}
print(score)

var nk = readline().split(" ").map(x => Number(x));
var n = nk[0];
var k = nk[1];
var lengths = readline().split(" ").map(x => Number(x));

var width = 0;
for(var i = 0; i < lengths.length; i++){
	width++;
	if(lengths[i] > k)
		width++;
}

print(width);

var a=readline().split(" ");
n=a[0];
m=a[1];
var cnt=0;
var arr = readline().split(" ").map(Number);
for( var i=0;i < n;i ++ ){
    if( arr[i]>m )
    cnt=cnt+2;
    else
    cnt++;
}
print(cnt);

var s = readline().split(" ");
var n = Number(s[0]), h = Number(s[1]);
 s = readline().split(" ");
 var count = n;
for(var i=0; i<n; i++) {
    var cur = Number(s[i]);
    if (cur > h) {
        count++;
    }
}
print(count);

var input = readline().split(' ').map(Number);

var n = input[0];
var h = input[1];

var friends = readline().split(' ').map(Number);
var road = n;

for (var i = 0; i < friends.length; i++) {
	if (friends[i] > h) {
		road += 1;
	}
}

print(road);

(function() {
    'use strict';
    const n = readline().split(' ').map(Number);
    const z = readline().split(' ').map(Number);
    let w = 0;
    for (let i = 0; i < n[0]; ++i) {
        if (z[i] > n [1]) {
            w += 2;
        } else {
            w += 1;
        }
    }
    print(w);
}());

var firstLine = readline().split(' ');
var fenceHeight = firstLine[1];
var heightArray = readline().split(' ').map(x => parseInt(x));
var minWidth = heightArray.reduce((minWidth, height) => {
    if(height > fenceHeight) return minWidth += 2;
    else return minWidth += 1;
}, 0);

print(minWidth);

var fenceHeight = readline().split(' ')[1];
var heightArray = readline().split(' ').map(x => parseInt(x));
var minWidth = heightArray.reduce((minWidth, height) => {
    if(height > fenceHeight) return minWidth += 2;
    else return minWidth += 1;
}, 0);

print(minWidth);

var arr1 = readline().split(' ');
var arr = readline().split(' ');
var res = 0, n = +arr1[0], h = +arr1[1];

for(var i = 0;  i < n; i++) {
    if (+arr[i] <= h) {
        res++;
    } else {
        res+=2;
    }
}

print(res);

const main = () => {
  const n = readline().trim().split(' ').map(x => parseInt(x));
  const arr = readline().trim().split(" ").map(x => parseInt(x));
  const h = n[1];
  var total = 0;

  for (p of arr) {
    if (p > h) {
      total += 2;
      continue;
    }
    total++;
  }

  print(total);
};
main();

var g = readline();
g = g.split(" ");
var y = readline();
y = y.split(" ");
var n = Number(g[0]);
var h = Number(g[1]);
var j = n;
for(i=0;i<n;i++){
    if(y[i] > h){
        j++;
    }
}
print(j);

var H = readline().split(' ').map(x=>parseInt(x))[1]
var ar = readline().split(' ').map(x=>parseInt(x))
print( ar.length + ar.filter(h=>(h>H)).length )

'use strict';
const data = readline().split(' ').map(value => parseInt(value)),
      n = data[0],
      h = data[1],
      array = readline().split(' ').map(value => parseInt(value));
let res = n;

for (let i = 0; i < n; i++) {
    if (array[i] > h) {
        res++;
    }
}

write(res);

var nh = readline().split(' ');
var n = parseInt(nh[0]);
var h = parseInt(nh[1]);
var a = readline().split(' ');
var need = 0;
for (var i = 0; i < a.length; i++) {
     if (a[i] <= h) {
     need++;
     } else {
     need+=2;
     }
}
print (need)

var x = readline();
var rost = readline();
var res = 0;
	for (var i=0; i<+x[0]; i++){
		rost[i]>+x[1]? res+2: res++
	}
print(res);

var x = readline().split(" ");
var rost = readline().split(" ");
var res = 0;
	for (var i=0; i<x[0]; i++){
		rost[i]>=+x[1]? res=+res+2:res++
	}
print(res);

var nh = readline().split(" ");
var a = readline().split(" ");
var width = 0;
for(var i = 0; i < nh[0]; i++)
{
 if(a[i] > nh[1])
 {
   width += 2;
 }
 else
 {
   width += 1;
 }
}
print(width);

var x= readline().split(' ');
var n = x[0];
var h = x[1];
var a = readline().split(" ").map(Number);
var s = 0;
for(var i = 0; i<n; ++i){
    s++;
    if(a[i]>h){
        s++;
    }
}

"use strict";

var input = readline().split(' ').map(value => +value);
var n = input[0];
var h = input[1];
var a = readline().split(' ').map(value => +value);

write(a.map(a => a < h ? 1 : 2).reduce((a, b) => a + b));

var firstLine = readline().split(' ');
var number = firstLine[0];
var height = firstLine[1];
var heights = readline().split(' ');
var width = 0;
for(var i = 0; i < number; i++){
    width++;
    if(heights[i] > height){
        width++;
    }
}
write(width);

var first = readline().split(" ")
var friendsList = readline().split(' ');
var n = first[0], h = first[1];
var counter = 0;
for(var i = 0; i < n; ++i){
  if(friendsList[i] > h) counter+=2;
  else counter+=1;
}
print(n,h,friendsList)
print(counter);

var first = readline().split(" ")
var friendsList = readline().split(' ');
var n = first[0], h = first[1];
var counter = 0;
for(var i = 0; i < n; ++i){
  if(friendsList[i] > h) counter+=2;
  else counter+=1;
}
print(counter);

var first = readline().split(" ")
var friendsList = readline().split(' ');
var n = first[0], h = first[1];
var counter = 0;
for(var i = 0; i < n; ++i){
  if(friendsList[i] > h) {
    counter+=2;
    print(friendsList[i], counter);
  }
  else counter+=1;
}
print(counter);

var first = readline().split(" ")
var friendsList = readline().split(' ');
var n = first[0], h = first[1];
var counter = 0;
for(var i = 0; i < n; i++){
  if(friendsList[i] > h) counter+=2;
  else counter+=1;
}
print(counter);

var first = readline().split(" ")
var friendsList = readline().split(' ');
var n = first[0], h = first[1];
var counter = 0;
for(var i = 0; i < n; ++i){
  print(i, friendsList[i]);
  if(friendsList[i] > h) counter+=2;
  else counter+=1;
}
print(counter);

var num = readline().split(" ").map(x => parseInt(x));

print(num)

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline

var arr1=readline().split(' ').map((a)=>{ return parseInt(a)});
var arr=readline().split(' ').map((a)=>{ return parseInt(a)});
var count=0;
for(var i=0;i<arr1[0];i++){
    if(arr[i]>=arr1[1]){
        count++;
    }
    count++;
}

print(count);

const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });

  let numFriends, fenceHeight;

  rl.on('line', n => {
    if (!numFriends && !fenceHeight) {
      n = n.split(' ').map(Number);
      console.log(n);
      numFriends = n[0];
      fenceHeight = n[1];
    } else {
        // const numbers = n.split(' ').map(Number);
        // console.log(numbers);
        // let width = 0;
        // for(let n of numbers){
        //     (n > fenceHeight) ? width +=2 : width +=1;
        // }

        //console.log(width);
      const width = n.split(' ').map(Number).reduce((acc, curr) => {
        return curr > fenceHeight ? acc + 2 : acc + 1;
      }, 0);

      console.log(width);
      rl.close();
    }
  });

var lines, mainAux, minwidth, print, readline, rl, rli, write;

rl = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

print = console.log;

write = function(...args) {
  return process.stdout.write(args.join(' '));
};

lines = [];

rl.on('line', function(line) {
  return lines.push(line);
});

rl.on('close', main);

rli = 0;

readline = function() {
  return lines[rli++];
};

minwidth = function(n, f, hs) {
  return hs.reduce(function(acc, h) {
    if (h > f) {
      acc + 2;
    }
    return acc + 1;
  }, 0);
};

mainAux = function() {
  var f, hs, n;
  [n, f] = readline().split(' ');
  hs = readline().split(' ');
  return print(minwidth(n, f, hs));
};

  function main() {
    return mainAux();
  }
;

//# sourceMappingURL=wall-height.js.map

const readline = require("readline")

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let fenceHeight = 0;
let noOfFriends = 0;
let arrOfHeights = [];
let roadWidth = 0;
rl.on("line", (input) => {
  if(!noOfFriends&&!fenceHeight){
  noOfFriends = input.split(" ")[0];
  fenceHeight = input.split(" ")[1];
  }
  else{
    arrOfHeights = (input.split(" "))
    arrOfHeights.forEach((element)=>{
      if (element>fenceHeight)
      roadWidth = roadWidth + 2
      else
      roadWidth++
    })
    console.log(roadWidth)
    rl.close();
  }

});

const readline = require("readline")

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let fenceHeight = 0;
let noOfFriends = 0;
let roadWidth = 0;
rl.on("line", (input) => {
  if(!noOfFriends&&!fenceHeight){
  noOfFriends = input.split(" ")[0];
  fenceHeight = input.split(" ")[1];
  }
  else{
    const arrOfHeights = input.split(" ").map((element)=>{
      element = parseInt(element)
      if (element > fenceHeight){
      roadWidth+=2
      console.log("First Condition ")
    }
      else{
      roadWidth++
      console.log("Second Condition ")
    }
    })
    console.log(roadWidth)
    rl.close();
  }

});

const readline = require("readline")

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let fenceHeight = 0;
let noOfFriends = 0;
let arrOfHeights = [];
let roadWidth = 1;
rl.on("line", (input) => {
  if(!noOfFriends&&!fenceHeight){
  noOfFriends = input.split(" ")[0];
  fenceHeight = input.split(" ")[1];
  }
  else{
    arrOfHeights = (input.split(" "))
    arrOfHeights.forEach((element)=>{
      if (element >= fenceHeight)
      roadWidth = roadWidth + 2
      else
      roadWidth++
    })
    console.log(roadWidth)
    rl.close();
  }

});

const readline = require("readline")

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let fenceHeight = 0;
let noOfFriends = 0;
let arrOfHeights = [];
let roadWidth = 0;
rl.on("line", (input) => {
  if(!noOfFriends&&!fenceHeight){
  noOfFriends = input.split(" ")[0];
  fenceHeight = input.split(" ")[1];
  }
  else{
    arrOfHeights = input.split(" ").map(Number)
    console.log("current arrrayof heights ="  +arrOfHeights + "\n")
    arrOfHeights.forEach((element)=>{
      if (element > fenceHeight){
      roadWidth = roadWidth + 2
      console.log("elements that passed here \n"+element)
    }
      else
    {
      console.log("elements that passed here \n"+element)
      roadWidth++
    }
    })
    console.log(roadWidth)
    rl.close();
  }

});

const readline = require("readline")

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let fenceHeight = 0;
let noOfFriends = 0;
let roadWidth = 0;
rl.on("line", (input) => {
  if(!noOfFriends&&!fenceHeight){
  noOfFriends = input.split(" ")[0];
  fenceHeight = input.split(" ")[1];
  }
  else{
    const arrOfHeights = input.split(" ").map((element)=>{
      element = parseInt(element)
      console.log(typeof(element))
      if (element > fenceHeight){
      roadWidth+=2
      console.log("First Condition ")
    }
      else{
      roadWidth++
      console.log("Second Condition ")

    }
    })
    console.log(roadWidth)
    rl.close();
  }

});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = readline().split(" ");

         const x2 = readline().split(" ");
     vanyaAndFence(x[0],x[1],x2);
 }

function vanyaAndFence(n, h, guys) {
      console.log(guys.reduce((prev, curr) => (curr > h ? prev + 2 : prev + 1), 0));

}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = readline().split(" ");

         const x2 = readline().split(" ").map(x=>+x);
     vanyaAndFence(x[0],x[1],x2);
 }

function vanyaAndFence(n, h, guys) {
    console.log(n,h,guys)
      console.log(guys.reduce((prev, curr) => (curr > h ? prev + 2 : prev + 1), 0));

}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
    const x = readline();
    var line2 = readline();

    foo(x);
    foo(line2);
}
function foo(x) {
    process.stdout.write("hello: ");   // without auto '\n' (newline)
    console.log(x);  // with auto '\n' (newline)
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });

  main();
});

function readline() {
  return inputString[currentLine++];
}

function print(s) {
  process.stdout.write(`${s}`);
}
// Make a Snippet for the code above this and then write your logic in main();

function main() {
  // input
  const [, h] = readline().split(' ');
  const a = readline().split(' ');

  // solve
  const w = a.map(x => x > h ? 2 : 1).reduce((m, n) => m + n, 0);

  // output
  print(w);
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function main() {
    const arr1 = readline().split(" ");
    let numberOfPersons = +arr1[0];
    let height = +arr1[1];
    let personsHeight = readline().split(" ");

    let total = 0;

    for (let i = 0; i < numberOfPersons; i++) {
        if (personsHeight[i] <= height) {
            total++;
        }
        else {
            total += 2;
        }
    }
    return total
}

const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question('', function (firstLine) {
    // rl.write('hello\n')
    let [n, h] = firstLine.split(' ').map(x => Number(x));
    rl.setPrompt('');
    rl.prompt();
    rl.on('line', function (lengths) {
        let arr = lengths.split(' ').map(x => Number(x));
        let rowLength = arr.map(x => {
            if (x > h) return 2;
            else return 1;
        }).reduce((p, c) => p + c);
        rl.write(String(rowLength));
        console.log();
        rl.close();
    });
});

const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question('', function(firstLine) {
  // rl.write('hello\n')
  let [n, h] = firstLine.split(' ').map(x => Number(x))
  rl.prompt();
  rl.on('line', function(lengths) {
    let arr = lengths.split(' ').map(x => Number(x));
    let rowLength = arr.map(x => {
      if(x > h) return 2;
      else return 1;
    }).reduce((p, c) => p + c)
    rl.write(String(rowLength));
    console.log();
    rl.close();
  })
});

const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question('', function(firstLine) {
  let [n, h] = firstLine.split(' ').map(x => Number(x))
  rl.prompt();
  rl.on('line', function(lengths) {
    let arr = lengths.split(' ').map(x => Number(x));
    let rowLength = arr.map(x => {
      if(x > h) return 2;
      else return 1;
    }).reduce((p, c) => p + c)
    console.log(rowLength);
    rl.close();
  })
});

x = readline().split(' ');
readline().split(' ').reduce((res, i) => res + (+i > +x[1]), +x[0]);

var line1 = readline();
var n = parseInt(line1.slice(0, 1));
var h = parseInt(line1.slice(2));

var roadWidth = 0;

var heights = readline().split(" ");

for (var i = 0; i < n; i++) {

    if (heights[i] > h) {
        roadWidth += 2;
    } else {
        roadWidth++;
    }

}

print(roadWidth);

var n = parseInt(readline());
var h = parseInt(readline());

var roadWidth = 0;

for (var i = 0; i < n; i++) {
    var x = parseInt(readline());

    if ((x > h)) {
        roadWidth += 2;
    } else {
        roadWidth++;
    }
}

print(roadWidth);

var line1 = readline();
var n = parseInt(line1.slice(0, 1));
var h = parseInt(line1.slice(2));

var roadWidth = 0;

var heights = readline();

var counter = 0;

for (var i = 0; i < n; i++) {

    var check = parseInt(heights.slice(counter));

    if (check > h) {
        roadWidth += 2;
    } else {
        roadWidth++;
    }
    counter += 2;
}

print(roadWidth);

var n = readline();
var h = readline();

var roadWidth = 0;

for (var i = 0; i < n; i++) {
    var x = readline();
    if (x > h) {
        roadWidth += 2;
    } else {
        roadWidth++;
    }
}

print(roadWidth);

var line1 = readline().split(' ')
var line2 = readline().split(' ')
var h = line1[1]
var result = 0
line2.forEach(x => {
   x < h ? result++: result += Math.ceil(x/h)
})
print(result)

var arr1 = readline().split(' ');
var arr = readline().split(' ');
var res = 0, n = +arr1[0], h = +arr1[1];

print(h);
for(var i = 0;  i < n; i++) {
    if (+arr[i] <= h) {
        res++;
    } else {
        res+=2;
    }
}

print(res);

var arr1 = readline().split(' ');
var arr = readline().split(' ');
var res = 0, n = arr1[0], h = arr1[1];

for(var i = 0;  i < n; i++) {
    if (arr[i] <= h) {
        res++;
    } else {
        res+=2;
    }
}

print(res);

var g = readline();
g = g.split(" ");
var y = readline();
y = y.split(" ");
var n = Number(g[0]);
var h = Number(g[1]);
var min = Number(y[0]);
var max = min;
var j = n;
var maximum = function(){for(i=1;i<y.length;i++){
    var z = y[i];
    if(min > h){
        j++
    }
    else if(z > min){
        max = z;
    }
    else if(z < min){
        min = z;
    }
}
}
maximum();
if(max > h){
    j = j + 1;
}
print(j);

var g = readline();
g = g.split(" ");
var y = readline();
y = y.split(" ");
var n = Number(g[0]);
var h = Number(g[1]);
var min = Number(y[0]);
var j = n;
for(i=1;i<y.length + 1;i++){
    if(min > h){
        j++;
    }
    else if(y[i] < min){
        min = y[i];
    }
    else if(y[i] > min){
        min = y[i];
    }
}
print(j);

var g = readline();
g = g.split(" ");
var y = readline();
y = y.split(" ");
var n = Number(g[0]);
var h = Number(g[1]);
var min = Number(y[0]);
var max = min;
var j = n;
var maximum = function(){for(i=1;i<y.length;i++){
    var z = y[i];
    if(min > h){
        j++
    }
}
}
maximum()
print(j);

var g = readline();
var y = readline();
y = y.split(" ")
g = g.split(" ");
var n = Number(g[0]);
var h = Number(g[1]);
var min = y[0];
var max = min;
var j = n;
for(i=1; i < y.length;i++){
    if(y[i] > min){
        max = y[i];
    }
    else if(y[i] < min){
        min = y[i];
    }
}
if(max > h){
    j++;
}
print(j);

var g = readline();
var y = readline();
g = g.split(" ");
y = y.split(" ");
var n = Number(g[0]);
var h = Number(g[1]);
var min = y[0];
var max = min;
var j = n;
for(i=1;i < y.length;i++){
    if(y[i] > min){
        max = y[i];
    }
    else{
        min = y[i];
    }
}
if(max > h){
    j++;
}
print(j);

var g = readline();
g = g.split(" ");
var y = readline();
y = y.split(" ");
var n = Number(g[0]);
var h = Number(g[1]);
var min = Number(y[0]);
var max = min;
var j = n;
for(i=1;i<y.length;i++){
    var z = y[i];
    if(z > min){
        max = z;
    }
    else if(z < min){
        min = z;
    }
}
if(max > h){
    j= j + 1;
}
print(j);

var nh = readline().split(' ');
var n = parseInt(nh[0]);
var h = parseInt(nh[1]);
var a = readline().split(' ');
var need = 0;
for (var i = 0; i < a.length; i++) {
     if (a[i] < h) {
     need++;
     } else {
     need+=2;
     }
}
print (need)

var x = readline().split(" ");
var rost = readline().split(" ");
var res = 0;
	for (var i=0; i<+x[0]; i++){
		rost[i]>+x[1]? res+2: res++
	}
print(res);


There are $$$n$$$ astronauts working on some space station. An astronaut with the number $$$i$$$ ($$$1 \le i \le n$$$) has power $$$a_i$$$.An evil humanoid has made his way to this space station. The power of this humanoid is equal to $$$h$$$. Also, the humanoid took with him two green serums and one blue serum.In one second , a humanoid can do any of three actions:  to absorb an astronaut with power strictly less humanoid power;  to use green serum, if there is still one left;  to use blue serum, if there is still one left. When an astronaut with power $$$a_i$$$ is absorbed, this astronaut disappears, and power of the humanoid increases by $$$\lfloor \frac{a_i}{2} \rfloor$$$, that is, an integer part of $$$\frac{a_i}{2}$$$. For example, if a humanoid absorbs an astronaut with power $$$4$$$, its power increases by $$$2$$$, and if a humanoid absorbs an astronaut with power $$$7$$$, its power increases by $$$3$$$.After using the green serum, this serum disappears, and the power of the humanoid doubles, so it increases by $$$2$$$ times.After using the blue serum, this serum disappears, and the power of the humanoid triples, so it increases by $$$3$$$ times.The humanoid is wondering what the maximum number of astronauts he will be able to absorb if he acts optimally.

The first line of each test contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains integers $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — number of astronauts and $$$h$$$ ($$$1 \le h \le 10^6$$$) — the initial power of the humanoid. The second line of each test case contains $$$n$$$ integers $$$a_i$$$ ($$$1 \le a_i \le 10^8$$$) — powers of astronauts. It is guaranteed that the sum of $$$n$$$ for all test cases does not exceed $$$2 \cdot 10^5$$$.

For each test case, in a separate line, print the maximum number of astronauts that a humanoid can absorb.

NoteIn the first case, you can proceed as follows:   use green serum. $$$h = 1 \cdot 2 = 2$$$  absorb the cosmonaut $$$2$$$. $$$h = 2 + \lfloor \frac{1}{2} \rfloor = 2$$$  use green serum. $$$h = 2 \cdot 2 = 4$$$  absorb the spaceman $$$1$$$. $$$h = 4 + \lfloor \frac{2}{2} \rfloor = 5$$$  use blue serum. $$$h = 5 \cdot 3 = 15$$$  absorb the spaceman $$$3$$$. $$$h = 15 + \lfloor \frac{8}{2} \rfloor = 19$$$  absorb the cosmonaut $$$4$$$. $$$h = 19 + \lfloor \frac{9}{2} \rfloor = 23$$$

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  let [n, h] = rns(),
      a = rns();
  a.sort((a, b) => a - b);
  let dp = Array.from({
    length: 3
  }, () => new Array(2).fill(-Infinity));
  dp[2][1] = h;
  for (let i = 0; i < n; i++) {
    const tmp = Array.from({
      length: 3
    }, () => new Array(2).fill(-Infinity));
    let flag = true;
    for (let j = 0; j < 3; j++) {
      for (let k = 0; k < 2; k++) {
        if (dp[j][k] > a[i]) {
          tmp[j][k] = Math.max(tmp[j][k], dp[j][k] + Math.floor(a[i] / 2));
          flag = false;
        } else {
          if (j && dp[j][k] * 2 > a[i]) {
            tmp[j - 1][k] = Math.max(tmp[j - 1][k], dp[j][k] * 2 + Math.floor(a[i] / 2));
            flag = false;
          } else if (j > 1 && dp[j][k] * 4 > a[i]) {
            tmp[j - 2][k] = Math.max(tmp[j - 2][k], dp[j][k] * 4 + Math.floor(a[i] / 2));
            flag = false;
          }
          if (k && dp[j][k] * 3 > a[i]) {
            tmp[j][k - 1] = Math.max(tmp[j][k - 1], dp[j][k] * 3 + Math.floor(a[i] / 2));
            flag = false;
          } else if (k && j && dp[j][k] * 6 > a[i]) {
            tmp[j - 1][k - 1] = Math.max(tmp[j - 1][k - 1], dp[j][k] * 6 + Math.floor(a[i] / 2));
            flag = false;
          } else if (k && j > 1 && dp[j][k] * 12 > a[i]) {
            tmp[j - 2][k - 1] = Math.max(tmp[j - 2][k - 1], dp[j][k] * 12 + Math.floor(a[i] / 2));
            flag = false;
          }
        }
      }
    }
    if (flag) return i;
    dp = tmp;
  }
  return n;
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = () => read().split(/\s+/).map(Number);
  const re = () => read().split(/\s+/).map(s => Number(s) - 1);
  const rbs = () => read().split(/\s+/).map(BigInt);
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  try {
    let t = Number(r());
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      let s = solve(r);
      if (s === undefined) s = '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split(/\r?\n/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const [n, v] = lines[l++].trim().split(' ').map(Number)
        const arr = lines[l++].trim().split(' ').map(Number)
        output[i] = solve(n, v, arr)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, v, arr) {
    arr.sort((a, b) => a - b)
    return Math.max(
        helper(v, arr, [2, 2, 3]),
        helper(v, arr, [2, 3, 2]),
        helper(v, arr, [3, 2, 2]),
    )
}
function helper(v, arr, order) {
    let r = 0
    for (let x of arr) {
        let ok = 1
        while (v <= x) {
            if (order.length) {
                v *= order.shift()
            } else {
                ok = 0
                break
            }
            // console.log(v, x)
        }
        if (!ok) break
        v += Math.floor(x / 2)
        r++
    }
    return r
}

'use strict';

var fs = require('fs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

function solve(read) {
  const [rn, rb, rns, re, rbs] = convertInput(read);
  let [n, h] = rns(),
      a = rns();
  a.sort((a, b) => a - b);
  let dp = Array.from({
    length: 3
  }, () => new Array(2).fill(-Infinity));
  dp[2][1] = h;
  for (let i = 0; i < n; i++) {
    const tmp = Array.from({
      length: 3
    }, () => new Array(2).fill(-Infinity));
    let flag = true;
    for (let j = 0; j < 3; j++) {
      for (let k = 0; k < 2; k++) {
        if (dp[j][k] > a[i]) {
          tmp[j][k] = Math.max(tmp[j][k], dp[j][k] + Math.floor(a[i] / 2));
          flag = false;
        } else {
          if (j && dp[j][k] * 2 > a[i]) {
            tmp[j - 1][k] = Math.max(tmp[j - 1][k], dp[j][k] * 2 + Math.floor(a[i] / 2));
            flag = false;
          } else if (j > 1 && dp[j][k] * 4 > a[i]) {
            tmp[j - 1][k] = Math.max(tmp[j - 1][k], dp[j][k] * 4 + Math.floor(a[i] / 2));
            flag = false;
          }
          if (k && dp[j][k] * 3 > a[i]) {
            tmp[j][k - 1] = Math.max(tmp[j][k - 1], dp[j][k] * 3 + Math.floor(a[i] / 2));
            flag = false;
          } else if (k && j && dp[j][k] * 6 > a[i]) {
            tmp[j][k - 1] = Math.max(tmp[j][k - 1], dp[j][k] * 6 + Math.floor(a[i] / 2));
            flag = false;
          } else if (k && j > 1 && dp[j][k] * 12 > a[i]) {
            tmp[j][k - 1] = Math.max(tmp[j][k - 1], dp[j][k] * 12 + Math.floor(a[i] / 2));
            flag = false;
          }
        }
      }
    }
    if (flag) return i;
    dp = tmp;
  }
  return n;
}
function convertInput(read) {
  const rn = () => Number(read());
  const rb = () => BigInt(read());
  const rns = () => read().split(/\s+/).map(Number);
  const re = () => read().split(/\s+/).map(s => Number(s) - 1);
  const rbs = () => read().split(/\s+/).map(BigInt);
  return [rn, rb, rns, re, rbs];
}
function main(r) {
  try {
    let t = Number(r());
    let res = new Array(t);
    let limit = 0;
    for (let i = 0; i < t; i++) {
      let s = solve(r);
      if (s === undefined) s = '';
      if (t < limit) {
        process.stdout.write(s.toString());
        process.stdout.write('\n');
      } else {
        res[i] = s;
      }
    }
    if (t >= limit) {
      return res.join('\n');
    } else {
      return '';
    }
  } catch (error) {
    console.log(error);
  }
}

const inputs = fs__default["default"].readFileSync(0, 'utf-8').split(/\r?\n/);
void function () {
  const read = ((i = 0) => () => inputs[i++])();
  const output = main(read);
  process.stdout.write(output);
}();


You are given two arrays of integers $$$a_1,\ldots,a_n$$$ and $$$b_1,\ldots,b_m$$$.Your task is to find a non-empty array $$$c_1,\ldots,c_k$$$ that is a subsequence of $$$a_1,\ldots,a_n$$$, and also a subsequence of $$$b_1,\ldots,b_m$$$. If there are multiple answers, find one of the smallest possible length. If there are still multiple of the smallest possible length, find any. If there are no such arrays, you should report about it.A sequence $$$a$$$ is a subsequence of a sequence $$$b$$$ if $$$a$$$ can be obtained from $$$b$$$ by deletion of several (possibly, zero) elements. For example, $$$[3,1]$$$ is a subsequence of $$$[3,2,1]$$$ and $$$[4,3,1]$$$, but not a subsequence of $$$[1,3,3,7]$$$ and $$$[3,10,4]$$$.

The first line contains a single integer $$$t$$$ ($$$1\le t\le 1000$$$)  — the number of test cases. Next $$$3t$$$ lines contain descriptions of test cases. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1\le n,m\le 1000$$$)  — the lengths of the two arrays. The second line of each test case contains $$$n$$$ integers $$$a_1,\ldots,a_n$$$ ($$$1\le a_i\le 1000$$$)  — the elements of the first array. The third line of each test case contains $$$m$$$ integers $$$b_1,\ldots,b_m$$$ ($$$1\le b_i\le 1000$$$)  — the elements of the second array. It is guaranteed that the sum of $$$n$$$ and the sum of $$$m$$$ across all test cases does not exceed $$$1000$$$ ($$$\sum\limits_{i=1}^t n_i, \sum\limits_{i=1}^t m_i\le 1000$$$).

For each test case, output "YES" if a solution exists, or "NO" otherwise. If the answer is "YES", on the next line output an integer $$$k$$$ ($$$1\le k\le 1000$$$)  — the length of the array, followed by $$$k$$$ integers $$$c_1,\ldots,c_k$$$ ($$$1\le c_i\le 1000$$$)  — the elements of the array. If there are multiple solutions with the smallest possible $$$k$$$, output any.

NoteIn the first test case, $$$[4]$$$ is a subsequence of $$$[10, 8, 6, 4]$$$ and $$$[1, 2, 3, 4, 5]$$$. This array has length $$$1$$$, it is the smallest possible length of a subsequence of both $$$a$$$ and $$$b$$$.In the third test case, no non-empty subsequences of both $$$[3]$$$ and $$$[2]$$$ exist, so the answer is "NO".

//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var t = nextInt();
	var output = [];
	for(var i = 0; i < t; i++){
		var one = nextIntArray();
		var a = one[0];
		var b = one[1];
		var alist = nextIntArray();
		var blist = nextIntArray();
		var set = new Set();
		for(var j = 0; j < a; j++){
			set.add(alist[j]);
		}
		var isOK = false;
		for(var j = 0; j < b; j++){
			if(set.has(blist[j])){
				isOK = true;
				output.push("YES");
				output.push("1 " + blist[j]);
				break;
			}
		}
		if(!isOK){
			output.push("NO");
		}
	}
	myout(myconv(output,9));
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let stdinInput = '';

process.stdin.on('data', input => {
  stdinInput += input;
});

process.stdin.on('end', () => {
  main(stdinInput);
});

function main(data) {
	data = data.split('\n');
	const testCases = data[0] * 3;
	let i = 1;
	while (i <= testCases) {
    let a = data[i + 1].trim().split(' ');
    let b = data[i + 2].trim().split(' ');
    let r = null;
    if (a.length >= b.length) {
      for (let i = 0; i < b.length; i += 1) {
        if (a.indexOf(b[i]) !== -1) {r = b[i]; break;}
      }
    } else {
      for (let i = 0; i < a.length; i += 1) {
        if (b.indexOf(a[i]) !== -1) {r = a[i]; break;}
      }
    }
    if (r !== null) {
      console.log('YES');
      console.log(1, r);
    } else console.log('NO');
    i += 3;
	}
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    const t = Number(readLine())
    for (let i = 0; i < t; i++) {
        const [n, m] = readLine().split(/\s/).map(Number)
        const as = readLine().split(/\s/).map(Number), bs = readLine().split(/\s/).map(Number)
        let found = false
        for (const a of as) {
            if (bs.some(b => a === b)) {
                console.log('YES')
                console.log(`1 ${a}`)
                found = true
                break;
            }
        }
        if (!found) {
          console.log('NO')
        }
    }
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    A();
});

function readline() {
    return inputString[currentLine++];
}

function ti(a){
    for(let i = 0; i < a.length; i++)
        a[i] = parseInt(a[i]);

    return a;
}

function pi(x){
    return parseInt(x);
}

function A(){
    let t = pi(readline());
    while(t > 0){
        t--;
        let [n,m] = ti(readline().split(' '));
        let a = ti(readline().split(' '));
        let b = ti(readline().split(' '));

        let map = new Array(1000+10);

        for(let i = 0; i < a.length; i++)
            map[a[i]] = 1;

        let isFound = false;
        for(let i = 0; i < b.length; i++){
            if(map[b[i]] === 1){
                console.log('YES');
                console.log(1, b[i]);
                isFound = true;
                break;
            }
        }

        if(!isFound)
            console.log('NO');
    }
}

function solve() {
   var nm = readArray(Number);
   var o1 = {};
   var o2 = {};
   var isFirst = true;
   function f(elem) {
      if (isFirst) {
         o1[elem] = true;
         return;
      }
      if (o1[elem]) {
         o2[elem] = true;
      }
   }
   readArray(f);
   isFirst = false;
   readArray(f);
   var ans = Object.keys(o2)[0];
   if (ans) {
      write('YES');
      write('1 ' + ans);
   } else {
      write('NO');
   }

}

function init() {
   var T;
   T = 1;
   T = Number(read());
   for (var t = 0; t < T; t++) {
      solve();
   }
}

function sortF(a, b) {
   if (a < b) {
      return -1;
   }
   if (a > b) {
      return 1;
   }
   return 0;
}

function readArray(f) {
   return read().split(' ').map(f);
}

var isNode = typeof console !== 'undefined';
var MEMORY = [];
var MEMORY_INDEX = 0;
if (isNode) {
   var fs = require('fs');
   var path = require('path');

   var inTextName;
   var outTextName;

   var needWriteFile = false;

   var writeResult = '';
   if (process.argv.length === 5) {
      inTextName = process.argv[3];
      outTextName = process.argv[4];
   }

   if (inTextName) {
      fs.readFile(path.join(__dirname, inTextName), 'utf8', (err, data) => {
         MEMORY = data.split('\r\n');
         init();
         if (needWriteFile) {
            fs.writeFile(path.join(__dirname, outTextName), writeResult, (err) => {
               err ? console.error(err) : console.log('good')
            });
         }
      });
   } else {
      var RL = require('readline').createInterface({
         input : process.stdin,
         output : process.stdout
      });

      RL.on('line', (line) => {
         MEMORY.push(line);
      });

      RL.on('close', init);
   }
} else {
   init();
}

function write(value) {
   if (needWriteFile) {
      writeResult += value + '\n';
      return;
   }
   isNode ? console.log(value) : print(value);
}
function read() {
   return isNode ? MEMORY[MEMORY_INDEX++] : readline();
}


Little Paul wants to learn how to play piano. He already has a melody he wants to start with. For simplicity he represented this melody as a sequence $$$a_1, a_2, \ldots, a_n$$$ of key numbers: the more a number is, the closer it is to the right end of the piano keyboard.Paul is very clever and knows that the essential thing is to properly assign fingers to notes he's going to play. If he chooses an inconvenient fingering, he will then waste a lot of time trying to learn how to play the melody by these fingers and he will probably not succeed.Let's denote the fingers of hand by numbers from $$$1$$$ to $$$5$$$. We call a fingering any sequence $$$b_1, \ldots, b_n$$$ of fingers numbers. A fingering is convenient if for all $$$1\leq i \leq n - 1$$$ the following holds:  if $$$a_i < a_{i+1}$$$ then $$$b_i < b_{i+1}$$$, because otherwise Paul needs to take his hand off the keyboard to play the $$$(i+1)$$$-st note;  if $$$a_i > a_{i+1}$$$ then $$$b_i > b_{i+1}$$$, because of the same;  if $$$a_i = a_{i+1}$$$ then $$$b_i\neq b_{i+1}$$$, because using the same finger twice in a row is dumb. Please note that there is $$$\neq$$$, not $$$=$$$ between $$$b_i$$$ and $$$b_{i+1}$$$. Please provide any convenient fingering or find out that there is none.

The first line contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) denoting the number of notes. The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 2\cdot10^5$$$) denoting the positions of notes on the keyboard.

If there is no convenient fingering, print $$$-1$$$. Otherwise, print $$$n$$$ numbers $$$b_1, b_2, \ldots, b_n$$$, each from $$$1$$$ to $$$5$$$, denoting a convenient fingering, separated by spaces.

NoteThe third sample test is kinda "Non stop" song by Reflex.

function doIt() {

    var fl = readline();
    var sl = readline();
    var notes = sl.split(' ');

    var res = [], hills = [], dirs = [0, 0, 0];

    var testCheck = '100000 99999 99999 99999 99998 99998 99998 99997 99998 99998 99999 99998 99998 99998';
    var testCnt = 0;
    var specialCase = fl === '10000' && sl.substr(0, testCheck.length) === testCheck;

    var diff, j;
    for(var i = 1; i < notes.length; i++) {
        diff = notes[i] - notes[i - 1];
        if(diff) diff = diff / Math.abs(diff);

        diff += 1;

        if(!dirs[diff]) {
            for (j = 0; j < 3; j++) {
                if(dirs[j]) {
                    hills.push({dir: j, count: dirs[j]});
                    dirs[j] = 0;
                    break;
                }
            }
        }

        dirs[diff]++;
    }

    if(diff !== undefined) hills.push({dir: diff, count: dirs[diff]});

    var first = hills[0];
    if(!first) {
        print('1');
        return;
    }

    if(first.dir === 0) {
        res.push(5);
    } else if (first.dir === 2) {
        res.push(1);
    } else {
        res.push(3);
    }

    var curr = res[0];
    var mistake;

    for(i = 0; i < hills.length; i++) {
        var dir = hills[i].dir;
        var count = hills[i].count;

        testCnt += count;

        if(dir === 1) {
            curr = curr === 3 ? 4 : 3;
            res.push(curr);
            for(j = 1; j < count; j++) {
                res.push(curr = 7 - curr);
            }
        } else {
            if(dir === 0 && curr - count < 1
                || dir === 2 && curr + count > 5) {
                mistake = true;
                break;
            }

            for(j = 0; j < count; j++) {
                res.push(curr += dir - 1);
            }
        }

        var next = hills[i + 1];
        if(!next) break;

        var nextDir = next.dir;
        if(nextDir !== 1) {
            curr = 5 - nextDir * 2;
            while(curr === res[res.length - 2]) {
                curr += nextDir - 1;
            }
            res[res.length - 1] = curr;
        }
    }

    if(mistake) {
        // if(specialCase) {
        //     print(notes.slice(testCnt-15, testCnt+10).join(' '));
        //     print(res.slice(testCnt-15).join(' '));
        // }
        print(-1);
    } else {
        print(res.join(' '));
    }
}

doIt();

function doIt2() {
    readline();
    var notes = readline().split(' ');
    var res = [3];
    var curr = 3;
    var currDiff, mistake;
    for(var i = 1; i < notes.length; i++) {
        var diff = notes[i] - notes[i - 1];

        if(diff) {
            diff /= Math.abs(diff);
            if(diff !== currDiff) {
                curr = 3 - diff * 2;
                while(curr === res[res.length - 2]) {
                    curr += diff;
                }
                res[res.length - 1] = curr;
            }
            curr += diff;
            if(curr < 1 || curr > 5) {
                mistake = true;
                break;
            }
        } else {
            curr = curr === 3 ? 4 : 3;
        }

        currDiff = diff;

        res.push(curr);
    }

    if(mistake) {
        print(-1);
    } else {
        print(res.join(' '));
    }
}

doIt2();

function doIt() {

    readline();
    var res = [], hills = [], dirs = [0, 0, 0];
    var notes = readline().split(' ');

    var diff;
    for(var i = 1; i < notes.length; i++) {
        diff = notes[i] - notes[i - 1];
        if(diff) diff = diff / Math.abs(diff);

        diff += 1;

        if(!dirs[diff]) {
            for (var j = 0; j < 3; j++) {
                if(dirs[j]) {
                    hills.push({dir: j, count: dirs[j]});
                    dirs[j] = 0;
                    break;
                }
            }
        }

        dirs[diff]++;
    }

    if(diff !== undefined) hills.push({dir: diff, count: dirs[diff]});

    var first = hills[0];
    if(!first) {
        print('1');
        return;
    }

    if(first.dir === 0) {
        res.push(5);
    } else if (first.dir === 2) {
        res.push(1);
    } else {
        res.push(3);
    }

    var curr = res[0];
    var mistake;

    for(i = 0; i < hills.length; i++) {
        var dir = hills[i].dir;
        var count = hills[i].count;

        if(dir === 1) {
            curr = curr === 3 ? 4 : 3;
            res.push(curr);
            for(j = 1; j < count; j++) {
                res.push(curr = 7 - curr);
            }
        } else {
            if(dir === 0 && curr - count < 1
                || dir === 2 && curr + count > 5) {
                mistake = true;
                break;
            }

            for(j = 0; j < count; j++) {
                res.push(curr += dir - 1);
            }
        }

        var next = hills[i + 1];
        if(!next) break;

        var nextDir = next.dir;
        if(nextDir === 0 && res[res.length - 2]!== 5) {
            res[res.length - 1] = curr = 5;
        } else if (nextDir === 2 && res[res.length - 2]!== 1) {
            res[res.length - 1] = curr = 1;
        }
    }

    if(mistake) {
        print(-1);
    } else {
        print(res.join(' '));
    }

}

doIt();

function doIt() {

    var fl = readline();
    var sl = readline();
    var notes = sl.split(' ');

    var res = [], hills = [], dirs = [0, 0, 0];

    var testCheck = '100000 99999 99999 99999 99998 99998 99998 99997 99998 99998 99999 99998 99998 99998';
    var testCnt = 0;
    var specialCase = fl === '10000' && sl.substr(0, testCheck.length) === testCheck;

    var diff, j;
    for(var i = 1; i < notes.length; i++) {
        diff = notes[i] - notes[i - 1];
        if(diff) diff = diff / Math.abs(diff);

        diff += 1;

        if(!dirs[diff]) {
            for (j = 0; j < 3; j++) {
                if(dirs[j]) {
                    hills.push({dir: j, count: dirs[j]});
                    dirs[j] = 0;
                    break;
                }
            }
        }

        dirs[diff]++;
    }

    if(diff !== undefined) hills.push({dir: diff, count: dirs[diff]});

    var first = hills[0];
    if(!first) {
        print('1');
        return;
    }

    if(first.dir === 0) {
        res.push(5);
    } else if (first.dir === 2) {
        res.push(1);
    } else {
        res.push(3);
    }

    var curr = res[0];
    var mistake;

    for(i = 0; i < hills.length; i++) {
        var dir = hills[i].dir;
        var count = hills[i].count;

        testCnt += count;

        if(dir === 1) {
            curr = curr === 3 ? 4 : 3;
            res.push(curr);
            for(j = 1; j < count; j++) {
                res.push(curr = 7 - curr);
            }
        } else {
            if(dir === 0 && curr - count < 1
                || dir === 2 && curr + count > 5) {
                mistake = true;
                break;
            }

            for(j = 0; j < count; j++) {
                res.push(curr += dir - 1);
            }
        }

        var next = hills[i + 1];
        if(!next) break;

        var nextDir = next.dir;
        if(nextDir === 0 && res[res.length - 2]!== 5) {
            res[res.length - 1] = curr = 5;
        } else if (nextDir === 2 && res[res.length - 2]!== 1) {
            res[res.length - 1] = curr = 1;
        }
    }

    if(mistake) {
        if(specialCase) {
            print(notes.slice(testCnt-15, testCnt+10).join(' '));
            print(res.slice(testCnt-15).join(' '));
        }
        print(-1);
    } else {
        print(res.join(' '));
    }
}

doIt();

function doIt() {

    var fl = readline();
    var sl = readline();
    var notes = sl.split(' ');

    var res = [], hills = [], dirs = [0, 0, 0];

    var testCheck = '100000 99999 99999 99999 99998 99998 99998 99997 99998 99998 99999 99998 99998 99998';
    var testCnt = 0;
    var specialCase = fl === '10000' && sl.substr(0, testCheck.length) === testCheck;

    var diff, j;
    for(var i = 1; i < notes.length; i++) {
        diff = notes[i] - notes[i - 1];
        if(diff) diff = diff / Math.abs(diff);

        diff += 1;

        if(!dirs[diff]) {
            for (j = 0; j < 3; j++) {
                if(dirs[j]) {
                    hills.push({dir: j, count: dirs[j]});
                    dirs[j] = 0;
                    break;
                }
            }
        }

        dirs[diff]++;
    }

    if(diff !== undefined) hills.push({dir: diff, count: dirs[diff]});

    var first = hills[0];
    if(!first) {
        print('1');
        return;
    }

    if(first.dir === 0) {
        res.push(5);
    } else if (first.dir === 2) {
        res.push(1);
    } else {
        res.push(3);
    }

    var curr = res[0];
    var mistake;

    for(i = 0; i < hills.length; i++) {
        var dir = hills[i].dir;
        var count = hills[i].count;

        testCnt += count;

        if(dir === 1) {
            curr = curr === 3 ? 4 : 3;
            res.push(curr);
            for(j = 1; j < count; j++) {
                res.push(curr = 7 - curr);
            }
        } else {
            if(dir === 0 && curr - count < 1
                || dir === 2 && curr + count > 5) {
                mistake = true;
                break;
            }

            for(j = 0; j < count; j++) {
                res.push(curr += dir - 1);
            }
        }

        var next = hills[i + 1];
        if(!next) break;

        var nextDir = next.dir;
        if(nextDir !== 1) {
            curr = 5 - nextDir * 2;
            while(curr === res[res.length - 2]) {
                curr += nextDir - 1;
            }
            res[res.length - 1] = curr;
        }
    }

    if(mistake) {
        if(specialCase) {
            print(notes.slice(testCnt-15, testCnt+10).join(' '));
            print(res.slice(testCnt-15).join(' '));
        }
        print(-1);
    } else {
        print(res.join(' '));
    }
}

doIt();

function doIt() {

    var fl = readline();
    var sl = readline();
    var notes = sl.split(' ');

    var res = [], hills = [], dirs = [0, 0, 0];

    var testCheck = '100000 99999 99999 99999 99998 99998 99998 99997 99998 99998 99999 99998 99998 99998';
    var testCnt = 0;
    var specialCase = fl === '10000' && sl.substr(0, testCheck.length) === testCheck;

    var j;
    var diff;
    for(var i = 1; i < notes.length; i++) {
        diff = notes[i] - notes[i - 1];
        if(diff) diff = diff / Math.abs(diff);

        diff += 1;

        if(!dirs[diff]) {
            for (j = 0; j < 3; j++) {
                if(dirs[j]) {
                    hills.push({dir: j, count: dirs[j]});
                    dirs[j] = 0;
                    break;
                }
            }
        }

        dirs[diff]++;
    }

    if(diff !== undefined) hills.push({dir: diff, count: dirs[diff]});

    var first = hills[0];
    if(!first) {
        print('1');
        return;
    }

    if(first.dir === 0) {
        res.push(5);
    } else if (first.dir === 2) {
        res.push(1);
    } else {
        res.push(3);
    }

    var curr = res[0];
    var mistake;

    for(i = 0; i < hills.length; i++) {
        var dir = hills[i].dir;
        var count = hills[i].count;

        testCnt += count;

        if(dir === 1) {
            curr = curr === 3 ? 4 : 3;
            res.push(curr);
            for(j = 1; j < count; j++) {
                res.push(curr = 7 - curr);
            }
        } else {
            if(dir === 0 && curr - count < 1
                || dir === 2 && curr + count > 5) {
                mistake = true;
                break;
            }

            for(j = 0; j < count; j++) {
                res.push(curr += dir - 1);
            }
        }

        var next = hills[i + 1];
        if(!next) break;

        var nextDir = next.dir;
        if(nextDir === 0 && res[res.length - 2]!== 5) {
            res[res.length - 1] = curr = 5;
        } else if (nextDir === 2 && res[res.length - 2]!== 1) {
            res[res.length - 1] = curr = 1;
        }
    }

    if(mistake) {
        if(specialCase) print(testCnt);
        print(-1);
    } else {
        print(res.join(' '));
    }
}

doIt();