Logo
(追記) (追記ここまで)

21172번 - Ada Loveslaces 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB1333100.000%

문제

A shoe has a lacing geometry: $N,ドル the number of eyelets (on a side), $d,ドル the distance between eyelets, $s,ドル the separation between the columns of eyelets when the shoe is laced, and $t,ドル the thickness of an eyelet. In Figure 1 below, $N = 3,ドル with eyelets numbered from 0ドル$ to 2ドルN - 1$.

Figure 1: Eyelet numbering and dimensions for $N = 3$.

When laced, a shoelace of length $L$ will have two free ends for knot tying. The free length of each end is $f$. The length of $f$ must fall within a certain range, $[f_{min}, f_{max}]$ to accommodate a knot that is neither too small to tie nor so large as to dangle. See Figure 2 for a common criss-cross pattern.

Figure 2: Criss-cross lacing pattern showing free end length $f$.

That special end of a lace that prevents fraying is called an "aglet." You're welcome.

Unfortunately, shoelaces break at the most inopportune times. Before purchasing a new shoelace, it is often necessary to retie the shorter, broken lace, or replace it with another lace borrowed from another shoe.

Given $N, d, s, t, f_{min}, f_{max},ドル and a series of replacement shoelace lengths, $L,ドル for each shoelace length determine the number of lacing patterns that leave free ends, $f,ドル such that $f_{min} \le f \le f_{max}$. The rules of lacing are as follows:

  • The resulting lacing pattern must be symmetric across a line drawn vertically between the even-numbered and odd-numbered eyelets.
  • The lace can only pass through an eyelet at most once.
  • The lace can only pass between eyelets in the same column that are immediately adjacent.
  • The free ends of the lace must emerge from eyelet numbers 2ドルN - 2$ and 2ドルN - 1$.
  • The lace must pass directly between eyelet numbers 0 and 1 to ensure the shoelace holds the shoe on the foot.

You are to assume that the surface the eyelets are on is to be treated as a plane, that the shoelace passes through the center of the eyelets, and that the thickness of the shoelace itself is negligible. The total length of the shoelace that is used for lacing is the length used between the eyelets plus $t$ for each eyelet the shoelace passes through. In the example shown in Figure 2, 6ドルt$ of the shoelace length is used by passing through the six eyelets.

입력

The input begins with a single line containing $N, d, s, t, f_{min}, f_{max},ドル separated by whitespace. Each additional line is a new value of $L$ for which your program is to count the number of lacing patterns that meet the stated requirements. There will be between 1ドル$ and 100ドル$ values of $L$. All measurements are in integer millimeters.

$N$ will be between 2ドル$ and 9ドル$ inclusive. $d$ will be between 5ドル$ and 30ドル$ inclusive. $s$ will be between 10ドル$ and 50ドル$ inclusive. $t$ will be between 0ドル$ and 4ドル$ inclusive. $f_{min}$ and $f_{max}$ satisfy 0ドル \leq f_{min} \leq f_{max} \leq 2,000円$. Shoelace lengths will be between 200ドル$ and 2ドル,000円$ millimeters inclusive. $f_{min}$ and $f_{max}$ will not be within a micron (0ドル.001$ millimeters) of the free end lengths of a valid lacing pattern.

출력

For each shoelace length, your program is to print the number of possible lacing patterns that meet the above requirements. Values are to be separated from each other by newlines and/or spaces.

제한

예제 입력 1

3 10 25 3 125 175
485
410

예제 출력 1

1
5

힌트

출처

ICPC > Regionals > North America > North Central North America Regional > NCNA 2020 J번

ICPC > Regionals > North America > Southern California Regional > 2020 Southern California Regional 6번

  • 문제를 만든 사람: Marc Furon
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /