Advertisement
bcbwilla

OcTc Team Difference

Sep 3rd, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. import math
  2.  
  3. def p(x):
  4.     """ Calculates maximum allowed difference in team size
  5.        x is the current size of the smallest team """
  6.    
  7.     if x == 0:
  8.         print x, 1
  9.     elif x <= 12:
  10.         print x, int(math.ceil(0.15*x))
  11.     else:
  12.         print x , int(math.ceil(math.log(x)))
  13.    
  14. print 'Smallest Team Size, Allowed Team Difference'
  15. for i in range(0,75):
  16.     p(i)
  17.  
  18. Output:
  19. Smallest Team Size, Allowed Team Difference
  20. 0 1
  21. 1 1
  22. 2 1
  23. 3 1
  24. 4 1
  25. 5 1
  26. 6 1
  27. 7 2
  28. 8 2
  29. 9 2
  30. 10 2
  31. 11 2
  32. 12 2
  33. 13 3
  34. 14 3
  35. 15 3
  36. 16 3
  37. 17 3
  38. 18 3
  39. 19 3
  40. 20 3
  41. 21 4
  42. 22 4
  43. 23 4
  44. 24 4
  45. 25 4
  46. 26 4
  47. 27 4
  48. 28 4
  49. 29 4
  50. 30 4
  51. 31 4
  52. 32 4
  53. 33 4
  54. 34 4
  55. 35 4
  56. 36 4
  57. 37 4
  58. 38 4
  59. 39 4
  60. 40 4
  61. 41 4
  62. 42 4
  63. 43 4
  64. 44 4
  65. 45 4
  66. 46 4
  67. 47 4
  68. 48 4
  69. 49 4
  70. 50 4
  71. 51 4
  72. 52 4
  73. 53 4
  74. 54 4
  75. 55 5
  76. 56 5
  77. 57 5
  78. 58 5
  79. 59 5
  80. 60 5
  81. 61 5
  82. 62 5
  83. 63 5
  84. 64 5
  85. 65 5
  86. 66 5
  87. 67 5
  88. 68 5
  89. 69 5
  90. 70 5
  91. 71 5
  92. 72 5
  93. 73 5
  94. 74 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement