{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"You are given \u003cb\u003eN\u003c/b\u003e integers in sorted order. Also, you are given \u003cb\u003eQ\u003c/b\u003e queries. In each query, you will be given an integer and you have to tell whether that integer is present in the array. If so, you have to tell at which index it is present and if it is not present, you have to tell the index at which the smallest integer that is just greater than the given number is present."}},{"title":"Input","value":{"format":"MD","content":"The first line of the input contains the number of integers \u003cb\u003eN\u003c/b\u003e. The next line contains \u003cb\u003eN\u003c/b\u003e integers in sorted order. The next line contains \u003cb\u003eQ\u003c/b\u003e, the number of queries. Then \u003cb\u003eQ\u003c/b\u003e lines follow each containing a single integer \u003cb\u003eY\u003c/b\u003e.\n\nNote: If the same number is present multiple times, you have to print the first index at which it occurs. Also, the input is such that you always have an answer for each query."}},{"title":"Constrains","value":{"format":"MD","content":"\u003cul\u003e\n\u003cli\u003e\u003cb\u003e1≤N≤10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e\u003c/li\u003e\n\u003cli\u003e\u003cb\u003e1≤X\u003csub\u003ei\u003c/sub\u003e≤10\u003csup\u003e9\u003c/sup\u003e\u003c/b\u003e,where \u003cb\u003eX\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e is \u003cb\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/b\u003e element in the array.\u003c/li\u003e\n\u003cli\u003e\u003cb\u003e1≤Q≤10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e\u003c/li\u003e\n\u003cli\u003e\u003cb\u003e1≤Y≤10\u003csup\u003e9\u003c/sup\u003e\u003c/b\u003e\u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"Output","value":{"format":"MD","content":"For each query you have to print \"Yes\" (without the quotes) if the number is present and at which index(1-based) it is present separated by a space.\n\nIf the number is not present you have to print \"No\" (without the quotes) followed by the index of the next smallest number just greater than that number.\n\nYou have to output each query in a new line."}},{"title":"Sample","value":{"format":"MD","content":"\u003cdiv\u003e\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e8\n1 1 2 2 6 9 9 15\n4\n1\n4\n9\n15\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes 1\nNo 5\nYes 6\nYes 8\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e"}}]}