Each question you read will present a different interesting problem for you to solve. Each problem consists of a few common parts:
Let's look at Vases from AIO 2019 as an exaple. See if you can spot all the sections described above. Then give the problem a shot! There are some templates provided below to help you get started. Feel free to use them if you're not comfortable with reading input and writing output. Click on the hint if you're stuck coming up with a solution.
/*
* Solution Template for Vases
*
* Australian Informatics Olympiad 2019
*
* This file is provided to assist with reading of input and writing of output
* for the problem. You may modify this file however you wish, or
* you may choose not to use this file at all.
*/
#include <cstdio>
/* N is the number of flowers. */
int N;
int a;
int b;
int c;
int main(void) {
/* Read the value of N. */
scanf("%d", &N);
/*
* TODO: This is where you should compute your solution. Store the number
* of flowers that should go in the first, second and third jars in the
* variables a, b and c. If it is impossible to arrange the flowers
* according to the rules, set each of these variables to 0.
*/
/* Print the answer. */
printf("%d %d %d\n", a, b, c);
return 0;
}
import sys
sys.setrecursionlimit(1000000000)
#
# Solution Template for Vases
#
# Australian Informatics Olympiad 2019
#
# This file is provided to assist with reading of input and writing of output
# for the problem. You may modify this file however you wish, or
# you may choose not to use this file at all.
#
# N is the number of flowers.
N = None
a = None
b = None
c = None
# Read the value of N.
N = int(input().strip())
# TODO: This is where you should compute your solution. Store the number of
# flowers that should go in the first, second and third jars in the variables
# a, b and c. If it is impossible to arrange the flowers according to the
# rules, set each of these variables to 0.
# Print the answer.
print(a, b, c)