intermediate non-working (TLE) solution to uva11402
implemented solution to uva11402 - Ahoy, Pirates! , with Segment Tree, now efficient enough, gets AC in 4.1s