Kraljevi
Mirko and Slavko are playing a chess like game. The game is played on a
non-standard chess board sized R rows by [] columns. Each player starts with some number of chess kings. In chess kings can move from their current field
to any of the 8 neighbouring fields.Player spread is defined as the complete sum of distances between all pairs of pieces of the given player. The distance between two pieces is the smallest number of moves required for both pieces to reach the same field.No actual moves are performed when calculating the distance and as such enemy pieces do not influence the result.Mirko knows that the spread is a vital piece of strategic information and would like you to make him a program that will calculate both his and Slavko's spread.
would be over.
first integers is the spread of Mirko's and the second Slavko's pieces.
[c]2 3
SMS
MMS
Output:
3 5Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.