Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct {
- int width, ratio, diameter;
- } tire;
- tire spec, vasya;
- int main(){
- int k;
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- scanf("%d", &k);
- scanf("%d/%dR%d", &spec.width, &spec.ratio, &spec.diameter);
- scanf("%d/%dR%d", &vasya.width, &vasya.ratio, &vasya.diameter);
- int r1 = spec.width * spec.ratio + spec.diameter * 1270;
- int r2 = vasya.width * vasya.ratio + vasya.diameter * 1270;
- if(abs(r1 - r2) * 100 <= k * r1) {
- printf("APPROVED");
- } else {
- printf("DISAPPROVED");
- }
- fclose(stdin);
- fclose(stdout);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement