CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #901 #903 →

#902. Elements less than x

You get a list sorted in increasing order and x. Use binary search to find how many elements are strictly less than x. ### Input The first line has n, the second line has n integers separated by spaces. (sorted) The third line has x. ### Output A number.

Examples

Input
11
2 15 20 21 25 28 29 32 34 41 42
2
Output
0
Input
14
0 7 11 14 26 27 30 33 36 37 45 46 48 50
7
Output
1

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!