Attachment 'Sav_1_cercled_h(~500).py'

Download

   1 def chf(n):
   2 	lst = (1, )
   3 	c = 1
   4 	for i in xrange(1, n+1):
   5 		c *= i
   6 		lst += (c, )
   7 	return lst
   8 
   9 
  10 n = input()
  11 k = input()
  12 flst = chf(n-2)
  13 l = 0
  14 
  15 for i in xrange(k):
  16 	for j in xrange(n-k):
  17 		l += flst[i+j]*flst[k-1]*flst[n-k-1]/(flst[i]*flst[j]*flst[i]*flst[k-1-i]*flst[j]*flst[n-k-1-j])
  18 print l

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.