{"comment":{"url":"https://api.github.com/repos/thomastien/hackerrank/comments/15235466","html_url":"https://github.com/thomastien/hackerrank/commit/0f4149369380c0de8e926a557db9a2f458915b4f#commitcomment-15235466","id":15235466,"user":{"login":"thomastien","id":14099429,"avatar_url":"https://avatars.githubusercontent.com/u/14099429?v=3","gravatar_id":"","url":"https://api.github.com/users/thomastien","html_url":"https://github.com/thomastien","followers_url":"https://api.github.com/users/thomastien/followers","following_url":"https://api.github.com/users/thomastien/following{/other_user}","gists_url":"https://api.github.com/users/thomastien/gists{/gist_id}","starred_url":"https://api.github.com/users/thomastien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomastien/subscriptions","organizations_url":"https://api.github.com/users/thomastien/orgs","repos_url":"https://api.github.com/users/thomastien/repos","events_url":"https://api.github.com/users/thomastien/events{/privacy}","received_events_url":"https://api.github.com/users/thomastien/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"0f4149369380c0de8e926a557db9a2f458915b4f","created_at":"2016-01-03T22:15:25Z","updated_at":"2016-01-03T22:15:25Z","body":"Problem Statement\r\n\r\nThis problem is a programming version of Problem 6 from projecteuler.net\r\n\r\nThe sum of the squares of the first ten natural numbers is, 12+22+...+102=385. The square of the sum of the first ten natural numbers is, (1+2+⋯+10)2=552=3025. Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025−385=2640.\r\n\r\nFind the difference between the sum of the squares of the first N natural numbers and the square of the sum.\r\n\r\nInput Format \r\nFirst line contains T that denotes the number of test cases. This is followed by T lines, each containing an integer, N.\r\n\r\nOutput Format \r\nPrint the required answer for each test case.\r\n\r\nConstraints \r\n1≤T≤104 \r\n1≤N≤104\r\n\r\nSample Input\r\n2\r\n3\r\n10\r\n\r\nSample Output\r\n22\r\n2640"}}