Show your power
Author: Naimur Rahman
Problem Setter: Md Naimur Rahman (Joy)CSE 3rd year ,BSMRSTU.
Suppose you live in a computer world and you are a single
boy, you want to be double. In the computer world being double is not so hard
as our world, even you don’t need to propose. The only thing you have to do is to
show your power. Initially your power is P.
There are some girls in the computer world. Every girl has a beauty B and they are standing in increasing
order according to their beauty. That means less beauty girl will be in the
first position. Suppose there are four girls and their beauties are 4 3 2
1. They are standing (1 2 3 4) in this
order. To be double you must meet with some girl and have to show your power.
If your power is greater than or equal to that girl’s beauty, then the girl
will be impressed by you and fall in love with you. If a girl’s beauty is more
than your power, then she will not like you and you have to go other girls.
Remember that when you are showing your power, your power will not decrease, because
you are only showing it, not using it. You can show your power to multiple
girls.
Your goal is to impress girls as many as possible.
Input Format
The first line contains
one integer n (1 ≤ n ≤ 1000) — the number of girls.
The second line
contains n space separated integers
containing the beauty (1 ≤ b1 < b2 < b3 <
b4…. < bn ≤ 1000000000) in increasing order.
The third line contains one integer P(1 ≤ P ≤ 1000000000) your power.
Output Format
Print a single integer with a new line, how many girls will fall in love with you.
Samples
Input
Output
Language | Time | Memory |
GNU C 11 | 1s | 512MB |
GNU C++ 14 | 1s | 512MB |
GNU C++ 11 | 1s | 512MB |