<div id="6kms2b29k52-instruction"><p>There is a hackathon organized by HackerRank which has 2 separate tracks, healthcare and e-commerce. For track 1, the required team size is&nbsp;<em>teamSize_1,&nbsp;</em>while for track 2, the required&nbsp;team size is&nbsp;<em>teamSize_2.&nbsp;</em>The total number of participants is&nbsp;<em>p.&nbsp;</em></p>

<p>&nbsp;</p>

<p>Find the minimum number of teams into which the participants can be divided such that each participant belongs to exactly one team (either of track 1 or track 2), and each team has a size equal to either&nbsp;<em>teamSize_1&nbsp;</em>or&nbsp;<em>teamSize_2.&nbsp;</em>If no such division is possible, return -1.</p>

<p>&nbsp;</p>

<p>
<style type="text/css">.ps-content-wrapper-v0 div { margin: 0 auto; overflow: auto; } .ps-content-wrapper-v0 div.preheader { display: none; } .ps-content-wrapper-v0 p { white-space: pre-wrap; padding-left: 4px; padding-right: 4px; padding-top: 0px; padding-bottom: 2px; } .ps-content-wrapper-v0 p.section-title { font-weight: bold; padding-bottom: 0px; } .ps-content-wrapper-v0 ol.plain-list, .ps-content-wrapper-v0 ul.plain-list { list-style-type: none; padding: 4px; } .ps-content-wrapper-v0 li { white-space: normal; margin-top: 4px; margin-bottom: 4px; } .ps-content-wrapper-v0 code { color: black; } .ps-content-wrapper-v0 pre { background-color: #f4faff; border: 0; border-radius: 2px; margin: 8px; padding: 10px; } .ps-content-wrapper-v0 pre.scrollable-full-json { overflow-x: scroll; white-space: pre; } .ps-content-wrapper-v0 pre.scrollable-json { height: 300px; overflow-y: scroll; display: inline-grid; white-space: pre-wrap; padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px; } .ps-content-wrapper-v0 div.equation-parent { width: 400px; text-align: center; border: 1px solid #000; padding: 8px; } .ps-content-wrapper-v0 div.equation-parent.equation { width: 100%; display: inline-block; } .ps-content-wrapper-v0 figure { background-color: transparent; display: table; margin-top: 8px; margin-bottom: 8px; text-align: center; margin-left: auto; margin-right: auto; } .ps-content-wrapper-v0 figcaption { text-align: center; display: table-caption; caption-side: bottom; margin-top: 4px; margin-bottom: 4px; } .ps-content-wrapper-v0 img { width: auto; max-width: 100%; height: auto; } .ps-content-wrapper-v0 details { background-color: transparent; padding-left: 4px; padding-right: 4px; padding-top: 0px; padding-bottom: 2px; } .ps-content-wrapper-v0 details details { padding-left: 8px; padding-right: 8px; } .ps-content-wrapper-v0 details summary { background-color: #39424e; color: white; font-weight: bold; margin-top: 4px; margin-bottom: 4px; padding: 8px; } .ps-content-wrapper-v0 details details summary code { color: black; font-weight: bold; padding-left: 2px; padding-right: 2px; padding-top: 4px; padding-right: 4px; margin-left: 4px; } .ps-content-wrapper-v0 details div.collapsable-details { margin: 0 auto; padding-left: 4px; padding-right: 4px; padding-top: 0px; padding-bottom: 2px; overflow: auto; } .ps-content-wrapper-v0 details div.collapsable-details pre { margin-left: 4px; margin-right: 4px; margin-top: 4px; margin-bottom: 4px; } .ps-content-wrapper-v0 table.normal { border: 1px solid black; border-collapse: collapse; border-color: darkgray; margin: 0 auto; margin-top: 8px; margin-bottom: 8px; padding: 8px; width: 96%; table-layout: fixed; } .ps-content-wrapper-v0 table.normal tbody { display: block; overflow-x: auto; overflow-y: hidden; } .ps-content-wrapper-v0 table.normal tbody tr:first-child th { font-weight: bold; white-space: normal; } .ps-content-wrapper-v0 table.normal tbody tr th, .ps-content-wrapper-v0 table.normal tbody tr td { font-weight: normal; white-space: nowrap; text-align: center; vertical-align: middle; border: 1px solid black; border-color: darkgray; padding: 8px; } .ps-content-wrapper-v0 table.database-table { border-collapse: collapse; border-color: darkgray; border: 1px solid black; width: auto; margin-left: 4px; margin-top: 8px; margin-bottom: 8px; padding: 8px; } .ps-content-wrapper-v0 table.database-table tbody { overflow-x: auto; overflow-y: hidden; border: none; } .ps-content-wrapper-v0 table.database-table tbody tr th, .ps-content-wrapper-v0 table.database-table tbody tr td { font-weight: normal; white-space: nowrap; text-align: center; vertical-align: middle; border: 1px solid black; border-color: darkgray; padding: 8px; } .ps-content-wrapper-v0 table.database-table tbody tr th { font-weight: bold; border: 1px solid black; } .ps-content-wrapper-v0 table.database-table tbody tr:nth-child(2) td { border: 1px solid black; } .ps-content-wrapper-v0 table.database-table tbody tr:nth-child(n+2) td:first-child { border-left-color: black; } .ps-content-wrapper-v0 table.database-table tbody tr:nth-child(n+2) td:last-child { border-right-color: black; } .ps-content-wrapper-v0 table.database-table tbody tr:last-child td { border-bottom-color: black; } .ps-content-wrapper-v0 table.database-table tbody tr td.description { text-align: left; white-space: pre-wrap; } .ps-content-wrapper-v0 table.normal tbody tr th.description { width: 60%; } .ps-content-wrapper-v0 table.function-params tbody tr:first-child td.headers { border-bottom-width: 2px; } .ps-content-wrapper-v0 table.function-params tbody tr:last-child td { border-top-width: 2px; border-top-color: darkgray; } .ps-content-wrapper-v0 table.function-params tbody tr td.headers { width: 25%; font-weight: bold; text-align: center; border: 1px solid black; border-right-width: 2px; border-color: darkgray; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell { width: 100%; height: 100%; padding: 0px; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table { width: 100%; height: 100%; padding: 0px; margin: 0px; border: 0; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table tbody tr td.code { white-space: normal; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table tbody tr th { border-top: 0; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table tbody tr th:first-child { border-left: 0; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table tbody tr th:last-child { border-right: 0; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table tbody tr:last-child td { border-bottom: 0; border-top-width: 1px; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table tbody tr td:first-child { border-left: 0; } .ps-content-wrapper-v0 table.function-params tbody tr td.params-table-cell table.params-table tbody tr td:last-child { border-right: 0; } .ps-content-wrapper-v0 table.sudoku { border-collapse: collapse; border-color: darkgray; margin: 0 auto; margin-top: 8px; margin-bottom: 8px; padding: 8px; } .ps-content-wrapper-v0 table.sudoku colgroup, tbody { border: 3px solid black; } .ps-content-wrapper-v0 table.sudoku td { border: 1px solid black; height: 25px; width: 25px; text-align: center; padding: 0; } .ps-content-wrapper-v0 .left { text-align: left; } .ps-content-wrapper-v0 .right { text-align: right; } .ps-content-wrapper-v0 .code { font-family: monospace; white-space: nowrap; } .ps-content-wrapper-v0 .json-object-array ol, .ps-content-wrapper-v0 .json-object-array ol ul { margin-top: 0px; padding-left: 14px; } .json-object-array li { float: left; margin-right: 30px; margin-left: 10px; } .json-object-array pre { padding: 4px; margin-left: 0px; }
</style>
</p>

<div class="ps-content-wrapper-v0">
<p data-a11y="p-str" role="heading" aria-level="4"><strong>Example</strong></p>

<p>Consider <em>teamSize_1 = 3, teamSize_2 = 4 </em>and number of participants <em>p = 7. </em></p>

<p>&nbsp;</p>

<p>Optimally there is 1 team of 3 and 1 team of 4. The minimum number of teams is 2.</p>

<p>&nbsp;</p>

<p data-a11y="p-str" role="heading" aria-level="4"><strong>Function Description</strong></p>

<p>Complete the function <em>countTeams</em> in the editor below.</p>

<p>&nbsp;</p>

<p>The function <em>countTeams</em> has the following parameters:</p>

<p><em>&nbsp;&nbsp;&nbsp;&nbsp;int teamSize_1: </em>the number of participants in teams of track 1</p>

<p><em>&nbsp;&nbsp;&nbsp;&nbsp;int teamSize_2: </em>the number of participants in teams of track 2</p>

<p><em style="font-family:&quot;Whitney SSm A&quot; , &quot;Whitney SSm B&quot; , AvenirNext-Regular , &quot;Segoe UI&quot; , Ubuntu , &quot;Helvetica Neue&quot; , Helvetica , Arial , sans-serif;font-size:1em;font-weight:normal;">&nbsp;&nbsp;&nbsp;&nbsp;int p: </em>the total number of participants</p>

<p>&nbsp;</p>

<p data-a11y="p-str" role="heading" aria-level="4"><strong>Returns</strong></p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;<em>int: </em>the minimum number of teams into which the participants can be divided</p>

<p>&nbsp;</p>

<p data-a11y="p-str" role="heading" aria-level="4"><strong>Constraints</strong></p>

<ul>
	<li><em>1 ≤ teamSize_1 ≤&nbsp;10<sup>5</sup></em></li>
	<li><em>1 ≤ teamSize_2<sub>&nbsp;</sub>≤&nbsp;10<sup>5</sup></em></li>
	<li><em>1 ≤ p<sub>&nbsp;</sub>≤&nbsp;10<sup>5</sup></em></li>
</ul>

<p>&nbsp;</p>
<!-- <StartOfInputFormat> DO NOT REMOVE THIS LINE-->

<details><summary class="section-title" data-a11y="d-s"><span data-a11y="d-s-t" role="heading" aria-level="4">Input Format For Custom Testing</span></summary>

<div class="collapsable-details">
<p>The first line contains an integer, <em>teamSize_1</em>.</p>

<p>The second line contains an integer, <em>teamSize_2</em>.</p>

<p>The third line contains an integer, <em>p</em>.</p>
</div>
</details>
<!-- </StartOfInputFormat> DO NOT REMOVE THIS LINE-->

<details open="open"><summary class="section-title" data-a11y="d-s"><span data-a11y="d-s-t" role="heading" aria-level="4">Sample Case 0</span></summary>

<div class="collapsable-details">
<p class="section-title" data-a11y="d-p-s-t" role="heading" aria-level="5">Sample Input For Custom Testing</p>

<pre>STDIN &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;FUNCTION
----- &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--------
3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b id="docs-internal-guid-6fc555db-7fff-7abb-9d93-3d96b01f5263">→</b><b>&nbsp;&nbsp;&nbsp;&nbsp;</b>teamSize_1 = 3
4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b id="docs-internal-guid-6fc555db-7fff-7abb-9d93-3d96b01f5263">→</b><b>&nbsp;&nbsp;&nbsp;&nbsp;</b>teamSize_2 = 4
6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b id="docs-internal-guid-6fc555db-7fff-7abb-9d93-3d96b01f5263">→</b><b>&nbsp;&nbsp;&nbsp;&nbsp;</b>p = 6</pre>

<p class="section-title" data-a11y="d-p-s-t" role="heading" aria-level="5">Sample Output</p>

<pre>2
</pre>

<p class="section-title" data-a11y="d-p-s-t" role="heading" aria-level="5">Explanation</p>

<p>Optimally there are 2 teams of 3, and no teams of 4.</p>
</div>
</details>

<details><summary class="section-title" data-a11y="d-s"><span data-a11y="d-s-t" role="heading" aria-level="4">Sample Case 1</span></summary>

<div class="collapsable-details">
<p class="section-title" data-a11y="d-p-s-t" role="heading" aria-level="5">Sample Input For Custom Testing</p>

<pre>STDIN&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FUNCTION
-----  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--------
3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b id="docs-internal-guid-6fc555db-7fff-7abb-9d93-3d96b01f5263">→</b><b>&nbsp;&nbsp;&nbsp;&nbsp;</b>teamSize_1 = 3
4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b id="docs-internal-guid-6fc555db-7fff-7abb-9d93-3d96b01f5263">→</b><b>&nbsp;&nbsp;&nbsp;&nbsp;</b>teamSize_2 = 4
10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b id="docs-internal-guid-6fc555db-7fff-7abb-9d93-3d96b01f5263">→</b><b>&nbsp;&nbsp;&nbsp;&nbsp;</b>p = 10
</pre>

<p class="section-title" data-a11y="d-p-s-t" role="heading" aria-level="5">Sample Output</p>

<pre>3&ZeroWidthSpace;&ZeroWidthSpace;
</pre>

<p class="section-title" data-a11y="d-p-s-t" role="heading" aria-level="5">Explanation</p>

<p>Optimally there are 2 teams of 3 and 1 team of 4.</p>
</div>
</details>
</div>
</div> 

HTML Online Editor & Compiler

Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML. You can also specify the stylesheet information in styles.css tab and scripts information in scripts.js tab and start coding.

About HTML

HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.

Syntax help

Fundamentals

  • Any HTML document must start with document declaration <!DOCTYPE html>
  • HTML documents begin with <html> and ends with </html>
  • Headings are defined with <h1> to <h6> where <h1> is the highest important heading and <h6> is the least important sub-heading.
  • Paragrahs are defined in <p>..</p> tag.
  • Links are defined in <a> tag.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    
  • Images are defined in <img> tag, where src attribute consists of image name.
  • Buttons are defined in <button>..</button> tag
  • Lists are defined in <ul> for unordered/bullet list and <ol> for ordered/number list, and the list items are defined in <li>.

HTML Elements and Attributes

  • HTML element is everything present from start tag to end tag.
  • The text present between start and end tag is called HTML element content.
  • Anything can be a tagname but it's preferred to put the meaningful title to the content present as tag name.
  • Do not forget the end tag.
  • Elements with no content are called empty elements.
  • Elements can have attributes which provides additional information about the element.
  • In the below example, href is an attribute and a is the tag name.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    

CSS

CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.

Example:

Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.

body{
  padding: 25px;
}
.title {
	color: #228B22;
	font-family: Candara;
}

HTML Tables

  • HTML Tables are defined in <table> tag.
  • Table row should be defined in <tr> tag
  • Table header should be defined in <th> tag
  • Table data should be defined in <td> tag
  • Table caption should be defined in <caption> tag

HTML-Javascript

  • Javascript is used in HTML pages to make them more interactive.
  • <script> is the tag used to write scripts in HTML
  • You can either reference a external script or write script code in this tag.

Example

<script src="script.js"></script>