#include <bits/stdc++.h>
using namespace std;
int upperBound(vector<int> &arr, int x, int n){
// Write your code here.
int l=0,h=n-1;
while(l<=h){
int m=(l+h)/2;
if(arr[m]==x){
l=m+1;
}else if(arr[m]>x){
h=m-1;
}else{
l=m+1;
}
}
return l;
}
int main() {
// your code goes here
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCB1cHBlckJvdW5kKHZlY3RvcjxpbnQ+ICZhcnIsIGludCB4LCBpbnQgbil7CgkvLyBXcml0ZSB5b3VyIGNvZGUgaGVyZS4JCglpbnQgbD0wLGg9bi0xOwoJd2hpbGUobDw9aCl7CgkJaW50IG09KGwraCkvMjsKCQlpZihhcnJbbV09PXgpewoJCQlsPW0rMTsKCQl9ZWxzZSBpZihhcnJbbV0+eCl7CgkJCWg9bS0xOwoJCX1lbHNlewoJCQlsPW0rMTsKCQl9Cgl9CglyZXR1cm4gbDsKfQppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCXJldHVybiAwOwp9