As soon as I saw 61/256, I immediately recognized this problem. That constant is specifically chosen to make this problem solvable in a contest setting.
The tools you need to take this problem down to size are sin^2(x) + cos^2(x) = 1, sin(x) * cos(x) = (1/2)*sin(2x), and eventually the quadratic formula.
If you're using a computer program, STOP! This problem is solvable with purely analytic methods with just pencil, paper, and maybe a basic calculator to avoid arithmetic mistakes.