Cards Trick

A trick between 2 magicians, exposing the math behind

This is a communicational technique, in pocker cards (Baloot).

Idea

Explaination

Steps for $A$:

Steps for $B$:

Implementation

Here is a C++ code that does this