### Problem Statement

You may remember an old computer game called "The Incredible Machine". It was a game where you could simulate simple processes like balls falling, lasers shooting, or cats pursuing mice. Moreover, you were able to perform these observations with different values for gravitational acceleration.

Imagine a system with some unknown acceleration of gravity. There are N balls, each fixed initially at some height above the ground. You are given a int[] height, where the i-th element is the height of the i-th ball above the ground. At time 0, the first ball is set loose and it starts falling. When it reaches the ground, the second ball is instantly set loose, and so on. This continues until the last ball reaches the ground at time T.

Return the acceleration of gravity in this system. Neglect air resistance and any other resisting factors. The distance d travelled by an object falling for time t with no initial velocity in a system with gravitational acceleration g and no resisting factors is equal to d = 0.5 * g * t^2.

### Definition

 Class: IncredibleMachineEasy Method: gravitationalAcceleration Parameters: int[], int Returns: double Method signature: double gravitationalAcceleration(int[] height, int T) (be sure your method is public)

### Notes

-The returned value must have an absolute or relative error less than 1e-9.

### Constraints

-height will contain between 1 and 50 elements, inclusive.
-Each element of height will be between 1 and 100, inclusive.
-T will be between 1 and 100, inclusive.

### Examples

0)

 `{16,23,85,3,35,72,96,88,2,14,63}` `30`
`Returns: 9.803799620759717`
 That's an acceleration of gravity that might be somewhere on Earth's surface.
1)

 `{6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5}` `12`
`Returns: 26.73924541044107`
 And this is likely on Jupiter.
2)

 `{8,8}` `3`
`Returns: 7.111111111111111`
 That's a light one.
3)

 `{3,1,3,1,3}` `12`
`Returns: 0.7192306901503684`
 You could nearly fly under such conditions.

#### Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=10309

#### Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=13748&pm=10309

gojira_tc

#### Testers:

PabloGilberto , ivan_metelsky , Vasyl[alphacom]

Math
{"ft_lang_label":"__label__en","ft_lang_prob":0.91651505,"math_prob":0.9174077,"size":1349,"snap":"2022-40-2023-06","text_gpt3_token_len":303,"char_repetition_ratio":0.1063197,"word_repetition_ratio":0.026200874,"special_character_ratio":0.23202372,"punctuation_ratio":0.10810811,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97084,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-10-06T05:01:39Z\",\"WARC-Record-ID\":\"<urn:uuid:f3bf7777-fb05-4664-8297-24692f800cb4>\",\"Content-Length\":\"7108\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:85ddfa4b-bc04-46c2-b73b-931795af2584>\",\"WARC-Concurrent-To\":\"<urn:uuid:2b48ee0a-1706-43e2-af97-18fab6b62d12>\",\"WARC-IP-Address\":\"78.128.6.10\",\"WARC-Target-URI\":\"http://topcoder.bgcoder.com/print.php?id=2400\",\"WARC-Payload-Digest\":\"sha1:XXSB3XD45NJXA3NU23JRM3PPOSXGTVXC\",\"WARC-Block-Digest\":\"sha1:3VRU5TVR254Q65XL6O7CQ4FUCVGCV6AC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030337723.23_warc_CC-MAIN-20221006025949-20221006055949-00339.warc.gz\"}"}