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

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

CF:32A. Reconnaissance

2023-06-10 12:11 作者:您是打尖兒還是住店呢  | 我要投稿

According to the regulations of Berland's army, a reconnaissance unit should consist of exactly two soldiers. Since these two soldiers shouldn't differ much, their heights can differ by at most?d?centimeters. Captain Bob has?n?soldiers in his detachment. Their heights are?a1,?a2,?...,?an?centimeters. Some soldiers are of the same height. Bob wants to know, how many ways exist to form a reconnaissance unit of two soldiers from his detachment.

Ways?(1,?2)?and?(2,?1)?should be regarded as different.

Input

The first line contains two integers?n?and?d?(1?≤?n?≤?1000,?1?≤?d?≤?109) — amount of soldiers in Bob's detachment and the maximum allowed height difference respectively. The second line contains?n?space-separated integers — heights of all the soldiers in Bob's detachment. These numbers don't exceed?109.

Output

Output one number — amount of ways to form a reconnaissance unit of two soldiers, whose height difference doesn't exceed?d.

相似的問題:


CF:32A. Reconnaissance的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
敦化市| 溆浦县| 施甸县| 清河县| 祁阳县| 海原县| 花莲县| 沈阳市| 镇原县| 庆城县| 仪陇县| 石台县| 阿勒泰市| 金溪县| 五台县| 广平县| 舒城县| 盱眙县| 略阳县| 扬州市| 鄱阳县| 石泉县| 博爱县| 安新县| 寻乌县| 银川市| 临江市| 城口县| 日土县| 凌海市| 屏南县| 皮山县| 竹溪县| 海晏县| 壤塘县| 新郑市| 元氏县| 临江市| 特克斯县| 沭阳县| 邵东县|