当前位置:Gxlcms > mysql > CodeforcesRound#261(Div.2)B.PashmakandFlowers(容易)

CodeforcesRound#261(Div.2)B.PashmakandFlowers(容易)

时间:2021-07-01 10:21:17 帮助过:35人阅读

Pashmak decided to give Parmida a pair of flowers from the garden. There are n flowers in the garden and the i -th of them has a beauty number b i . Parmida is a very strange girl so she doesn't want to have the two most beautiful flowers

Pashmak decided to give Parmida a pair of flowers from the garden. There are n flowers in the garden and the i-th of them has a beauty number bi. Parmida is a very strange girl so she doesn't want to have the two most beautiful flowers necessarily. She wants to have those pairs of flowers that their beauty difference is maximal possible!

Your task is to write a program which calculates two things:

  1. The maximum beauty difference of flowers that Pashmak can give to Parmida.
  2. The number of ways that Pashmak can pick the flowers. Two ways are considered different if and only if there is at least one flower that is chosen in the first way and not chosen in the second way.

人气教程排行