#P14117. [SCCPC 2021] Chuanpai
[SCCPC 2021] Chuanpai
题目描述
(川牌) is a kind of traditional playing cards in Sichuan. Each card is marked with two integers and where .
:::align{center}
Some samples of Chuanpai.
The first one is marked with and , while the second one is marked with and . :::
Given an integer , please count the number of different types of cards satisfying .
We say two cards with integers , and , are of different types if or .
输入格式
There are multiple test cases. The first line of the input contains an integer () indicating the number of test cases. For each test case:
The first and only line contains an integer ().
输出格式
For each test case output one line containing one integer, indicating the number of types of cards satisfying .
4
4
5
8
100
2
2
3
0
提示
We use to indicate a type of card whose and .
For the first sample test case the valid types of cards are and .
For the second sample test case the valid types of cards are and .
For the third sample test case the valid types of cards are , and .