Sorry, but I do not understand what you said
I found a slightly different solution that still works in case the guards have limited knowledge - guards in front of black doors only know if the treasure is behind black doors and guards
This will be the final example, as I feel it's enough info already.
Recap:
21 *|* 7 = 11
17924 *|* 10751 = 851
1089 *|* 121 = 2069
10 *|* 23 = 6
1 *|* 0 = 2
999 *|* 909 = 1359
14 *|* 14 = 14
2 *|* 1 = 0
and
a *|* b = b *|* a