Cody

# Problem 1875. GJam: 2013 China Event: Cannon Angle

Solution 519663

Submitted on 3 Nov 2014
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   Fail
%% tic vd=[249 6326 ]; exp=44.5948575; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

2   Fail
%% vd=[77 41 ]; exp=1.9429163; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

3   Fail
%% vd=[28 11 ]; exp=3.9516039; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

4   Fail
%% vd=[105 21 ]; exp=0.5347917; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

5   Fail
%% vd=[147 51 ]; exp=0.6626633; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

6   Fail
%% vd=[300 3210 ]; exp=10.2293872; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

7   Fail
%% vd=[219 61 ]; exp=0.3570850; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

8   Fail
%% vd=[240 41 ]; exp=0.1998405; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

9   Fail
%% vd=[179 3269 ]; exp=44.5041154; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

10   Fail
%% vd=[300 3480 ]; exp=11.1338133; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

11   Fail
%% vd=[102 81 ]; exp=2.1878908; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

12   Fail
%% vd=[121 51 ]; exp=0.9781434; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

13   Fail
%% vd=[138 31 ]; exp=0.4570257; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

14   Fail
%% vd=[210 4500 ]; exp=45.0000000; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

15   Fail
%% vd=[192 3761 ]; exp=44.4745779; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

16   Fail
%% vd=[37 41 ]; exp=8.5337735; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

17   Fail
%% vd=[32 41 ]; exp=11.5514232; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

18   Fail
%% vd=[199 81 ]; exp=0.5742839; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

19   Fail
%% vd=[300 3360 ]; exp=10.7304643; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

20   Fail
%% vd=[233 71 ]; exp=0.3671784; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

21   Fail
%% vd=[266 81 ]; exp=0.3214027; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

22   Fail
%% vd=[27 21 ]; exp=8.1988972; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

23   Fail
%% vd=[279 21 ]; exp=0.0757408; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

24   Fail
%% vd=[300 5230 ]; exp=17.3572961; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

25   Fail
%% vd=[279 51 ]; exp=0.1839431; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

26   Fail
%% vd=[218 21 ]; exp=0.1240585; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

27   Fail
%% vd=[300 7690 ]; exp=28.4309587; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

28   Fail
%% vd=[89 31 ]; exp=1.0990234; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

29   Fail
%% vd=[141 2028 ]; exp=44.2618026; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

30   Fail
%% vd=[178 81 ]; exp=0.7178094; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

31   Fail
%% vd=[132 71 ]; exp=1.1443126; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

32   Fail
%% vd=[300 690 ]; exp=2.1544417; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

33   Fail
%% vd=[300 6970 ]; exp=24.6861041; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

34   Fail
%% vd=[41 1 ]; exp=0.1670142; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

35   Fail
%% vd=[123 21 ]; exp=0.3897097; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

36   Fail
%% vd=[48 61 ]; exp=7.5190650; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

37   Fail
%% vd=[77 81 ]; exp=3.8470546; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

38   Fail
%% vd=[152 71 ]; exp=0.8628902; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

39   Fail
%% vd=[267 11 ]; exp=0.0433201; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

40   Fail
%% vd=[164 21 ]; exp=0.2192071; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

41   Fail
%% vd=[300 4310 ]; exp=13.9947943; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

42   Fail
%% vd=[256 71 ]; exp=0.3041622; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

43   Fail
%% vd=[192 41 ]; exp=0.3122545; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

44   Fail
%% vd=[300 7110 ]; exp=25.3662790; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

45   Fail
%% vd=[98 31 ]; exp=0.9063600; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

46   Fail
%% vd=[286 21 ]; exp=0.0720786; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

47   Fail
%% vd=[44 91 ]; exp=13.7142226; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

48   Fail
%% vd=[300 8360 ]; exp=32.7741901; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

49   Fail
%% vd=[300 5060 ]; exp=16.7170592; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

50   Fail
%% vd=[194 81 ]; exp=0.6042720; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

51   Fail
%% vd=[96 61 ]; exp=1.8595639; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

52   Fail
%% vd=[190 1 ]; exp=0.0077770; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

53   Fail
%% vd=[237 51 ]; exp=0.2549165; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

54   Fail
%% vd=[52 31 ]; exp=3.2254600; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

55   Fail
%% vd=[250 71 ]; exp=0.3189378; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

56   Fail
%% vd=[29 61 ]; exp=22.6508544; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

57   Fail
%% vd=[300 4030 ]; exp=13.0143792; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

58   Fail
%% vd=[39 31 ]; exp=5.7607904; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

59   Fail
%% vd=[62 61 ]; exp=4.4733355; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

60   Fail
%% vd=[246 61 ]; exp=0.2829993; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

61   Fail
%% vd=[86 51 ]; exp=1.9374169; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

62   Fail
%% vd=[252 91 ]; exp=0.4023216; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

63   Fail
%% vd=[275 11 ]; exp=0.0408363; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

64   Fail
%% vd=[49 81 ]; exp=9.6529702; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

65   Fail
%% vd=[127 11 ]; exp=0.1914728; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

66   Fail
%% vd=[223 61 ]; exp=0.3443890; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

67   Fail
%% vd=[160 21 ]; exp=0.2303047; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

68   Fail
%% vd=[196 31 ]; exp=0.2265546; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

69   Fail
%% vd=[55 91 ]; exp=8.5730698; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

70   Fail
%% vd=[110 1234 ]; exp=44.0395169; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

71   Fail
%% vd=[274 61 ]; exp=0.2281140; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

72   Fail
%% vd=[300 6800 ]; exp=23.8846446; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

73   Fail
%% vd=[300 3310 ]; exp=10.5630642; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

74   Fail
%% vd=[44 31 ]; exp=4.5141266; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

75   Fail
%% vd=[295 1 ]; exp=0.0032261; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

76   Fail
%% vd=[64 11 ]; exp=0.7540525; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

77   Fail
%% vd=[240 21 ]; exp=0.1023567; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

78   Fail
%% vd=[91 21 ]; exp=0.7120327; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

79   Fail
%% vd=[300 1870 ]; exp=5.8744286; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

80   Fail
%% vd=[300 1730 ]; exp=5.4290641; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

81   Fail
%% vd=[259 51 ]; exp=0.2134486; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

82   Fail
%% vd=[51 91 ]; exp=10.0258563; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

83   Fail
%% vd=[300 4200 ]; exp=13.6075829; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

84   Fail
%% vd=[262 81 ]; exp=0.3312919; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

85   Fail
%% vd=[74 81 ]; exp=4.1674764; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

86   Fail
%% vd=[88 81 ]; exp=2.9417237; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

87   Fail
%% vd=[255 91 ]; exp=0.3929103; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

88   Fail
%% vd=[72 41 ]; exp=2.2226617; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

89   Fail
%% vd=[300 7900 ]; exp=29.6707716; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

90   Fail
%% vd=[300 1620 ]; exp=5.0800699; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

91   Fail
%% vd=[253 71 ]; exp=0.3114186; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

92   Fail
%% vd=[265 91 ]; exp=0.3638145; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

93   Fail
%% vd=[248 1 ]; exp=0.0045647; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

94   Fail
%% vd=[300 6090 ]; exp=20.7696393; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

95   Fail
%% vd=[158 71 ]; exp=0.7985813; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

96   Fail
%% vd=[300 2170 ]; exp=6.8338053; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

97   Fail
%% vd=[300 1500 ]; exp=4.7002140; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

98   Fail
%% vd=[163 31 ]; exp=0.3275780; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

99   Fail
%% vd=[139 31 ]; exp=0.4504729; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

100   Fail
%% vd=[271 21 ]; exp=0.0802786; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

101   Fail
%% vd=[113 41 ]; exp=0.9016072; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

102   Fail
%% vd=[156 81 ]; exp=0.9346125; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

103   Fail
%% vd=[100 61 ]; exp=1.7135925; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

104   Fail
%% vd=[85 91 ]; exp=3.5451226; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.

105   Fail
%% vd=[43 61 ]; exp=9.4316060; theta=Cannon(vd(1),vd(2)); assert(abs(theta-exp)<2e-6)

Error: Undefined function 'vd' for input arguments of type 'double'.