<a href="https://leetcode.com/problems/rabbits-in-forest/" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Rabbits in Forest</i></a>
Input Format
check the link
Output Format
check the link
Constraints
check the link
Example
Input
3 1 1 2
Output
5