問題一覧 > 通常問題

No.373 かけ算と割った余り

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 607
作問者 : nmnmnmnmnmnmnm / テスター : 紙ぺーぱー
お気に入りにしたユーザー ProblemId : 748 / 自分の提出
問題文最終更新日: 2026-06-25 01:30:13
Multiplication and Remainder
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
yukicoder contest 138 (順位表) の他の問題:

Problem Statement

Multiply the integer A by the integer B, then multiply the result by the integer C, and finally find the remainder when divided by the integer D.

Input

A B C D

A, B, C, D are positive integers. $1 \le $ A,B,C,D $ \le 1000000000=10^9$.

Output

Output the answer of the calculation on one line.
Do not forget the newline at the end.

Sample

Sample 1
Input
1 2 3 4
Output
2

"The remainder of 1 times 2 times 3 divided by 4" is 2.

Sample 2
Input
2 2 2 2
Output
0

"The remainder of 2 times 2 times 2 divided by 2" is 0.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。