How to solve this problem ?

Правка en1, от code_hard123, 2017-03-18 12:25:03

Given N points in two dimensional space and Q queries. In each query, given two non negative integers a , b. Find the point (x,y) such that F(x,y) is minimum, where F(x,y) = a * x + b * y

Constraints:
1 <= N <= 10^6
1 <= Q <= 10^5
0 <= a , b <= 10^9
0 <= |x| , |y| <= 10^9

Thank You!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский code_hard123 2017-03-18 12:25:03 347 Initial revision (published)