# In an array of integers verify whether a given element is a row-peak. An element is said to be row-peak if it is a row-wise local maxima i.e it is strictly greater than its adjacent row neighbours.

**Input Format:** The first line of input contains the size n of the array. Then n lines of input follow giving the contents of the array. The next line contains the number of test cases t. This is followed by t lines each of which contains the corresponding indices of the element which you have to verify.

**Output Format:** You must output “Yes” or “No” in a separate line for each test case. Output “Yes” if the corresponding test case holds the required property else print “No”.

**Variable Constraints:** The size of the array is smaller than 20. The contents of the array are integers in the range from -32768 to 32767.

/*

Logic:

– Firstly we take input of size of array and then the elements of array.

– Assume max=0 i.e. the element at 0th position is maximum.

– Take input of number of test case.

– For each test case i.e. index

– if index equals max optput yes

– if not output no.

*/

#include<stdio.h> int main(){ int arr[20],n,t,i,max=0,index; // Input of size of array. scanf("%d",&n); // Input of array elements. for(i=0;i<n;i++){ scanf("%d",&arr[i]); // Checking if current element is greater than our max if(arr[i]>arr[max]) max=i; } // Input of number of test case. scanf("%d",&t); // Input of number of test cases for(i=0;i<t;i++){ // Input of index scanf("%d",&index); // Comparison with index of max. if(index==max){ printf("YESn"); }else{ printf("NOn"); } } return 0; }