CCCJQR P4

View as PDF

Submit solution

Points: 0
Time limit: 1.0s
Memory limit: 41M

Authors:
Problem type

Given two things, A and B, determine either (A+B) or (A-B).

Input Specification

The first line will contain N (1 \le N \le 10^6).

The next N lines will contain two integers, A and B, separated by a space. (0 \le |A|, |B|, |result| \le 10^9)

Output Specification

On separate lines, output either (A+B) or (A-B).

Note: Only one of the two is correct.

Sample Input

6
184756 705432
10400600 48620
40116600 2704156
7296836 284923
739274 9001
42069 3829

Sample Output

-520676
10351980
42820756
7581759
748275
38240

Comments


  • -3
    charliezhao06  commented on Feb. 29, 2020, 6:10 p.m.

    42069 is in the sample input. COINCIDENCE? I THINK NOT.


  • 11
    IanHu  commented on Dec. 30, 2018, 9:45 p.m.

    What? I dont understand the question. when should I plus or minus


  • 0
    Kirito  commented on June 26, 2016, 3:55 p.m.

    I got: TLE (write syscall disallowed) I was submitting with Turing (like a n00b). What does this mean?


    • 1
      Xyene  commented on June 26, 2016, 8:08 p.m. edited

      Turing tried calling the write system call with -1 as the file descriptor (0=stdin, 1=stdout, 2=stderr), and the sandbox denied it. This would have been displayed as an RTE, but the submission TLE'd a short time later and TLE overrides RTE.


      • 0
        Kirito  commented on June 26, 2016, 11:46 p.m.

        Not really good with Linux, but why it would do this?


        • 2
          Xyene  commented on June 27, 2016, 1:01 a.m.

          If I knew I'd tell you. There's no legitimate reason for it to do so, except maybe "because it's Turing".