Devu And His Brother

medium
<a href="https://codeforces.com/problemset/problem/439/D" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Devu and his Brother</i></a>

Input Format

Check the link

Output Format

Check the link

Constraints

Check the link

Notice

Check the link

Example

Input
2 2
2 3
3 5
Output
3
Previous
Longest Palindromic Substring
Next
Park Regions

Related Questions