Balls of Three Colors
시간 제한2초메모리 제한2048 MB
빨간 공 r개, 초록 공 g개, 파란 공 b개를 일렬로 나열할 때 이웃한 두 공의 색이 다른 배열의 수를 998244353으로 나눈 나머지를 구한다. 각 개수는 1 이상 100000 이하다.
문제
There are red, green, and blue balls. How many ways are there to arrange all these balls in a row such that any two adjacent balls have different colors? Since this number can be very large, output its remainder when divided by the prime number .
입력
You are given three integers separated by spaces: , , and . Each of the integers is from to inclusive.
출력
Output a single integer: the required number of ways modulo .