Counting Domino Spots
Time limit2sMemory limit512 MB
Compute the total number of spots over all distinct unordered pairs of mark values from 0 to N.
- Level
Easy3 of 10
- Topics
- Math, Combinatorics
- Solved
- No attempts yet
Problem
Dominoes are pieces used in many tile games. Each domino piece has two marks, and each mark carries or more spots. The size of the set decides how many spots a mark can carry: in a set of size , every mark carries between and spots, inclusive.
Two pieces are the same piece if their two marks carry the same numbers of spots, whatever the reading order. A piece with marks of and spots is the same as a piece with marks of and spots. A proper domino set never holds the same piece twice. The complete set of size holds one copy of every possible piece whose marks carry at most spots. For example, the complete set of size consists of pieces.

Write a program that computes the total number of spots on all pieces of the complete set of size .
Input
The first and only line contains the size of the complete set. ()
Output
Print the total number of spots in the complete set of size .