Official

A - I Scream Editorial by en_translator


If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.

It contains \(A + B\) percent milk solids.
It contains \(B\) percent milk fat. One can check by conditional branch to determine which of the four categories it falls into.

Sample Code (C)

#include <stdio.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int a = ri();
	int b = ri();
	int c = a + b;
	
	if (c >= 15 && b >= 8) puts("1");
	else if (c >= 10 && b >= 3) puts("2");
	else if (c >= 3) puts("3");
	else puts("4");
	
	return 0;
}

Sample Code (Python)

a, b = map(int, input().split())
c = a + b

if c >= 15 and b >= 8 : print(1)
elif c >= 10 and b >= 3 : print(2)
elif c >= 3 : print(3)
else : print(4)

posted:
last update: