Given an array A of, N integers your task is to identify if there exists a set of exactly
three elements A [], [] I A J and. A [] such k that their summation equals to a given query
value. Moreover I, J and, K must be different. There will be multiple. Query values. For
each query you have, to identify if there exists such Input set.
.Education The first line of input contains two integers N (1 < = N < = 600) and M (1 < = M < = 200)
representing the number of elements in. The array and the number of queries.
- The second line contains N integers representing the value in the array A where
(− 500 000 000 < =,,, A [i] < =,, 500 000 000). The array A is already sorted.
- The third line contains M integers representing the queries. Let Q. Be the query
.Value, (− 500 000 000 < =,,,, Q < = 500 000 000)
There Output must be exactly M lines. Each line contains a word "YES." or "NO depends." On
if there exists a pair of elements of A the sum of which equal to each query respectively.
.
การแปล กรุณารอสักครู่..
