No tags yet

No tag edit access

The problem statement has recently been changed. View the changes.

×
Time limit per test: 0.25 second(s)

Memory limit: 262144 kilobytes

Memory limit: 262144 kilobytes

input: standard

output: standard

output: standard

Andrew has just made a breakthrough in group theory: he realized that he can classify all finite Abelian groups (not much of a breakthrough, indeed). Given

*Closure*: for all*a*,*b*in*A*, the result of the operation*a*·*b*is also in*A*.*Associativity*: for all*a*,*b*and*c*in*A*, the equation (*a*·*b*) ·*c*=*a*· (*b*·*c*) holds.*Identity element*: there exists an element*e*in*A*, such that for all elements*a*in*A*, the equation*e*·*a*=*a*·*e*=*a*holds.*Inverse element*: for each*a*in*A*, there exists an element*b*in*A*such that*a*·*b*=*b*·*a*=*e*, where*e*is the identity element.*Commutativity*: for all*a*,*b*in*A*,*a*·*b*=*b*·*a*.

sample input | sample output |

5 | 1 |

sample input | sample output |

4 | 2 |

sample input | sample output |

12 | 2 |

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/13/2021 00:25:28 (j1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|