Square and Cubic and AC Hangzhou Electric

Source: Internet
Author: User

Sum of squares and cubic and

Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)

Total submission (s): 109261 Accepted Submission (s): 35235

Problem Description

Given a continuous number of integers, the sum of squares of all even numbers is calculated and all the odd cubic and.

Input

The input data contains multiple sets of test instances, each containing a row consisting of two integers m and N.

Output

For each set of input data, the output line should consist of two integers x and y, representing the sum of all the even squares of the consecutive integers in that segment and all the odd cubic and.

You can assume that a 32-bit integer is sufficient to save the result.

Sample Input

1 3

2 5

Sample Output

4 28

20 152

Author

Lcy

Source

C Language Programming exercises (i)

Square and Cubic and AC Hangzhou Electric

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.