luogu#P5187. [COCI 2009/2010 #4] KABOOM

[COCI 2009/2010 #4] KABOOM

Problem Description

Translated from COCI 2010.02 T5 “KABOOM”.

Pay attention to the time limit of this problem.

Luka found a strange tape in the laboratory. The tape is divided into NN segments, numbered from left to right as 1N1\ldots N. The thickness of the tape can be ignored.

The tape can only be bent at the junction between two segments, and it can only be folded by 180°.

Obviously, the tape has two sides. One side of the tape is fully coated with extremely sticky glue, while on the other side, only the first AA segments and the last BB segments are coated with extremely sticky glue.

How many ways can Luka fold the tape so that he can restore the scene (Luka’s hands will not stick to the tape, but if two glued sides stick together, Luka cannot pull them apart)? Output the answer modulo 1030110301.

Input Format

The first line contains three integers N,A,BN, A, B.

Output Format

Output one integer, the answer.

4 1 1
6
5 2 2
1
6 1 2
7

Hint

Sample Explanation 1

Constraints and Notes

1A+BN1000,1\le A+B\le N\le 1000, A>0,A>0, B>0B>0.

Translated by ChatGPT 5