Skip to content

Instantly share code, notes, and snippets.

View zwang96-dl's full-sized avatar
🤔
hmm

Zhe Wang zwang96-dl

🤔
hmm
View GitHub Profile
@zwang96-dl
zwang96-dl / pypdf_to_image.py
Created October 13, 2016 09:37 — forked from rririanto/pypdf_to_image.py
Python Convert PDF to Image
"""
Problem:
How to Convert PDF to Image with Python Script ?
Installation:
I use ubuntu OS 14.04
We use wrapper for ImageMagick [http://www.imagemagick.org/script/index.php] to Convert The PDF file
in Python do:
$ sudo apt-get install libmagickwand-dev
from functools import lru_cache
class Solution:
def maxNiceDivisors(self, primeFactors):
res = 1
for num_pieces in range(1, primeFactors // 2 + 1):
if primeFactors % num_pieces == 0:
each_piece_cnt = primeFactors // num_pieces
# 均值定理
res = max(res, each_piece_cnt ** num_pieces)