favorite We need a little bit of your help to keep things running, click on this banner to learn more

PP2. Week 7: April 19 - 25


Create class Integer according to the next class diagram:


Given three integers a, b, c, calculate the value of expression (a * 7 + b - 2) * (a - c + 5).

interface MyNumber
  public long getValue();
  public MyInteger Add(long a);
  public MyInteger Add(MyInteger a);  
  public MyInteger Minus(long a);
  public MyInteger Minus(MyInteger a);
  public MyInteger Multiply(long a);
  public MyInteger Multiply(MyInteger a);
  public MyInteger Divide(long a);
  public MyInteger Divide(MyInteger a);  

class MyInteger implements MyNumber
  private long n;
  MyInteger(long n){


One line contains three integers a, b, c no more than 109 by absolute value.


Print the value of given expression.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1 2 3
Output example #1
Author Mykhailo Medvediev
Source Object Oriented Design