{"id":"ad2e12ba-a8aa-47b9-855d-61702b526245","name":"Solve 7n By 8","description":"1. You are given a number n.\r\n2. You have to calculate the value of 7n/8 without using division and multiplication.","inputFormat":"A number n","outputFormat":"Check the sample ouput and question video.","constraints":"1 &lt;= n &lt;= 10^9","sampleCode":{"cpp":{"code":"#include<bits/stdc++.h>\nusing namespace std;\nint main()\n{\n int n;\n cin>>n;\n \n return 0;\n}"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args){\r\n Scanner scn = new Scanner(System.in);\r\n int n = scn.nextInt();\r\n //write your code here\r\n \r\n }\r\n\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"15","sampleOutput":"13\r\n","questionVideo":"https://www.youtube.com/embed/k9Yxy-NhSTA?end=718","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"f3e3dbef-d2b7-4f6d-b357-2ef3738e6c91","name":"Bit Manipulation For Intermediate","slug":"bit-manipulation-for-intermediate-9995","type":0},{"id":"67e0f9c0-3dae-404f-aee9-718f0ea9ba47","name":"Solve 7n By 8","slug":"solve-7n-by-8","type":1}],"next":{"id":"aca2fa1a-8f15-4900-9494-5c4a4b99b7e1","name":"Solve 7n / 8 MCQ","type":0,"slug":"solve-7n-8-mcq"},"prev":{"id":"c9c5ab99-9bb6-4368-b784-eb313c721ed7","name":"Is a Power of 4","type":3,"slug":"is-a-power-of-4"}}}

Solve 7n By 8

1. You are given a number n. 2. You have to calculate the value of 7n/8 without using division and multiplication.

{"id":"ad2e12ba-a8aa-47b9-855d-61702b526245","name":"Solve 7n By 8","description":"1. You are given a number n.\r\n2. You have to calculate the value of 7n/8 without using division and multiplication.","inputFormat":"A number n","outputFormat":"Check the sample ouput and question video.","constraints":"1 &lt;= n &lt;= 10^9","sampleCode":{"cpp":{"code":"#include<bits/stdc++.h>\nusing namespace std;\nint main()\n{\n int n;\n cin>>n;\n \n return 0;\n}"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args){\r\n Scanner scn = new Scanner(System.in);\r\n int n = scn.nextInt();\r\n //write your code here\r\n \r\n }\r\n\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"15","sampleOutput":"13\r\n","questionVideo":"https://www.youtube.com/embed/k9Yxy-NhSTA?end=718","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"f3e3dbef-d2b7-4f6d-b357-2ef3738e6c91","name":"Bit Manipulation For Intermediate","slug":"bit-manipulation-for-intermediate-9995","type":0},{"id":"67e0f9c0-3dae-404f-aee9-718f0ea9ba47","name":"Solve 7n By 8","slug":"solve-7n-by-8","type":1}],"next":{"id":"aca2fa1a-8f15-4900-9494-5c4a4b99b7e1","name":"Solve 7n / 8 MCQ","type":0,"slug":"solve-7n-8-mcq"},"prev":{"id":"c9c5ab99-9bb6-4368-b784-eb313c721ed7","name":"Is a Power of 4","type":3,"slug":"is-a-power-of-4"}}}
plane

Editor


Loading...

Solve 7n By 8

easy

1. You are given a number n. 2. You have to calculate the value of 7n/8 without using division and multiplication.

Constraints

1 <= n <= 10^9

Format

Input

A number n

Output

Check the sample ouput and question video.

Example

Sample Input

15

Sample Output

13

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode