ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1925. British Scientists Save the World

Here's the equation
Posted by Ajay Subhash Jadhav 5 Aug 2023 23:21
Just prepare the equation as described and solve for c=x,

display_sum + k - (entered_sum + x) == (n + 1) * 2;
display_sum + k - entered_sum - x = 2 * n + 2;
x = -2 * n - 2 + display_sum + k - entered_sum;

if x < 0 then Big Bang!