私は最近、新年までに物理教科書全体を読むように言われました(残念ながら実話)。毎日どの章を読むべきかを決めるのにあなたの助けが必要です。ここがあなたの出番です。
入力
- 任意の形式の2つの日付。2番目の日付は常に最初の日付より後です。
- 章番号のリスト。このコンマ区切りリストには、単一の章(
12
)または包括的範囲(1-3
)を含めることができます。例1-3,5,6,10-13
。 Monday -> Mo
スケジュールから除外する曜日のリスト(名前の最初の2文字で表されます)。例Mo,Tu,Fr
。
出力
出力は、改行で区切られた日付と章番号のリストになります(以下の形式を参照)。支部は、指定された平日を除き、範囲内のすべての日に均等に分散する必要があります。チャプターが均等に分配されない場合は、期間の終わりにチャプターの量が少ない日があるようにします。出力の日付は、入力とは異なる形式にすることができます。チャプターがない日は省略できますが、単にチャプターがない場合もあります。
例:
入力: 9/17/2015 9/27/2015 1-15 Tu
出力:
9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15
例の入力は、9/22は火曜日であるため、「9/17/2015 9/27/2015 1-15 Tu」である必要があります。
—
DavidC
@DavidCarraherあなたは正しいです、私がサンプル入力をしたとき、私は何らかの理由で11月を考えていました。
—
GamrCorps
それが私の場合、最後の日付にはすべての章があります:)
—
MickyT
@MickyTは、まさにこのチャレンジに対する私のインスピレーションです。
—
-GamrCorps
物理学がどれほど素晴らしいかがすぐにわかるでしょう。あなたは実際に幸運です。
—
fcalderan