CCCJQR P4

View as PDF

Submit solution

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

Authors:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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

Input Specification

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

The next N lines will contain two integers, A and B, separated by a space. (0 \leq \left|A\right|, \left|B\right|, \left|result\right| \leq 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


  • -5
    charliezhao06  commented on Feb. 29, 2020, 1:10 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • 2
    IanHu  commented on Dec. 30, 2018, 4:45 p.m.

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


  • -2
    Kirito  commented on June 26, 2016, 11:55 a.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, 4:08 p.m.

      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.


      • -2
        Kirito  commented on June 26, 2016, 7:46 p.m.

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


        • -2
          Xyene  commented on June 26, 2016, 9:01 p.m.

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