A. 王老师的新水杯

    Type: Default 1000ms 256MiB

王老师的新水杯

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

最近王老师换了个带吸管的水杯。

Csvoner 发现当王老师使用带吸管的水杯时,每天会喝 xx 毫升的水。而使用不带吸管的水杯时,每天会喝 yy 毫升的水。

请问在 nn 天的时间内,王老师喝水量的上限与下限相差多少?

输入格式

第一行为空格隔开的三个整数 n,x,yn,x,y

输出格式

一行一个整数,表示题意中的差值。

3 10 5 
15
4 100 100
0
5 100 1000 
4500

样例解释

  • 样例一中,33 天内最多喝 3×10=303\times 10 = 30 的水,最少喝 3×5=153\times 5 = 15 的水,相差 3015=1530-15=15
  • 样例二中,44 天内最多喝 4×100=4004\times 100 = 400 的水,最少喝 4×100=4004\times 100 = 400 的水,相差 400400=0400-400=0
  • 样例三中,55 天内最多喝 5×1000=50005\times 1000 = 5000 的水,最少喝 5×100=5005\times 100 = 500 的水,相差 5000500=45005000-500=4500

数据规模与约定

对于 100%100\% 的数据,1n,x,y1061 \le n,x,y \le 10^6

  • 子任务 1(30 分):保证 x=yx=y
  • 子任务 2(30 分):保证 x>yx>y
  • 子任务 3(40 分):没有特殊限制。

2025年新学期选拔赛

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2025-2-21 17:00
End at
2025-2-21 19:00
Duration
2 hour(s)
Host
Partic.
80