16 BIT S/W ONLY

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

One day you woke up, finding yourself back in 1992. It would seem that the gypsy wife of the wizened old monk whose voodoo shop you smash up every day after school has cast a spell on you.

Early in the production process of the 80386, Intel discovered a fatal bug in the processor, which they of course fixed. The bug involved errors when performing 32-bit multiplication. But by the time they fixed the issue, a number of processors were already produced, and they decided that it would be a shame to throw them all out. It was decided that these processors would be sold at a reduced price with the tag 16 BIT S/W ONLY (16 bit software only). Conversely, the newer processors which don't have the bug instead have two sigmas (ΣΣ) stamped on. We will call them DOUBLE SIGMA processors.

Back in 1985, 32-bit software was something out of reach of most consumers. Even in 1989, the ancient 8086 was sold as new technology. Hence, there is a market for the defective processors.

You, a programmer, decided to get a programming job in the 1992 world so you can survive until you find a way to return to the modern age. In a cluster of servers, some of them use the 16 BIT S/W ONLY processors, but you don't know which ones. Your first job is to determine the bad processors from the 32-bit multiplication results.

The 80386 has an instruction to multiply two 32-bit integers into a 64-bit result, conventionally stored in EDX:EAX register (i.e. temporary variable) pairs because there were no 64-bit registers.

Input Specification

The first line of input will be the integer N such that 1 \le N \le 1\,000. The next N lines of input will contain integers A, B, and P, such that -2^{31} \le A, B < 2^{31} and -2^{63} \le P < 2^{63}.

Output Specification

For every line of input except the first, output 16 BIT S/W ONLY if the product is wrong (i.e. A \times B \ne P), or POSSIBLE DOUBLE SIGMA if correct.

Sample Input

3
1 1 2
2147483647 2147483647 4611686014132420610
12345678 87654321 1082152022374638

Sample Output

16 BIT S/W ONLY
16 BIT S/W ONLY
POSSIBLE DOUBLE SIGMA

Comments


  • -3
    Pimienta  commented on March 24, 2022, 10:19 p.m.

    Epic Problem Nice story Even a picture... 'll be sweet if also the harder problems came with this kind of description; must of them don't


  • -7
    Cryptid  commented on Dec. 16, 2021, 6:26 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -3
      Ousama  commented on Feb. 20, 2022, 9:42 a.m.

      the first n is the range to which the operation is repeated. as you can see from the input we have three operation because it's already declared in the first line n = 3 if the first line has, let's say n=5 then we would have 5 operations.


    • 2
      uselessleaf  commented on Dec. 16, 2021, 8:32 a.m. edited

      Reread what you said and the problem statement very carefully to answer your question.

      If it's still somehow unclear, join the DMOJ Discord to get clarification.


      • -15
        Cryptid  commented on Dec. 17, 2021, 6:43 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


        • -3
          iCode  commented on March 2, 2022, 9:03 a.m.

          N is the amount of times you would want to take the users input for 3 integers(A,B, and P). For example, if N=2, you would take the users input for the values of A,B, and P twice.


  • -3
    瞬间爆炸  commented on Jan. 6, 2021, 9:01 p.m.

    How do I create another class when submitting solutions in Java?


    • -3
      Evanhyd  commented on Jan. 6, 2021, 11:07 p.m.

      firstly, you don't really another class in this case. If you do, please consider checking your program logic. You can create a class before the main class


  • -27
    lior5654cst  commented on Aug. 24, 2020, 6:02 p.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


    • 1
      noYou  commented on Aug. 26, 2020, 10:15 a.m.

      When you write one.


  • -12
    349081547  commented on Jan. 3, 2019, 10:42 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 27
    felixzhang25  commented on March 4, 2018, 10:20 a.m.

    do not click the link "the gypsy wife of the wizened old monk whose voodoo shop you smash up every day after school" at the top


    • -4
      planT_444  commented on Feb. 15, 2022, 5:41 p.m.

      thanks i had a good laugh


  • 4
    TheWrinklyCheese  commented on Dec. 17, 2017, 2:06 p.m.

    The Backstory in this is truly amazing and totally makes sense.


  • -13
    qata  commented on Feb. 10, 2017, 8:25 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • 4
      quantum  commented on Feb. 10, 2017, 10:02 p.m.

      53-bit floating point is not exactly accurate for potentially 64-bit numbers.


  • 32
    Oppenheimer  commented on June 16, 2016, 8:30 p.m.

    Feels bad when it takes me 5 tries to do a 3-pt problem... Man, I've gone really rusty from 6 months of not programming. Good thing DMOJ can help shake off my rust!


  • -2
    LuxTheOmnicaster  commented on June 15, 2016, 10:36 p.m.

    IR (Stopped (signal)) is a message I got. What's it supposed to denote?

    Thanks.


    • 8
      Kirito  commented on June 16, 2016, 11:15 a.m. edited

      Turing's ints are too small, and the won't fit in var.

      This causes the interpreter to throw an exception.

      Moral of the story: unless you want to code your own bigNumbers class, don't use Turing.