#include using namespace std; #define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr ) #define CIN( LL , A ) LL A; cin >> A #define TYPE_OF( VAR ) remove_const::type >::type #define FOREQ( VAR , INITIAL , FINAL ) for( TYPE_OF( FINAL ) VAR = INITIAL ; VAR <= FINAL ; VAR ++ ) #define QUIT return 0 #define RETURN( ANSWER ) cout << ( ANSWER ) << "\n"; QUIT template inline T Absolute( const T& a ){ return a > 0 ? a : - a; } int main() { UNTIE; CIN( int , N ); assert( 1 <= N && N <= 10 ); CIN( int , S ); assert( 1 <= S && S <= 10 ); CIN( int , K ); assert( 0 <= K && K <= 10 ); int R; int opt = K + 1; int opt_current; int Ai; FOREQ( i , 1 , N ){ cin >> Ai; opt_current = Absolute( Ai - S ); if( opt_current < opt ){ R = i; opt = opt_current; } } if( opt <= K ){ RETURN( R ); } RETURN( "Unlucky!" ); }