└── team /team: -------------------------------------------------------------------------------- 1 | The math teacher, Mr. Johnson, is preparing students for an upcoming Math Olympics competition, and he wants to create study groups to foster collaborative learning. Mr. Johnson seeks your assistance in automating the process of dividing students into equal-sized teams, taking into account any remaining students who can assist with additional math challenges. Can you provide a program that takes the total number of students and the desired number of study groups as input and outputs the number of students in each study group along with the count of remaining students? 2 | 3 | Input Format 4 | 5 | The total number of students in the class. The desired number of study groups. 6 | 7 | Constraints 8 | 9 | Null 10 | 11 | Output Format 12 | 13 | The number of students in each study group. The count of remaining students. 14 | 15 | Sample Input 0 16 | 17 | 50 18 | 6 19 | Sample Output 0 20 | 21 | The number of students in each team is 8 and left out is 2 22 | Sample Input 1 23 | 24 | 60 25 | 7 26 | Sample Output 1 27 | 28 | The number of students in each team is 8 and left out is 4 29 | Sample Input 2 30 | 31 | 75 32 | 9 33 | Sample Output 2 34 | 35 | The number of students in each team is 8 and left out is 3 36 | 37 | import java.io.*; 38 | import java.util.*; 39 | 40 | public class Solution { 41 | 42 | public static void main(String[] args) { 43 | Scanner sc=new Scanner(System.in); 44 | int n1=sc.nextInt(); 45 | int n2=sc.nextInt(); 46 | int r=n1%n2; 47 | int q=n1/n2; 48 | System.out.print("The number of students in each team is "+q+" and left out is "+r); 49 | /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ 50 | } 51 | } 52 | --------------------------------------------------------------------------------