1312 Continuous natural numbers and

Source: Internet
Author: User

1312 Continuous natural numbers and

time limit: 1 sspace limit: 128000 KBtitle level: Golden Gold SolvingView Run ResultsTitle Description Description

For a natural number m, all contiguous natural number segments are calculated, making all the numbers of these contiguous natural segments and M.
eg:1998+1999+2000+2001+2002=10000, so a natural number segment from 1998 to 2002 is a solution to the m=10000.

Enter a description Input Description

A few M

Output description Output Description

Two numbers per line, one end of a continuous natural number segment, and the first number of all output lines in ascending order

Sample input Sample Input

10000

Sample output Sample Output

18 142

297 328

388 412

1998 2002

Data range and Tips Data Size & HintCategory labels Tags Click here to expandArithmetical Number theory bye, enumerate the flood questions! AC Code
#include <iostream>using namespacestd;intMain () {intM;cin>>m;  for(intI=1; i<m;i++){        intp=0;  for(intj=i;p<m;j++) {p+=J; if(p==L) {cout<<i<<" "<<j<<"\ n";  Break; }        }    }    return 0;}

1312 Continuous natural numbers and

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.