ElBlo
Resident Evil 8 Money Challenges
Recently, I got hooked on «Resident Evil 8: Village». After you beat the game, it has a bunch of achievements to complete. There are a few of them that require you to have a specific amount of Lei (money) in your inventory, and this post talks about how to solve them.
TL;DR: Get your money ~150 Lei below the challenge number, and input the total and your current Lei in this website.
These challenges are:

Lucky Number 7: Have 777, 7,777, or 77,777 Lei in your possession in the story.

Anniversary Present: Have 52,911 Lei in your possession in the story.

Countdown: Have 54,321 Lei in your possession in the story.
To solve these challenges, you don’t need to keep a “good” game save, you can just exit the game without saving after you exit the challenge, and it will still count.
The basics here are that you need to make specific sells/purchases to be able to get to that amount of Lei. The easiest way to do it is by selling Shotgun ammo and Handgun ammo, which sells for 7 and 15 Lei, respectively.
These are the steps:

First, buy / sell stuff until you are at least 150 Lei before your target. Let’s say your target is $X$, and you have $Y$. $Y \le X  150$.

The amount of money that you need is $Z = X  Y$.

Calculate the remainder of dividing $Z$ by $7$. Let’s call this $rem(Z, 7)$.

Now you need to sell $rem(Z, 7)$ Handgun ammo.

You will end up with $W$ Lei. Sell $\frac{X  W}{7}$ Shotgun ammo.
A Real Example
Let’s say you want to solve the «Countdown Challenge», which is to have $54321$ Lei. Let’s also say that by selling/buying items, you got to $54110$ Lei. So $X = 54321$ and $Y = 54110$.
$Z = X  Y = 54321  54110 = 211$
$rem(Z, 7) = rem(211, 7) = 1$
This means that you need to sell 1 case of Handgun ammo. Your new total will be $W = 54110 + 15 = 54125$. Finally, you just need to sell $\frac{5432154125}{7} = \frac{196}{7} = 28$ Shotgun ammo cases. This will leave you with $54321$ Lei: $54125 + 196 = 54321$.
How does it work?
The idea is that by selling Handgun ammo, you can make it so that the remaining money you need to get is a multiple of seven. If the remainder of dividing what you need by $7$ is $3$, this means that by subtracting $3$ from what you need, you get something that is evenly divisible by $7$. After that, you can simply sell Shotgun Ammo cases until you reach the amount of money required by the challenge.
Sadly, you cannot sell items for just any random amount of money, and you are stuck which the prices that Duke the merchant sets for you. Given that $15 \equiv 1 (mod\ 7)$, each time you sell a Handgun ammo case, it is like you are subtracting $1$ from what you need to be divisible by $7$. So if in the previous example, you can sell $3$ Handgun ammo cases, and what the remaining money that you need to complete the challenge will be divisible by $7$.
The “less than 150 from the goal” requirement is a bound so that you can always get to a number that is divisible by 7 by selling Handgun ammo, without going over. A tighter bound would be $6 \times 15 = 90$ as at most you would need to sell 6 Handgun ammo cases.
I don’t want to do math, give me the code.
Here is a Go program that performs all the calculations for you:
package main
import "fmt"
func main() {
LeiCalculator(54321, 54110)
}
func LeiCalculator(want, got uint64) {
X, Y := want, got
fmt.Printf("Trying to get to %d Lei from %d Lei\n", X, Y)
if X < Y+105 {
fmt.Printf("Please get your current Lei at least 105 less than your expected target")
return
}
Z := X  Y
// Check if we can get by just by selling Handgun Ammo:
if Z%15 == 0 {
Hammo := Z / 15
W := Y + Hammo*15
fmt.Printf("Sell %d Handgun Ammo. Your new total should be %d\n", Hammo, W)
return
}
Zr := Z % 7
W := Y + (Zr * 15)
fmt.Printf("Sell %d Handgun Ammo, your new total should be: %d\n", Zr, W)
R := (X  W)
fmt.Printf("Need to get %d more Lei\n", R)
Rammo := R / 7
N := R + W
fmt.Printf("Sell %d Rifle Ammo, your new total should be: %d\n", Rammo, N)
}