/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/sherlock-and-minimax * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include #include #include #include #include #include using namespace std; // The min value will only occur at p, q, or the mean of two adjacent numbers in the sorted array. int main() { int n; int arr[100]; scanf("%d",&n); for (int i=0;i p && d < q) { for (int i=0;i