FastCode Challenge: Binary Sum

This is a sample problem. Good luck!

Create a program to add signed 64-bit integers without concern for overflow. That is, you will not be given a problem in which overflow of signed 64-bit integers occurs.

Input

Each dataset is a binary file whose length is a multiple of eight. Each 8-byte group is one little endian integer. For example the following shows the output from hexdump of input.bin, a possible input file.

$ hexdump -e '16/1 "%02x " "\n"' input.bin
01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
03 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
06 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF
FE FF FF FF FF FF FF FF

The file described above contains the following sequence of integers: 1, 2, 3, 4, 6, -1, and -2.

Output

Your program should compute the sum of all integers provided. For example the above input should produce the following.

{
    "answer" : 13
}