Sollicitatievraag bij Luciq

2 problem solving questions. Codeforces style. Required basic math and binary search.