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