#CCBCHBAHAI0000159. Phần tử đầu tiên lớn hơn x (First Element Greater Than x)
Phần tử đầu tiên lớn hơn x (First Element Greater Than x)
First Element Greater Than x
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given an integer array and an integer , find the smallest -based index such that
If no element is greater than , print -1.
Input
- The first line contains integers and .
- The second line contains integers .
Output
Print the first index whose value is greater than , or -1 if none exists.
Subtasks
Subtask 1 (100 points): ; .
Examples
Input
6 10
3 10 9 12 15 1
Output
3
Explanation
Indices contain , none of which is greater than . At index , , so the answer is 3.