library SafeMath {
 
  /**
   * Add two uint256 values, throw in case of overflow.
   * @param x first value to add
   * @param y second value to add
   * @return x + y
   */
  function add (uint256 x, uint256 y) internal pure returns (uint256 z) {
    z = x + y;
    require(z >= x);
    return z;
  }

  /**
   * Subtract one uint256 value from another, throw in case of underflow.
   * @param x value to subtract from
   * @param y value to subtract
   * @return x - y
   */
  function sub (uint256 x, uint256 y) internal pure returns (uint256 z) {
    require (x >= y);
    z = x - y;
    return z;
  }

/**
  * @dev Multiplies two numbers, reverts on overflow.
  */
    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
   
    if (a == 0) return 0;
    c = a * b;
    require(c / a == b);
    return c;
  }
  
   /**
  * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256 c) {
    require(b > 0); // Solidity only automatically asserts when dividing by 0
    c = a / b;
    return c;
  }
}
//v8 
function add (uint256 x, uint256 y) internal pure returns (uint256 z) {
  z = x + y;
  require(z >= x);
  return z;
}

/**
 * Add two uint256 values, throw in case of overflow.
 * @param x first value to add
 * @param y second value to add
 * @return x + y
 */