MeetCode
Largest Multiple <= N
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Largest Multiple <= N
Easy
Computer Mathematics
Integers & Divisibility
30 views
Explanation
Complexity
Problem Statement
Given n and k>0, print the largest multiple of k that is
Input Format
Two integers n k.
Output Format
One integer.
Example
Input
23 5
Output
20
Constraints
k>0
Input / Output Format
Input Format
Two integers n k.
Output Format
One integer.
Constraints
k>0
Examples
Input:
23 5
Output:
20
Example Solution (Public)
Computer Mathematics
Compute q = floor(n/k). Answer = q*k.
Official Solution Code
Wrap
Copy
Compute q = floor(n/k). Answer = q*k.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
23 5
Expected Output
20
Compile Output
Error
Output
Please
login
to submit solutions.