What is the mathematical logic behind the solution?

Revision en1, by Evan_Shareef, 2020-09-24 08:36:19

A pattern can be seen in the solution that the result will be equal to (n/2)*m . May be I am missing any mathematical concept behind this reason. Can anyone provide me the mathematical logic behind the solution? Why is this working?

Problem: https://vjudge.net/problem/LightOJ-1294

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Evan_Shareef 2020-09-24 08:36:19 338 Initial revision (published)