---
# System prepended metadata

title: C0d3

---

![image](https://hackmd.io/_uploads/ryt8u8xy0.png)

![image](https://hackmd.io/_uploads/Syqlb4xJC.png)

# **PASSW.cpp**

```cpp
#include <bits/stdc++.h>

using namespace std;

string s,temp;
int k,maxx = 1;

bool dx(string s) {
    for (int i = 0; i <= s.length()/2; ++i)
        if (s[i] != s[s.length()-1-i]) return false;
    return true;
}

int main() {
    freopen("PASSW.INP","r",stdin);
    freopen("PASSW.OUT","w",stdout);
    cin >> s;
    for (int i = 0; i <= s.length()-1; ++i) {
        temp = "";
        if (s.length()-i <= maxx) break;
        for (int j = i; j <= s.length()-1; ++j) {
            temp += s[j];
            if (dx(temp) && temp.length() > maxx)
                maxx = temp.length();
        }
    }
    cout << maxx;
    return 0;
}
```

# **CATTHEP.cpp**

```cpp
#include <bits/stdc++.h>

using namespace std;

int n,k,r,l,A[500005],mid,kq;

bool sum(int n,int A[],int val) {
    int d = 0;
    for (int i = 1; i <= n; ++i)
        d += A[i]/val;
    return d >= k;
}

int main() {
    freopen("CATTHEP.INP","r",stdin);
    freopen("CATTHEP.OUT","w",stdout);
    cin >> n >> k;
    l = r = 1;
    for (int i = 1; i <= n; ++i) {
        cin >> A[i];
        r = max(r,A[i]);
    }
    while (l <= r) {
        mid = (l+r)/2;
        if (sum(n,A,mid)) {
            kq = mid;
            l = mid+1;
        }
        else r = mid-1;
    }
    cout << kq;
    return 0;
}
```
