Cody

Solution 1730343

Submitted on 19 Feb 2019 by Alfonso Nieto-Castanon
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
v=vote(10,7); assert(abs(v-0.176470588)<1e-8)

2   Pass
v=vote(9,2); assert(abs(v-0.636363636)<1e-8)

3   Pass
v=vote(6,4); assert(abs(v-0.200000000)<1e-8)

4   Pass
v=vote(3,0); assert(abs(v-1.000000000)<1e-8)

5   Pass
v=vote(10,5); assert(abs(v-0.333333333)<1e-8)

6   Pass
v=vote(6,2); assert(abs(v-0.500000000)<1e-8)

7   Pass
v=vote(9,7); assert(abs(v-0.125000000)<1e-8)

8   Pass
v=vote(8,2); assert(abs(v-0.600000000)<1e-8)

9   Pass
v=vote(3,1); assert(abs(v-0.500000000)<1e-8)

10   Pass
v=vote(6,5); assert(abs(v-0.090909091)<1e-8)

11   Pass
v=vote(7,1); assert(abs(v-0.750000000)<1e-8)

12   Pass
v=vote(6,1); assert(abs(v-0.714285714)<1e-8)

13   Pass
v=vote(2,0); assert(abs(v-1.000000000)<1e-8)

14   Pass
v=vote(4,1); assert(abs(v-0.600000000)<1e-8)

15   Pass
v=vote(10,9); assert(abs(v-0.052631579)<1e-8)

16   Pass
v=vote(7,0); assert(abs(v-1.000000000)<1e-8)

17   Pass
v=vote(7,6); assert(abs(v-0.076923077)<1e-8)

18   Pass
v=vote(3,1); assert(abs(v-0.500000000)<1e-8)

19   Pass
v=vote(4,1); assert(abs(v-0.600000000)<1e-8)

20   Pass
v=vote(8,6); assert(abs(v-0.142857143)<1e-8)

21   Pass
v=vote(6,2); assert(abs(v-0.500000000)<1e-8)

22   Pass
v=vote(8,3); assert(abs(v-0.454545455)<1e-8)

23   Pass
v=vote(8,5); assert(abs(v-0.230769231)<1e-8)

24   Pass
v=vote(8,0); assert(abs(v-1.000000000)<1e-8)

25   Pass
v=vote(8,7); assert(abs(v-0.066666667)<1e-8)

26   Pass
v=vote(8,6); assert(abs(v-0.142857143)<1e-8)

27   Pass
v=vote(9,2); assert(abs(v-0.636363636)<1e-8)

28   Pass
v=vote(10,4); assert(abs(v-0.428571429)<1e-8)

29   Pass
v=vote(7,6); assert(abs(v-0.076923077)<1e-8)

30   Pass
v=vote(9,3); assert(abs(v-0.500000000)<1e-8)

31   Pass
v=vote(10,4); assert(abs(v-0.428571429)<1e-8)

32   Pass
v=vote(10,5); assert(abs(v-0.333333333)<1e-8)

33   Pass
v=vote(5,0); assert(abs(v-1.000000000)<1e-8)

34   Pass
v=vote(8,0); assert(abs(v-1.000000000)<1e-8)

35   Pass
v=vote(9,1); assert(abs(v-0.800000000)<1e-8)

36   Pass
v=vote(3,1); assert(abs(v-0.500000000)<1e-8)

37   Pass
v=vote(10,8); assert(abs(v-0.111111111)<1e-8)

38   Pass
v=vote(7,4); assert(abs(v-0.272727273)<1e-8)

39   Pass
v=vote(7,4); assert(abs(v-0.272727273)<1e-8)

40   Pass
v=vote(4,1); assert(abs(v-0.600000000)<1e-8)

41   Pass
v=vote(9,5); assert(abs(v-0.285714286)<1e-8)

42   Pass
v=vote(3,2); assert(abs(v-0.200000000)<1e-8)

43   Pass
v=vote(7,2); assert(abs(v-0.555555556)<1e-8)

44   Pass
v=vote(5,2); assert(abs(v-0.428571429)<1e-8)

45   Pass
v=vote(2,0); assert(abs(v-1.000000000)<1e-8)

46   Pass
v=vote(5,3); assert(abs(v-0.250000000)<1e-8)

47   Pass
v=vote(10,1); assert(abs(v-0.818181818)<1e-8)

48   Pass
v=vote(8,6); assert(abs(v-0.142857143)<1e-8)

49   Pass
v=vote(9,0); assert(abs(v-1.000000000)<1e-8)

50   Pass
v=vote(10,7); assert(abs(v-0.176470588)<1e-8)

51   Pass
v=vote(8,4); assert(abs(v-0.333333333)<1e-8)

52   Pass
v=vote(2,1); assert(abs(v-0.333333333)<1e-8)

53   Pass
v=vote(8,0); assert(abs(v-1.000000000)<1e-8)

54   Pass
v=vote(8,6); assert(abs(v-0.142857143)<1e-8)

55   Pass
v=vote(6,1); assert(abs(v-0.714285714)<1e-8)

56   Pass
v=vote(8,0); assert(abs(v-1.000000000)<1e-8)

57   Pass
v=vote(9,3); assert(abs(v-0.500000000)<1e-8)

58   Pass
v=vote(7,6); assert(abs(v-0.076923077)<1e-8)

59   Pass
v=vote(10,4); assert(abs(v-0.428571429)<1e-8)

60   Pass
v=vote(5,0); assert(abs(v-1.000000000)<1e-8)

61   Pass
v=vote(5,2); assert(abs(v-0.428571429)<1e-8)

62   Pass
v=vote(10,1); assert(abs(v-0.818181818)<1e-8)

63   Pass
v=vote(7,4); assert(abs(v-0.272727273)<1e-8)

64   Pass
v=vote(6,2); assert(abs(v-0.500000000)<1e-8)

65   Pass
v=vote(6,3); assert(abs(v-0.333333333)<1e-8)

66   Pass
v=vote(4,3); assert(abs(v-0.142857143)<1e-8)

67   Pass
v=vote(10,9); assert(abs(v-0.052631579)<1e-8)

68   Pass
v=vote(10,6); assert(abs(v-0.250000000)<1e-8)

69   Pass
v=vote(7,2); assert(abs(v-0.555555556)<1e-8)

70   Pass
v=vote(9,5); assert(abs(v-0.285714286)<1e-8)

71   Pass
v=vote(2,1); assert(abs(v-0.333333333)<1e-8)

72   Pass
v=vote(8,4); assert(abs(v-0.333333333)<1e-8)

73   Pass
v=vote(7,5); assert(abs(v-0.166666667)<1e-8)

74   Pass
v=vote(10,6); assert(abs(v-0.250000000)<1e-8)

75   Pass
v=vote(5,3); assert(abs(v-0.250000000)<1e-8)

76   Pass
v=vote(10,0); assert(abs(v-1.000000000)<1e-8)

77   Pass
v=vote(8,0); assert(abs(v-1.000000000)<1e-8)

78   Pass
v=vote(4,2); assert(abs(v-0.333333333)<1e-8)

79   Pass
v=vote(1,0); assert(abs(v-1.000000000)<1e-8)

80   Pass
v=vote(8,6); assert(abs(v-0.142857143)<1e-8)

81   Pass
v=vote(10,3); assert(abs(v-0.538461538)<1e-8)

82   Pass
v=vote(4,0); assert(abs(v-1.000000000)<1e-8)

83   Pass
v=vote(9,8); assert(abs(v-0.058823529)<1e-8)

84   Pass
v=vote(6,5); assert(abs(v-0.090909091)<1e-8)

85   Pass
v=vote(10,0); assert(abs(v-1.000000000)<1e-8)

86   Pass
v=vote(7,2); assert(abs(v-0.555555556)<1e-8)

87   Pass
v=vote(5,2); assert(abs(v-0.428571429)<1e-8)

88   Pass
v=vote(5,1); assert(abs(v-0.666666667)<1e-8)

89   Pass
v=vote(9,1); assert(abs(v-0.800000000)<1e-8)

90   Pass
v=vote(5,1); assert(abs(v-0.666666667)<1e-8)

91   Pass
v=vote(5,3); assert(abs(v-0.250000000)<1e-8)

92   Pass
v=vote(6,4); assert(abs(v-0.200000000)<1e-8)

93   Pass
v=vote(6,0); assert(abs(v-1.000000000)<1e-8)

94   Pass
v=vote(6,1); assert(abs(v-0.714285714)<1e-8)

95   Pass
v=vote(4,2); assert(abs(v-0.333333333)<1e-8)

96   Pass
v=vote(10,1); assert(abs(v-0.818181818)<1e-8)

97   Pass
v=vote(7,6); assert(abs(v-0.076923077)<1e-8)

98   Pass
v=vote(6,5); assert(abs(v-0.090909091)<1e-8)

99   Pass
v=vote(5,4); assert(abs(v-0.111111111)<1e-8)

100   Pass
v=vote(6,0); assert(abs(v-1.000000000)<1e-8)