
function calc(art, x, y) {
 console.log(y);
 switch (art) {
 case 1:
  return x + y;
 case 2:
   if (y === null) return x * 2;
  else return x / y;
 }
 var e = 0;
 for (var i = 0; i < x; i++) {
  e += y * x + i;
 }
 return e;
}

