5 1 1 2 2 5 3
4
符合條件的積木如圖所示
【樣例輸入 2】
233 5 1 8 100 215 3
【樣例輸出 2】
308810105
【評(píng)測(cè)用例規(guī)模與約定】
對(duì)于 10% 的評(píng)測(cè)用例,1 ≤ n ≤ 10, 1 ≤ w ≤ 10, 0 ≤ L ≤ R ≤ 3;
對(duì)于 20% 的評(píng)測(cè)用例,1 ≤ n ≤ 20, 1 ≤ w ≤ 10, 0 ≤ L ≤ R ≤ 4;
對(duì)于 35% 的評(píng)測(cè)用例,1 ≤ n ≤ 500, 0 ≤ L ≤ R ≤ 10;
對(duì)于 50% 的評(píng)測(cè)用例,1 ≤ n ≤ 5000, 0 ≤ L ≤ R ≤ 10;
對(duì)于 60% 的評(píng)測(cè)用例,1 ≤ n ≤ 20000, 0 ≤ L ≤ R ≤ 10;
對(duì)于 70% 的評(píng)測(cè)用例,1 ≤ n ≤ 50000, 0 ≤ L ≤ R ≤ 10;
對(duì)于 85% 的評(píng)測(cè)用例,1 ≤ n ≤ 300000, 0 ≤ L ≤ R ≤ 10;
對(duì)于所有評(píng)測(cè)用例,1 ≤ n ≤ 500000, 1 ≤ w ≤ 109, 0 ≤ L ≤ R ≤ 40, 1 ≤ x < y ≤ n, 0 ≤ z ≤ 109。