Who saw Div2C today and then said "Ooooh, it is very clear.....segment tree/sparse table with Binary Search ^_^" Are there anyone other than me or am I an Alien? :) I even built the whole range query structure like I was preparing for war. (I have it in my template) Turns out… it was a simple loop with a few ifs and mins. But hey, at least my overkill solution was a bit fast!



