Under construction

Still being built. Things may change

자동차 주차

Interview

Time limit1sMemory limit1024 MB

Summary
Count the distinct ways to arrange A red, B green, and C blue cars in N parking spaces, where cars of the same color are indistinguishable.
Level

Easy3 of 10

Topics
Combinatorics, Math
Solved
No attempts yet

문제

Park AA red cars, BB green cars, and CC blue cars in a parking lot with NN spaces, one car per space. All cars are the same model and differ only in color.

Find the number of ways all cars can be parked, one car per space.

입력

The first line contains positive integers NN, AA, BB, and CC, separated by spaces.

출력

Print the answer on the first line.

제한

  • A+B+C=N≤15A+B+C = N \leq 15

Examples2

  1. Example 1

    Input
    7 2 2 3
    
    Expected output
    210
    
  2. Example 2

    Input
    8 1 2 5
    
    Expected output
    168