Calculator Formula
- P: Total number of people
- \(C_{\text{total}}\): Total cost of the the stay
- \(S_{\%}\): Fixed shared percentage of the cost
- \(C_{\text{fixed}}\): Fixed cost shared by everyone
- \(C_{\text{remaining}}\): Remaining variable cost to be split based on nights stayed
- \(W_n\): Total weight for a given night
- \(w_{p,n}\): Weight of person \(p\) on night \(n\)
- Single: \( w = 3 \)
- Double: \( w = 2 \)
- Triple: \( w = 1 \)
- None: \( w = 0 \) (Not staying that night)
- \(C_{p,n}\): Cost contribution of person \(p\) for night \(n\)
- \(C_p\): Total cost per person
\[
C_{\text{fixed}} = C_{\text{total}} \times S_{\%}
\]
\[
C_{\text{remaining}} = C_{\text{total}} \times (1 - S_{\%})
\]
\[
W_n = \sum w_{p,n}
\]
\[
C_{p, n} = \left( \frac{w_{p,n}}{W_n} \right) \times C_{\text{remaining}}
\]
\[
C_p = \left( \frac{C_{\text{fixed}}}{P} \right) + \sum C_{p, n}
\]