CF522D Closest Equals
Description
You are given sequence $ a_{1},a_{2},...,a_{n} $ and $ m $ queries $ l_{j},r_{j} $ ( $ 1
Input Format
The first line of the input contains a pair of integers $ n $ , $ m $ ( $ 1
Output Format
Print $ m $ integers — the answers to each query. If there is no valid match for some query, please print -1 as an answer to this query.