Help needed in solving spoj problem PYTRIP

Revision en1, by Bob_and_Vagene, 2017-05-23 19:40:31

Problem link : http://www.spoj.com/problems/PYTRIP/

I am not able to think of any other solution except brute force and also, i am unable to find any pattern or something. If anyone could please give me a hint in approaching the problem or provide a reference to any material that you think might be helpful would be great.

Tags math, range query

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Bob_and_Vagene 2017-05-23 19:40:31 371 Initial revision (published)