Why did Bismarck form the Triple Alliance?

to prevent Germany from attacking France
to increase Germany's defense against France
to protect Germany from attacks by Russia