#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <typename T>
void ckmn(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void ckmx(T& a, T b) {
  a = max(a, b);
}
void rd(int& x) { scanf("%i", &x); }
void rd(long long& x) { scanf("%lld", &x); }
void rd(char* x) { scanf("%s", x); }
void rd(long double& x) { scanf("%lf", &x); }
void rd(string& x) { scanf("%s", &x); }
template <typename T1, typename T2>
void rd(pair<T1, T2>& x) {
  rd(x.first);
  rd(x.second);
}
template <typename T>
void rd(vector<T>& x) {
  for (T& i : x) rd(i);
}
template <typename T, typename... A>
void rd(T& x, A&... args) {
  rd(x);
  rd(args...);
}
template <typename T>
void rd() {
  T x;
  rd(x);
  return x;
}
int ri() {
  int x;
  rd(x);
  return x;
}
template <typename T>
vector<T> rv(int n) {
  vector<T> x(n);
  rd(x);
  return x;
}
template <typename T>
void ra(T a[], int n, int st = 1) {
  for (int i = 0; i < n; ++i) rd(a[st + i]);
}
template <typename T1, typename T2>
void ra(T1 a[], T2 b[], int n, int st = 1) {
  for (int i = 0; i < n; ++i) rd(a[st + i]), rd(b[st + i]);
}
template <typename T1, typename T2, typename T3>
void ra(T1 a[], T2 b[], T3 c[], int n, int st = 1) {
  for (int i = 0; i < n; ++i) rd(a[st + i]), rd(b[st + i]), rd(c[st + i]);
}
void re(vector<int> E[], int m, bool dir = 0) {
  for (int i = 0, u, v; i < m; ++i) {
    rd(u, v);
    E[u].push_back(v);
    if (!dir) E[v].push_back(u);
  }
}
template <typename T>
void re(vector<pair<int, T>> E[], int m, bool dir = 0) {
  for (int i = 0, u, v; i < m; ++i) {
    T w;
    rd(u, v, w);
    E[u].push_back({v, w});
    if (!dir) E[v].push_back({u, w});
  }
}
const long double eps = 1e-10;
const long double PI = acos(-1);
struct pt {
  long double x, y;
  pt() {}
  pt(int _x, int _y) : x(_x), y(_y) {}
  pt(long double _x, long double _y) : x(_x), y(_y) {}
};
pt operator-(pt a, pt b) { return pt(a.x - b.x, a.y - b.y); }
pt operator+(pt a, pt b) { return pt(a.x + b.x, a.y + b.y); }
pt operator*(pt a, long double b) { return pt(a.x * b, a.y * b); }
pt operator/(pt a, long double b) { return pt(a.x / b, a.y / b); }
long double cross(pt a, pt b) { return a.x * b.y - a.y * b.x; }
long double dot(pt a, pt b) { return a.x * b.x + a.y * b.y; }
long double sq(pt a) { return dot(a, a); }
long double abs(pt a) { return sqrt(dot(a, a)); }
long double sq_dist(pt a, pt b) { return sq(a - b); }
long double dist(pt a, pt b) { return abs(a - b); }
int sgn(long double x) { return x < 0 ? -1 : x > 0 ? 1 : 0; }
pt rot(pt a, long double alpha) {
  return pt(a.x * cos(alpha) - a.y * sin(alpha),
            a.x * sin(alpha) + a.y * cos(alpha));
}
pt norm(pt a) { return a / abs(a); }
long double norm(long double alpha) {
  while (alpha > PI) alpha -= 2 * PI;
  while (alpha <= PI) alpha += 2 * PI;
  return alpha;
}
long double ang(pt a) { return atan2(a.y, a.x); }
struct line {
  pt v;
  long double c;
  line(pt a, pt b) : v(a - b), c(cross(v, a)) {}
  long double side(pt p) { return c - cross(v, p); }
  long double dot(pt p) { return ::dot(v, p); }
  long double dist(pt p) { return abs(side(p)) / abs(v); }
};
struct circle {
  pt o;
  int r;
  circle() {}
  circle(int x, int y, int _r) : o(x, y), r(_r) {}
  bool sec(line l) {
    long double d = l.dist(o);
    if (d <= r - eps)
      return true;
    else
      return false;
  }
  bool is_tangent(line l) {
    long double d = l.dist(o);
    if (d > r - eps && d <= r + eps)
      return true;
    else
      return false;
  }
};
const int N = 1050;
circle C[N];
int n, k, sol;
int Solve() {
  sol = 1;
  for (int i = 1; i <= n; i++) {
    vector<pair<long double, int>> evs;
    int cnt = 0;
    for (int j = 1; j <= n; j++)
      if (j != i) {
        long double beta = ang(C[j].o - C[i].o);
        long double d = dist(C[i].o, C[j].o);
        long double L1 = beta + acos((C[i].r + C[j].r) / d) + eps;
        long double R1 = beta + abs(acos((C[i].r - C[j].r) / d));
        long double L2 = beta - abs(acos((C[i].r - C[j].r) / d));
        long double R2 = beta - acos((C[i].r + C[j].r) / d) - eps;
        L1 = norm(L1);
        R1 = norm(R1);
        L2 = norm(L2);
        R2 = norm(R2);
        if (L1 > R1) cnt++;
        evs.push_back({L1, 1});
        evs.push_back({R1, -1});
        if (L2 > R2) cnt++;
        evs.push_back({L2, 1});
        evs.push_back({R2, -1});
      }
    sort(evs.begin(), evs.end());
    for (auto e : evs) {
      ckmx(sol, cnt + 1);
      cnt += e.second;
    }
  }
  return sol;
}
int main() {
  rd(n, k);
  for (int i = 1; i <= n; i++) {
    int x, y, r;
    rd(x, y, r);
    C[i] = circle(x, y, r);
  }
  long long ans = (long long)k * (k - 1) / 2 + (long long)k * Solve() + n;
  printf("%lld\n", ans);
  return 0;
}

### Prompt

Your challenge is to write a Cpp solution to the following problem:

Anna's got a birthday today. She invited many guests and cooked a huge (nearly infinite) birthday cake decorated by n banana circles of different sizes. Maria's birthday is about to start in 7 minutes too, and while Anna is older, she decided to play the boss a little. She told Maria to cut the cake by k straight-line cuts (the cutting lines can intersect) to divide banana circles into banana pieces. 

Anna has many guests and she wants everyone to get at least one banana piece. That's why she told Maria to make the total number of banana pieces maximum. It's not a problem if some banana pieces end up on the same cake piece — the key is to make the maximum number of banana pieces. Determine what result Maria will achieve.

Input

The first line contains two integers n and k — the number of banana circles and the number of cuts Maria should perform (1 ≤ n ≤ 1000, 1 ≤ k ≤ 105). Next n lines contain the positions and sizes of the banana circles (all banana circles are round). On the cake the Cartesian coordinate system is defined. Each line contains three integers x, y and r — the coordinates of the center of the corresponding banana piece and its radius ( - 1000 ≤ x, y ≤ 1000, 1 ≤ r ≤ 1000).

It is guaranteed that the banana circles do not intersect, do not touch each other and do not overlap with each other.

Pretest 10 is big test with n = k = 1000.

Output

Print the only integer — the largest number of banana pieces that Maria can get after she performs the k straight-line cuts.

Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator.

Examples

Input

1 1
0 0 1


Output

2


Input

3 1
0 0 1
3 0 1
6 0 1


Output

6


Input

1 3
0 0 1


Output

7

### Response

```cpp
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <typename T>
void ckmn(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void ckmx(T& a, T b) {
  a = max(a, b);
}
void rd(int& x) { scanf("%i", &x); }
void rd(long long& x) { scanf("%lld", &x); }
void rd(char* x) { scanf("%s", x); }
void rd(long double& x) { scanf("%lf", &x); }
void rd(string& x) { scanf("%s", &x); }
template <typename T1, typename T2>
void rd(pair<T1, T2>& x) {
  rd(x.first);
  rd(x.second);
}
template <typename T>
void rd(vector<T>& x) {
  for (T& i : x) rd(i);
}
template <typename T, typename... A>
void rd(T& x, A&... args) {
  rd(x);
  rd(args...);
}
template <typename T>
void rd() {
  T x;
  rd(x);
  return x;
}
int ri() {
  int x;
  rd(x);
  return x;
}
template <typename T>
vector<T> rv(int n) {
  vector<T> x(n);
  rd(x);
  return x;
}
template <typename T>
void ra(T a[], int n, int st = 1) {
  for (int i = 0; i < n; ++i) rd(a[st + i]);
}
template <typename T1, typename T2>
void ra(T1 a[], T2 b[], int n, int st = 1) {
  for (int i = 0; i < n; ++i) rd(a[st + i]), rd(b[st + i]);
}
template <typename T1, typename T2, typename T3>
void ra(T1 a[], T2 b[], T3 c[], int n, int st = 1) {
  for (int i = 0; i < n; ++i) rd(a[st + i]), rd(b[st + i]), rd(c[st + i]);
}
void re(vector<int> E[], int m, bool dir = 0) {
  for (int i = 0, u, v; i < m; ++i) {
    rd(u, v);
    E[u].push_back(v);
    if (!dir) E[v].push_back(u);
  }
}
template <typename T>
void re(vector<pair<int, T>> E[], int m, bool dir = 0) {
  for (int i = 0, u, v; i < m; ++i) {
    T w;
    rd(u, v, w);
    E[u].push_back({v, w});
    if (!dir) E[v].push_back({u, w});
  }
}
const long double eps = 1e-10;
const long double PI = acos(-1);
struct pt {
  long double x, y;
  pt() {}
  pt(int _x, int _y) : x(_x), y(_y) {}
  pt(long double _x, long double _y) : x(_x), y(_y) {}
};
pt operator-(pt a, pt b) { return pt(a.x - b.x, a.y - b.y); }
pt operator+(pt a, pt b) { return pt(a.x + b.x, a.y + b.y); }
pt operator*(pt a, long double b) { return pt(a.x * b, a.y * b); }
pt operator/(pt a, long double b) { return pt(a.x / b, a.y / b); }
long double cross(pt a, pt b) { return a.x * b.y - a.y * b.x; }
long double dot(pt a, pt b) { return a.x * b.x + a.y * b.y; }
long double sq(pt a) { return dot(a, a); }
long double abs(pt a) { return sqrt(dot(a, a)); }
long double sq_dist(pt a, pt b) { return sq(a - b); }
long double dist(pt a, pt b) { return abs(a - b); }
int sgn(long double x) { return x < 0 ? -1 : x > 0 ? 1 : 0; }
pt rot(pt a, long double alpha) {
  return pt(a.x * cos(alpha) - a.y * sin(alpha),
            a.x * sin(alpha) + a.y * cos(alpha));
}
pt norm(pt a) { return a / abs(a); }
long double norm(long double alpha) {
  while (alpha > PI) alpha -= 2 * PI;
  while (alpha <= PI) alpha += 2 * PI;
  return alpha;
}
long double ang(pt a) { return atan2(a.y, a.x); }
struct line {
  pt v;
  long double c;
  line(pt a, pt b) : v(a - b), c(cross(v, a)) {}
  long double side(pt p) { return c - cross(v, p); }
  long double dot(pt p) { return ::dot(v, p); }
  long double dist(pt p) { return abs(side(p)) / abs(v); }
};
struct circle {
  pt o;
  int r;
  circle() {}
  circle(int x, int y, int _r) : o(x, y), r(_r) {}
  bool sec(line l) {
    long double d = l.dist(o);
    if (d <= r - eps)
      return true;
    else
      return false;
  }
  bool is_tangent(line l) {
    long double d = l.dist(o);
    if (d > r - eps && d <= r + eps)
      return true;
    else
      return false;
  }
};
const int N = 1050;
circle C[N];
int n, k, sol;
int Solve() {
  sol = 1;
  for (int i = 1; i <= n; i++) {
    vector<pair<long double, int>> evs;
    int cnt = 0;
    for (int j = 1; j <= n; j++)
      if (j != i) {
        long double beta = ang(C[j].o - C[i].o);
        long double d = dist(C[i].o, C[j].o);
        long double L1 = beta + acos((C[i].r + C[j].r) / d) + eps;
        long double R1 = beta + abs(acos((C[i].r - C[j].r) / d));
        long double L2 = beta - abs(acos((C[i].r - C[j].r) / d));
        long double R2 = beta - acos((C[i].r + C[j].r) / d) - eps;
        L1 = norm(L1);
        R1 = norm(R1);
        L2 = norm(L2);
        R2 = norm(R2);
        if (L1 > R1) cnt++;
        evs.push_back({L1, 1});
        evs.push_back({R1, -1});
        if (L2 > R2) cnt++;
        evs.push_back({L2, 1});
        evs.push_back({R2, -1});
      }
    sort(evs.begin(), evs.end());
    for (auto e : evs) {
      ckmx(sol, cnt + 1);
      cnt += e.second;
    }
  }
  return sol;
}
int main() {
  rd(n, k);
  for (int i = 1; i <= n; i++) {
    int x, y, r;
    rd(x, y, r);
    C[i] = circle(x, y, r);
  }
  long long ans = (long long)k * (k - 1) / 2 + (long long)k * Solve() + n;
  printf("%lld\n", ans);
  return 0;
}

```