Best guess in the random game
InterviewTime limit1sMemory limit256 MB
Pick the number from 1 to N whose interval of radius K covers the most hidden values and report its coverage count.
Problem
The grader picks one integer uniformly at random between 1 and . Call that integer . Without seeing , you print one integer between 1 and , and you win when .
Find the that wins with the highest probability. When several values of tie, take the smallest one. Also count how many values of let that win.
Input
The first line contains two integers and separated by one space. (, )
Output
On the first line, print the smallest among those with the highest winning probability, then the number of values of that satisfy for that , separated by one space.