Stepan's Friends#7401

Stepan's Friends (Editorial)

Algorithm Analysis

Stepan distributed n - 1 stones, one to each friend. Thus, he has n - 1 friends.

Algorithm Implementation

Read the number of stones n and output the answer n - 1.

scanf("%d", &n);
printf("%d\n", n-1);

Java Implementation

import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner con = new Scanner(System.in);
        int n = con.nextInt();
        int res = n - 1;
        System.out.println(res);
    }
}

Python Implementation

n = int(input())
res = n - 1
print(res)