Программа, которая по номеру квартиры определяет подъезд и этаж

package com.gmail.vleynik.olad;

import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int floors = 9;
        int entrances = 4;
        int apartmentPerFloor = 4;
        int apartments;
        int currentEnter;
        int currentFloor;

        System.out.print("Enter apartments number: ");
        apartments = sc.nextInt();
        
        if (apartments >= 1 && apartments <= apartmentPerFloor * floors * entrances) {
            currentEnter = (apartments - 1) / (floors * apartmentPerFloor) + 1;
            currentFloor = (apartments - 1) % (floors * apartmentPerFloor / entrances) + 1;
            
            System.out.println("Entrance " + currentEnter);
            System.out.println("Floor " + currentFloor);
        } else {
            System.out.println("Wrong number");
        }
    }
}

Предложенное вами решение верно