IDENTIFICATION DIVISION.
PROGRAM-ID. 158B.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP        PIC X(100).
01 A          PIC 9(3).
01 B          PIC 9(3).
01 T1         PIC 9(3).
01 T2         PIC 9(3).
01 P1         PIC 9(4).
01 P2         PIC 9(4).
01 PRI        PIC 9(4).
01 OUT-PRI    PIC ----9.
*> 
PROCEDURE DIVISION.
MAIN-001.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO A B.
*>  
  COMPUTE P1 ROUNDED = A * 12.5
  COMPUTE P2 = B * 10
  IF (P1 > P2)
    MOVE P1 TO PRI
  ELSE
    MOVE P2 TO PRI
  END-IF
*>
  COMPUTE T1 = PRI * 0.08
  COMPUTE T2 = PRI * 0.1
*>
  IF (T1 NOT = A) OR (T2 NOT = B)
    MOVE -1  TO OUT-PRI
  ELSE
    MOVE PRI TO OUT-PRI
  END-IF

  DISPLAY OUT-PRI.
 
MAIN-EXIT.
  STOP RUN.
