---
# System prepended metadata

title: 13576 - Anya wants to study math
tags: [I2P(I)]

---

###### tags: `I2P(I)`
# 13576 - Anya wants to study math

> [color=#efbe37] If the solution is ambiguous or hard to understand, please contact me. Thanks.
> d0922396206@gmail.com

## Brief
Given three integers $G$, $B$, and $S$:
$G$: The number of guns
$B$: The number of bullets per gun
$S$: The number of spy
Calculate the total number of bullets and how many guns a spy can be distributed

## Solution


> Total number of bullets should be $G$ * $B$, and how many guns a spy can be distributed should be $G$/$S$(write as the format of %.2f).
> However, some students only pass 3 testcases in this problem. The reason is that $G$ and $B$ are large in final testcase($G$ = 100000, $B$ = 100000). Therefore, only using data type of $int$ to express $G$*$B$ will exceed the range of $int$.


## Reference Code
```cpp=
#include <stdio.h>

int main(){
    long long int a; //prevent to exceed range of int
    float g, b, s, x;
    
    scanf("%f %f %f",&g,&b,&s);
    
    a = g * b;
    x = g / s;
    
    printf("%lld\n", a); //the total number of bullets
    printf("%.2f\n", x); //how many guns a spy can be distributed
    
    return(0);
}
```