#CCBCHBA0000121. Đếm ô trên và dưới chéo (Count Cells Above and Below Diagonal)
Đếm ô trên và dưới chéo (Count Cells Above and Below Diagonal)
Count Cells Above and Below Diagonal
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
In an -by- grid with 1-based row and column , count cells above the main diagonal () and below it (). Cells with are excluded.
Input
One line contains integer .
Output
Print two integers: the count above the diagonal followed by the count below it.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
3
Output:
3 3
Explanation:
Count ij separately; exclude i=j.
Example 2
Input:
1
Output:
0 0
Explanation:
Count ij separately; exclude i=j.