| Bytes | Lang | Time | Link |
|---|---|---|---|
| 014 | 05AB1E | 240926T074513Z | Kevin Cr |
| 063 | R | 240926T063046Z | pajonk |
| 083 | JavaScript V8 | 240926T024815Z | l4m2 |
| 132 | Python3 | 240925T213810Z | Ajax1234 |
| 021 | Charcoal | 240925T211658Z | Neil |
05AB1E, 14 bytes
ZLãʒO%yн@εNQ}ß
Input as a pair of lists \$[d,e]\$.
Outputs all valid \$[m,n]\$-pairs within the range \$(1,1)\leq(m,n)\leq(\max(d\mathbin\Vert e),\max(d\mathbin\Vert e))\$. If there are possible test cases for which the output would be outside this range, I can fix it. EDIT: Confirmed by @l4m2 that at least one valid pair can always be found with \$m\leq\min(e)\$ and \$n\leq\max(e)\$ in affect.
Try it online or verify all test cases.
Explanation:
Z # Push the flattened maximum of the (implicit) input-pair of lists
L # Pop and push a list in the range [1,max]
ã # Pop and take all pairs of this list
ʒ # Filter this list of pairs [m,n] by:
O # Sum the current pair: m+n
% # Modulo all inner values of the (implicit) input by this (m+n)
yн # Push the first item of the current pair
@ # >= check on each inner value: i%(m+n) >= m
εNQ}ß # Check if the first list only contains 0s, and second list 1s:
ε # Map over this pair of checks:
NQ # Check for each check whether it equals the 0-based max-index
}ß # After the map: push the flattened minimum to check all are 1
# (after which the list of valid pairs is output implicitly)
JavaScript (V8), 83 bytes
x=>g=(y,i,h=(q,a)=>n=Math.min(...q.map(t=>t*a%i)))=>h(x,-1)+h(y,1)>0?[n,i]:g(y,-~i)
1 layer try
Output m+n, m
Python3, 132 bytes
def f(d,e):
q=[(1,1)]
for m,n in q:
if all(i%(m+n)<m for i in d)and all(i%(m+n)>=m for i in e):return m,n
q+=[(m+1,n),(m,n+1)]
Charcoal, 21 bytes
→W¬›⌊﹪ηⅈ⌈﹪θⅈM→I⟦ⅈ⌊﹪ηⅈ
Try it online! Link is to verbose version of code. Outputs m+n and m. Explanation:
→
Start by guessing that m+n might be 1. (This won't end well...)
W¬›⌊﹪ηⅈ⌈﹪θⅈ
Until all weekend days follow all weekdays...
M→
... increment m+n.
I⟦ⅈ⌊﹪ηⅈ
Output m+n and the earliest weekend day as m.