it works succesfully but there is one site ,i take this problem form there it works 90% there. it is that problem :
Forest residents have decided to hold a hockey tournament between the N teams. How many ways can be distributed sets of gold, silver and bronze medals, if one prize may take only one team?
Specifications
Input
In a single line located a unique natural number N, does not exceed 100.
You need to solve how many 3(=k) permutations is in n many team.
There is mathematical formula so solve it:
total numbers of permutations=n!/[(n-k)!]
so if there is 17 teams trying to get 3 medals the answer is:
17!/[(17-3)!]
=17!/(14!)
=4080