五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

CF 1743A - Password

2023-08-19 12:17 作者:您是打尖兒還是住店呢  | 我要投稿

Monocarp has forgotten the password to his mobile phone. The password consists of 4 digits from 0 to 9 (note that it can start with the digit 0).

Monocarp remembers that his password had exactly two different digits, and each of these digits appeared exactly two times in the password. Monocarp also remembers some digits which were definitely not used in the password.


You have to calculate the number of different sequences of 4 digits that could be the password for Monocarp's mobile phone (i.?e. these sequences should meet all constraints on Monocarp's password).


Input

The first line contains a single integer t (1≤t≤200) — the number of testcases.


The first line of each testcase contains a single integer n (1≤n≤8) — the number of digits for which Monocarp remembers that they were not used in the password.

The second line contains n different integers a1,a2,…an (0≤ai≤9) representing the digits that were not used in the password. Note that the digits a1,a2,…,an are given in ascending order.


Output

For each testcase, print one integer — the number of different 4-digit sequences that meet the constraints.

------------------------------

Monocarp 忘記了手機(jī)密碼。 密碼由0到9的4位數(shù)字組成(注意可以以數(shù)字0開頭)。

Monocarp 記得他的密碼恰好有兩個(gè)不同的數(shù)字,并且每個(gè)數(shù)字在密碼中都出現(xiàn)了兩次。 Monocarp 還記得一些密碼中絕對(duì)沒有使用的數(shù)字。


您必須計(jì)算可能成為 Monocarp 手機(jī)密碼的不同 4 位數(shù)字序列的數(shù)量(即這些序列應(yīng)滿足 Monocarp 密碼的所有限制)。


輸入

第一行包含一個(gè)整數(shù) t (1≤t≤200) — 測(cè)試用例的數(shù)量。


每個(gè)測(cè)試用例的第一行包含一個(gè)整數(shù) n (1≤n≤8) — Monocarp 記住密碼中未使用的位數(shù)。

第二行包含n個(gè)不同的整數(shù)a1,a2,…an (0≤ai≤9),代表密碼中未使用的數(shù)字。 請(qǐng)注意,數(shù)字 a1,a2,…,an 按升序給出。


輸出

對(duì)于每個(gè)測(cè)試用例,打印一個(gè)整數(shù)——滿足約束的不同 4 位序列的數(shù)量。

---------------------

高中數(shù)學(xué)里面的排列組合,easy題目;

下面是代碼:


CF 1743A - Password的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
钟祥市| 河北省| 萨嘎县| 镇坪县| 措美县| 鹤庆县| 杨浦区| 栾城县| 故城县| 黎城县| 巴东县| 南安市| 嘉禾县| 宁化县| 丹棱县| 兰州市| 郴州市| 黄大仙区| 瓮安县| 江陵县| 华安县| 龙泉市| 望江县| 射阳县| 清流县| 汤阴县| 阳原县| 攀枝花市| 奉贤区| 逊克县| 清苑县| 黔江区| 塘沽区| 崇阳县| 宜城市| 尼勒克县| 鄄城县| 波密县| 威远县| 土默特右旗| 沂源县|