import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    } in.hasNext() in.hasNext in {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    } int N = in.nextInt(); N in.nextInt() in.nextInt in int L = in.nextInt(); L in.nextInt() in.nextInt in int[] appleTaste = new int[N]; appleTaste new int[N] N int totalTaste = 0; totalTaste 0 for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      } int i = 0; int i = 0; i 0 i < appleTaste.length i appleTaste.length appleTaste appleTaste.length ++i ++i i {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      } {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      } appleTaste[i] = L + i appleTaste[i] appleTaste i L + i L i totalTaste += appleTaste[i] totalTaste appleTaste[i] appleTaste i int closestTaste = -100000000; closestTaste -100000000 100000000 for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      } int i = 0; int i = 0; i 0 i < appleTaste.length i appleTaste.length appleTaste appleTaste.length ++i ++i i {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      } {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      } int tasteWithoutCurrent = totalTaste - appleTaste[i]; tasteWithoutCurrent totalTaste - appleTaste[i] totalTaste appleTaste[i] appleTaste i if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        } Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste) Math.abs(totalTaste - tasteWithoutCurrent) Math.abs Math totalTaste - tasteWithoutCurrent totalTaste tasteWithoutCurrent Math.abs(totalTaste - closestTaste) Math.abs Math totalTaste - closestTaste totalTaste closestTaste {
          closestTaste = tasteWithoutCurrent;
        } closestTaste = tasteWithoutCurrent closestTaste tasteWithoutCurrent System.out.println(closestTaste) System.out.println System.out System System.out closestTaste String[] args args public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    }
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int L = in.nextInt();
      int[] appleTaste = new int[N];
      int totalTaste = 0;
      
      for (int i = 0; i < appleTaste.length; ++i) {
        appleTaste[i] = L + i; // L + (i + 1) - i
        totalTaste += appleTaste[i];
      }

      int closestTaste = -100000000;
      for (int i = 0; i < appleTaste.length; ++i) {
        int tasteWithoutCurrent = totalTaste - appleTaste[i];
         
        if (Math.abs(totalTaste - tasteWithoutCurrent) < Math.abs(totalTaste - closestTaste)) {
          closestTaste = tasteWithoutCurrent;
        }
      }

      System.out.println(closestTaste);
    }
  }
}